all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <Stephen.Berman@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: SMTP library problem [RESOLVED]
Date: Wed, 12 Mar 2008 21:22:21 +0100	[thread overview]
Message-ID: <87skyvn14y.fsf_-_@escher.local.home> (raw)
In-Reply-To: fr16kb$lp7$1@registered.motzarella.org

On Sun, 09 Mar 2008 18:26:31 +0100 Richard G Riley <rileyrgdev@gmail.com> wrote:

> David <de_bb@arcor.de> writes:
>
>> Stephen Berman <Stephen.Berman@gmx.net> 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 '(("smtp.gmail.com" 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
OP's).

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 --host=smtp.gmail.com --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
smtp.gmail.com 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
properties.

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	other threads:[~2008-03-12 20:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 18:09 SMTP library problem James Long
2008-03-05 11:11 ` Stephen Berman
2008-03-05 12:54   ` David
2008-03-05 19:41     ` Stephen Berman
2008-03-05 23:03       ` David
2008-03-06  0:13         ` Stephen Berman
2008-03-06 11:17           ` David
2008-03-07 14:26             ` Stephen Berman
2008-03-07 15:03               ` David
2008-03-07 22:03                 ` Stephen Berman
2008-03-08 14:47                   ` David
2008-03-08 23:29                     ` Stephen Berman
2008-03-09 12:15                       ` David
2008-03-09 15:35                         ` Stephen Berman
     [not found]                   ` <mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org>
2008-03-09 17:26                     ` Richard G Riley
2008-03-12 20:22                       ` Stephen Berman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87skyvn14y.fsf_-_@escher.local.home \
    --to=stephen.berman@gmx.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.