help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: SMTP library problem


From: Stephen Berman
Subject: Re: SMTP library problem
Date: Fri, 07 Mar 2008 23:03:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Fri, 07 Mar 2008 16:03:21 +0100 David <de_bb@arcor.de> wrote:

> Stephen Berman <Stephen.Berman@gmx.net> writes:
>>> swaks --auth --tls-on-connect -p 465 -s mail.myprovider.com
>>
>> Ah, thanks.  That works.
>
> OK, then it's ssmtp.
>
>>> If the above swaks command works, you can use an external tool like
>>> stunnel to set up the SSL connection. If you have root on the machine,
>>> you can use stunnel like this
>>>
>>> stunnel -f -c -d localhost:2000 -r mail.myprovider.com:465
>>>
>>> You should then be able to send mails through your localhost on port
>>> 2000. Note that the '-f' option lets stunnel run in the foreground for
>>> testing purposes. If it works, you can omit this option and let stunnel
>>> run as daemon.
>>
>> I don't have root access to the machine that hosts the mail server, or
>> do you mean the machine I use to send mail via the server?  
>
> The latter.
>
>> If the latter, how would I make Gnus aware of the tunnel?
>
> Just point smptmail.el to your localhost on port 2000 (or whatever
> you're writing in the above stunnel command).

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 have postfix configured to relay mail from localhost to
another server (mail.gmx.net), which is what I use for most of my
email.  Unfortunately, mail.gmx.net does not accept relayed mail that
has a non-GMX MAIL FROM (in this case myprovider.com) and bounces the
mail.  I don't know whether it is possible, and if so how, to configure
postfix to handle mail intended to go through stunnel without relaying
it to mail.gmx.net.  Is it possible to use stunnel without going through
localhost (but still sending the mail from this computer)?

>> I instrumented smtpmail.el for Edebug and stepped through the code as I
>> tried to send a mail.  The "freeze" occurred in smtpmail-read-response
>> at the call to accept-process-output, which is from the Emacs C code.  I
>> assume this means gnutls is not providing the server what it needs, so
>> it just waits until it hits the timeout, but I don't know how to proceed
>> to find out what is going wrong.
>
> smptmail.el waits for the server greeting, which doesn't happen since
> the server waits for you to initiate the TLS connection first (which you
> can do using stunnel). It shouldn't be too difficult to adapt
> smtpmail.el to deal with this, but AFAIK ssmtp simply isn't standardized
> and every good mail provider should support SMTP+STARTTLS on the
> standard port.

Unfortunately I don't know what adaptations to smtpmail.el would be
needed nor how to implement them.  If you want to try to do it, I would
be grateful (as I am for the help you've already given me).

Steve Berman





reply via email to

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