Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Please excuse this XEmacs user's desperation: smtpmail.el over SSL

46 views
Skip to first unread message

edburns

unread,
Mar 29, 2010, 10:02:05 PM3/29/10
to
I know this is GNU emacs, not XEmacs, but I've never had the chutzpa
to migrate. I'm very sorry. Please excuse me. If anyone can help me
here, I would really be grateful. I've spent many hours in edebug
mode and still am no closer to a solution than when I started.


Hello distinguished lisp programmers,
I have asked Mr. Simon Josefsson to help with this but have
received no reply in over a week of waiting. I sincerely
hope you can help me.
When Oracle bought my employer, Sun Microsystems, naturally
they migrated all the users to Oracle's mail server. The
configuration I had working no longer works.
Oracle's mail server wants AUTH LOGIN over an SSL
connection. I have a plain vanilla XEmacs 21.4.22
installation (with mail-lib version 1.80, VM version
8.0.12-devo-585), which I'm starting with xemacs --vanilla
&. Then, I'm evaluating a region including the following
expressions.
(setq starttls-use-gnutls t)
(setq starttls-gnutls-program "gnutls-cli")
(setq send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials
'(("stbeehive.oracle.com" 465 nil nil))
smtpmail-auth-credentials
(expand-file-name "~/.authinfo")
smtpmail-default-smtp-server "stbeehive.oracle.com"
smtpmail-smtp-server "stbeehive.oracle.com"
smtpmail-smtp-service 465
smtpmail-debug-info t)
(require 'smtpmail)
FYI: gnutl-cli is on my path
bash-3.00$ gnutls-cli-debug --version
gnutls-cli (GnuTLS) 2.2.0
However we don't even get that far. I'm finding that XEmacs
hangs within smtpmail.el at this line:
(defun smtpmail-open-stream (process-buffer host port)
(let ((cred (smtpmail-find-credentials
smtpmail-starttls-credentials host port)))
(if (null (and cred (condition-case ()
;; XEmacs change
(with-boundp '(starttls-use-gnutls
starttls-gnutls-program
starttls-program)
(require 'starttls)
(call-process (if starttls-use-gnutls
starttls-gnutls-program
starttls-program)))
(error nil))))
;; The normal case.
=> (open-network-stream "SMTP" process-buffer host port)
(let* ((cred-key (smtpmail-cred-key cred))
(cred-cert (smtpmail-cred-cert cred))
host is stbeehive.oracle.com
port is 465
Can anyone help me here? I mean, open-network-stream is just opening
a simple TCP connection. That happens before SSL is established,
right?

Can anyone please help?

Sincerely,

Ed Burns

edburns

unread,
Mar 29, 2010, 11:25:26 PM3/29/10
to
> Can anyone please help?

I'm so desperate for help that I'll send the first person who gets me
up and running a free copy of my book "Secrets of the Rockstar
Programmers" <http://ridingthecrest.com>.

Please help!

Thanks,

Ed

Christian Dietrich

unread,
Mar 30, 2010, 9:30:50 AM3/30/10
to
edburns <edb...@gmail.com> schrieb:

> I know this is GNU emacs, not XEmacs, but I've never had the chutzpa
> to migrate. I'm very sorry. Please excuse me. If anyone can help me
> here, I would really be grateful. I've spent many hours in edebug
> mode and still am no closer to a solution than when I started.
>=> (open-network-stream "SMTP" process-buffer host port)

This line seems to just opening the TCP Connection, Can you `message'
the host/port or see it in the debugger (I never tried edebug, but i
think i shoul). Can you connect there with netcat/telnet?

> Can anyone help me here? I mean, open-network-stream is just opening
> a simple TCP connection. That happens before SSL is established,
> right?

Work around:
If you have ssh connection to an server were sendmail is working
properly:

Set the sendmailprogramm to `ssh host /usr/sbin/sendmail'. Works for
me perfectly.

greetz didi
--
No documentation is better than bad documentation
-- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

edburns

unread,
Mar 30, 2010, 11:19:15 AM3/30/10
to
On Mar 30, 9:30 am, Christian Dietrich <stettber...@peer.zerties.org>
wrote:
> edburns <edbu...@gmail.com> schrieb:

>
> > I know this is GNU emacs, not XEmacs, but I've never had the chutzpa
> > to migrate.  I'm very sorry.  Please excuse me.  If anyone can help me
> > here, I would really be grateful.  I've spent many hours in edebug
> > mode and still am no closer to a solution than when I started.
> >=>  (open-network-stream "SMTP" process-buffer host port)
>
> This line seems to just opening the TCP Connection, Can you `message'
> the host/port or see it in the debugger (I never tried edebug, but i
> think i shoul). Can you connect there with netcat/telnet?
>
> > Can anyone help me here?  I mean, open-network-stream is just opening
> > a simple TCP connection.  That happens before SSL is established,
> > right?
>
> Work around:
> If you have ssh connection to an server were sendmail is working
> properly:
>
> Set the sendmailprogramm to `ssh host /usr/sbin/sendmail'. Works for
> me perfectly.

Ahh, if it were that simple. While sendmail is installed at /usr/sbin/
sendmail,
it is configured to route through Sun's MTA, not Oracles. Besides, it
said
something about "requires valid sender domain".

Anyone else? Anything new? Free book!

Ed

Andreas Politz

unread,
Mar 30, 2010, 12:33:41 PM3/30/10
to
edburns <edb...@gmail.com> writes:

> (defun smtpmail-open-stream (process-buffer host port)
> (let ((cred (smtpmail-find-credentials
> smtpmail-starttls-credentials host port)))

===> (if (null (and cred (condition-case ()


> ;; XEmacs change
> (with-boundp '(starttls-use-gnutls
> starttls-gnutls-program
> starttls-program)
> (require 'starttls)
> (call-process (if starttls-use-gnutls
> starttls-gnutls-program
> starttls-program)))
> (error nil))))
> ;; The normal case.
> => (open-network-stream "SMTP" process-buffer host port)
> (let* ((cred-key (smtpmail-cred-key cred))
> (cred-cert (smtpmail-cred-cert cred))
> host is stbeehive.oracle.com
> port is 465
> Can anyone help me here? I mean, open-network-stream is just opening
> a simple TCP connection. That happens before SSL is established,
> right?
>

Either `cred' is unbound at this point, or there is an error inside
the condition-case. So the questions are :

a) What is the value of `cred' ?
b) What happens (error or not) if you remove the condition-case
from this function ?

> Can anyone please help?
>

-ap

> Sincerely,
>
> Ed Burns

Andreas Politz

unread,
Mar 30, 2010, 12:41:05 PM3/30/10
to
Andreas Politz <pol...@fh-trier.de> writes:

> Either `cred' is unbound at this point, or there is an error inside
> the condition-case. So the questions are :
>
> a) What is the value of `cred' ?
> b) What happens (error or not) if you remove the condition-case
> from this function ?
>

In case this was unclear, change it like this :

Ted Zlatanov

unread,
Mar 31, 2010, 9:39:45 AM3/31/10
to
On Mon, 29 Mar 2010 19:02:05 -0700 (PDT) edburns <edb...@gmail.com> wrote:

e> (setq starttls-use-gnutls t)
e> (setq starttls-gnutls-program "gnutls-cli")
e> (setq send-mail-function 'smtpmail-send-it
e> message-send-mail-function 'smtpmail-send-it
e> smtpmail-starttls-credentials
e> '(("stbeehive.oracle.com" 465 nil nil))
e> smtpmail-auth-credentials
e> (expand-file-name "~/.authinfo")
e> smtpmail-default-smtp-server "stbeehive.oracle.com"
e> smtpmail-smtp-server "stbeehive.oracle.com"
e> smtpmail-smtp-service 465
e> smtpmail-debug-info t)
e> (require 'smtpmail)

Can you connect to the server with gnutls-cli from the command line?

If yes, can you use open-network-stream to do the same from within
Emacs?

Ted

edburns

unread,
Apr 1, 2010, 3:46:16 PM4/1/10
to

EB> (defun smtpmail-open-stream (process-buffer host port)
EB> (let ((cred (smtpmail-find-credentials
EB> smtpmail-starttls-credentials host port)))

AP> ===> (if (null (and cred (condition-case ()

AP> Either `cred' is unbound at this point, or there is an error
inside
AP> the condition-case. So the questions are :

AP> a) What is the value of `cred' ?

Value: ("stbeehive.oracle.com" 465 nil nil)

In edebug, after obtaining the value of cred, I continued to press the
space bar until point reached the character in smtp.el shown here

=> (starttls-open-stream "SMTP" process-buffer host port)))))
-----------------------------------------------------------^

At that point, this appeared in the minibuffer

Result: #<network connection "SMTP" (465 . "stbeehive.oracle.com")
state: run>

The next press of the spacebar (edebug-step-mode) moved the cursor to
here:

=> (starttls-open-stream "SMTP" process-buffer host port)))))
------------------------------------------------------------^

and xemacs froze for about 30 seconds and then I see this message in
the
minibuffer.

Process not open for writing: #<network connection "SMTP" (465 .
"stbeehive.oracle.com") state: exit>

The start of the expression that I suppose was responsible for the
freeze is the (let) itself, that is the body of the smtpmail-open-
stream
(defun).

AP> b) What happens (error or not) if you remove the condition-case
AP> from this function ?

Symbol's function definition is void: with-boundp

So I googled around and found a definition of with-boundp at
<http://membled.com/lib/xemacs-21.5-b27/lisp/bytecomp-runtime.el>. I
copied this into smtpmail.el, made sure it was bound and re-ran the
mail
send.

Then it *did* step into the starttls-open-stream method.

Is it possible that the version of smtpmail.el included with version
1.80 of mail-lib (which I got using the package mechanism as the
latest
version) is not supported with my version of xemacs: 21.4.22. By the
way, xemacs 21.4.22 *is* the lastest stable version?

TZ> Can you connect to the server with gnutls-cli from the command
line?

I tried this right away, in fact. I'm not sure what to expect. I
certainly did not get the SMTP banner, which I see when using
Thunderbird NSPR logging to be:

220 default ESMTP Oracle Beehive Gateway; .....

I just see that it hangs.

Should I see the SMTP banner?

edburns

unread,
Apr 1, 2010, 3:46:36 PM4/1/10
to

> Can you connect to the server with gnutls-cli from the command line?
>
> If yes, can you use open-network-stream to do the same from within
> Emacs?
>
> Ted


TZ> Can you connect to the server with gnutls-cli from the command
line?

I tried this right away, in fact. I'm not sure what to expect. I

Andreas Politz

unread,
Apr 2, 2010, 12:42:15 AM4/2/10
to
edburns <edb...@gmail.com> writes:

[...]


> Then it *did* step into the starttls-open-stream method.
>

So it's working, or what ?

-ap

Ted Zlatanov

unread,
Apr 5, 2010, 10:30:07 AM4/5/10
to
On Thu, 1 Apr 2010 12:46:36 -0700 (PDT) edburns <edb...@gmail.com> wrote:

TZ> Can you connect to the server with gnutls-cli from the command line?

e> I tried this right away, in fact. I'm not sure what to expect. I
e> certainly did not get the SMTP banner, which I see when using
e> Thunderbird NSPR logging to be:

e> 220 default ESMTP Oracle Beehive Gateway; .....

e> I just see that it hangs.

e> Should I see the SMTP banner?

If you can't use gnutls-cli from the command line, it probably won't
work from smtpmail.el or anywhere else.

If it hangs, you're probably not connecting. You should see the 220
message at least. So Thunderbird is doing something different. Check
the *exact* protocol it uses and the port.

Ted

0 new messages