[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SMTP library problem [RESOLVED]

From: Stephen Berman
Subject: Re: SMTP library problem [RESOLVED]
Date: Wed, 12 Mar 2008 21:22:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Sun, 09 Mar 2008 18:26:31 +0100 Richard G Riley <address@hidden> wrote:

> David <address@hidden> writes:
>> Stephen Berman <address@hidden> writes:
>>> Ok, I set smtpmail-default-smtp-server to "localhost" and
>>> smtpmail-auth-credentials to '(("localhost" 2000 "myusername"
>>> "mypassword")), and indeed it did work -- almost.  Since the mail goes
>>> through localhost, it gets picked up by the postfix server running on my
>>> system.  
>> I guess you could configure postfix to use different smart hosts
>> dependent on the sender address, but I don't know postfix and it's
>> OT here anyway.
> I use msmtp for this.
> ,----
> | (defun msmtp-change-smtp ()
> |   
> |  (setq sendmail-program "/usr/bin/msmtp")
> |  (setq smtpmail-starttls-credentials '(("" 587 nil nil)))

Thanks for posting this.  It turns out I don't need it but it did help
me resolve my problem (I deliberately don't say "solve" for reasons
given below, and because my case is almost certainly different than the

Before trying your Elisp wrapper I tested msmtp with the --serverinfo
and --port=465 flags and, frustratingly, it returned this:

msmtp: cannot get initial OK message from server
msmtp: server message: 454 TLS connection failed: timed out (#4.3.0)

Since your use with Gmail works and it is also documented in the msmtp
man page, I entered `msmtp --serverinfo --tls=on
--port=587 --tls-certcheck=off' just to see what the output looks like,
and after getting the Gmail server information, on a whim I replaced with the FDQN of my mail server, leaving the other flags
as they were -- and to my pleasant surprise, it succeeded and returned
the server information.  In other words, it worked with port 587 but not
with port 465.  Then I went back to my smtpmail.el settings, replaced
465 with 587, and it worked.

I do not understand why, as I reported earlier in this thread, both
KMail and swaks use port 465.  Moreover, when I tried port 587 with
swaks it returned this:

*** TLS startup failed (error:140770FC:SSL 
routines:SSL23_GET_SERVER_HELLO:unknown protocol)

This is similar to what telnet to port 465 responds to EHLO with:

454 TLS connection failed: error:140760FC:SSL 
routines:SSL23_GET_CLIENT_HELLO:unknown protocol (#4.3.0)

In contrast EHLO with telnet to port 587 elicits the server's

In short, KMail and swaks apparently need to access port 465 on this
server, while telnet, msmtp, and smtpmail.el (or Gnutls) need to access
port 587.  If Richard or David or anyone else can account for this
difference, I'd be interested to see it, but in any case, I'm happy I
can finally access this server from within Emacs.  And thanks again for
the helpful feedback.

Steve Berman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]