* SMTP library problem
@ 2008-03-04 18:09 James Long
2008-03-05 11:11 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: James Long @ 2008-03-04 18:09 UTC (permalink / raw)
To: help-gnu-emacs
I hope this is the appropriate place to ask this question - I couldn't
find any mailing lists specific to SMTP. I couldn't find where to
subscribe to this mailing list so you may have to include my address
in the reply.
I'm using the standard SMTP library that comes with Emacs (I am using
Carbon Emacs 22.1). The connection requires SSL and password
authentication. Whenever I try to send a message, Emacs simply
freezes up. Here are my connection settings; I have tried both
gnutls-cli and starttls (using the variable which toggles which one to
use, I forget the name of it).
(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-smtp-server "~server~")
(setq smtpmail-smtp-service ~port~)
(setq smtpmail-starttls-credentials '(("~server~" ~port~ "~user~" "~pass~")))
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verb t)
I'm sure my credentials, server, and port are correct, and that the
server is fine. I don't get anything in the SMTP trace buffer. I
suppose I should figure out how to use edebug, which I will attempt
later on.
Could one of my libraries be out of date? gnutls-cli (I have version
2.3.1), or smtpmail.el, or something else?
Thanks,
--
James Long
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
[not found] <mailman.8306.1204670276.18990.help-gnu-emacs@gnu.org>
@ 2008-03-05 6:42 ` Volkan YAZICI
0 siblings, 0 replies; 17+ messages in thread
From: Volkan YAZICI @ 2008-03-05 6:42 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
On 4 Mart, 20:09, "James Long" <longs...@gmail.com> wrote:
> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-smtp-server "~server~")
> (setq smtpmail-smtp-service ~port~)
> (setq smtpmail-starttls-credentials '(("~server~" ~port~ "~user~" "~pass~")))
> (setq smtpmail-debug-info t)
> (setq smtpmail-debug-verb t)
I'm not sure if it's still related with your problem but... AFAIK,
you'll also need to set smtpmail-auth-credentials variable too. (BTW,
assuming you configured starttls-gnutls-program and starttls-extra-
arguments appropriately.)
> I'm sure my credentials, server, and port are correct, and that the
> server is fine. I don't get anything in the SMTP trace buffer. I
> suppose I should figure out how to use edebug, which I will attempt
> later on.
I dunno about edebug (I should check it out too), but you can simply
get a rough idea about the problem via some kind of strace tool. (Or
listen communication going on on related ports via some middleware.)
Regards.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-04 18:09 SMTP library problem James Long
@ 2008-03-05 11:11 ` Stephen Berman
2008-03-05 12:54 ` David
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2008-03-05 11:11 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: longster
On Tue, 4 Mar 2008 13:09:36 -0500 "James Long" <longster@gmail.com> wrote:
> I couldn't find where to
> subscribe to this mailing list so you may have to include my address
> in the reply.
You can also read and write to this list via Gmane, either as a
newsgroup or with a web browser; go to gmane.org for details.
> I'm using the standard SMTP library that comes with Emacs (I am using
> Carbon Emacs 22.1). The connection requires SSL and password
> authentication. Whenever I try to send a message, Emacs simply
> freezes up. Here are my connection settings; I have tried both
> gnutls-cli and starttls (using the variable which toggles which one to
> use, I forget the name of it).
>
> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-smtp-server "~server~")
> (setq smtpmail-smtp-service ~port~)
> (setq smtpmail-starttls-credentials '(("~server~" ~port~ "~user~" "~pass~")))
> (setq smtpmail-debug-info t)
> (setq smtpmail-debug-verb t)
>
> I'm sure my credentials, server, and port are correct, and that the
> server is fine. I don't get anything in the SMTP trace buffer. I
> suppose I should figure out how to use edebug, which I will attempt
> later on.
>
> Could one of my libraries be out of date? gnutls-cli (I have version
> 2.3.1), or smtpmail.el, or something else?
I have a similar or perhaps the same problem. I use the same type of
settings as you do. How long did you wait after Emacs "froze up". In
my case, it "unfreezes" after 20 minutes and the SMTP trace buffer shows
this:
Process SMTP finished
454 TLS connection failed: timed out (#4.3.0)
- Peer has closed the GNUTLS connection
QUIT
This is reproducible. I can access the same SMTP server using KMail, so
I assume, like you, that my problem is somewhere in smtpmail.el or
gnutls-cli (I don't have starttls), perhaps a wrong setting. It would
be nice if someone can solve this one; I haven't been able to.
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-05 11:11 ` Stephen Berman
@ 2008-03-05 12:54 ` David
2008-03-05 19:41 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: David @ 2008-03-05 12:54 UTC (permalink / raw)
To: help-gnu-emacs
Stephen Berman <Stephen.Berman@gmx.net> writes:
> I have a similar or perhaps the same problem. I use the same type of
> settings as you do. How long did you wait after Emacs "froze up". In
> my case, it "unfreezes" after 20 minutes and the SMTP trace buffer shows
> this:
>
> Process SMTP finished
> 454 TLS connection failed: timed out (#4.3.0)
> - Peer has closed the GNUTLS connection
> QUIT
Could it be that the SMTP server does ssmtp (usually on port 465)
instead of SMTP+STARTTLS? Do you see a greeting message from the server
when you connect to it with telnet?
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-05 12:54 ` David
@ 2008-03-05 19:41 ` Stephen Berman
2008-03-05 23:03 ` David
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2008-03-05 19:41 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, 05 Mar 2008 13:54:44 +0100 David <de_bb@arcor.de> wrote:
> Stephen Berman <Stephen.Berman@gmx.net> writes:
>> I have a similar or perhaps the same problem. I use the same type of
>> settings as you do. How long did you wait after Emacs "froze up". In
>> my case, it "unfreezes" after 20 minutes and the SMTP trace buffer shows
>> this:
>>
>> Process SMTP finished
>> 454 TLS connection failed: timed out (#4.3.0)
>> - Peer has closed the GNUTLS connection
>> QUIT
>
> Could it be that the SMTP server does ssmtp (usually on port 465)
> instead of SMTP+STARTTLS?
The does indeed use port 465 (and I set smtpmail-smtp-service to 465).
Are you saying that smtpmail.el does not support ssmtp?
> Do you see a greeting message from the server
> when you connect to it with telnet?
No:
$ telnet mail.myprovider.com
Trying 123.456.78.9...
telnet: connect to address 123.456.78.9: Connection timed out
I know nothing about ssmtp. Assuming the server does use it, is there a
way to access it from Gnus?
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-05 19:41 ` Stephen Berman
@ 2008-03-05 23:03 ` David
2008-03-06 0:13 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: David @ 2008-03-05 23:03 UTC (permalink / raw)
To: help-gnu-emacs
Stephen Berman <Stephen.Berman@gmx.net> writes:
>> Could it be that the SMTP server does ssmtp (usually on port 465)
>> instead of SMTP+STARTTLS?
>
> The does indeed use port 465 (and I set smtpmail-smtp-service to 465).
> Are you saying that smtpmail.el does not support ssmtp?
I don't know, but I don't see any option to activate it.
>> Do you see a greeting message from the server
>> when you connect to it with telnet?
>
> No:
>
> $ telnet mail.myprovider.com
> Trying 123.456.78.9...
> telnet: connect to address 123.456.78.9: Connection timed out
I should have mentioned that you have to try the port you want to
connect to, i.e.
telnet mail.myprovider.com 465
> I know nothing about ssmtp. Assuming the server does use it, is there a
> way to access it from Gnus?
ssmtp simply means that the TLS connection is established immediately,
whereas SMTP+STARTTLS first does the EHLO-stuff in clear text and the
TLS connection is only established if the server advertises it to the
client. AFAIK, ssmtp is more or less deprecated and servers support it
only because of MS Outlook. Nowadays, TLS connections are usually done on
the standard port 25, so this is the first you should try. You can test
this by using a tool like 'swaks' or simply with telnet:
telnet mail.myprovider.com 25
and after the greeting you type something like
EHLO my.address.com
and if the server answers
250-STARTTLS
it should work with smtpmail.el.
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-05 23:03 ` David
@ 2008-03-06 0:13 ` Stephen Berman
2008-03-06 11:17 ` David
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2008-03-06 0:13 UTC (permalink / raw)
To: help-gnu-emacs
On Thu, 06 Mar 2008 00:03:45 +0100 David <de_bb@arcor.de> wrote:
> Stephen Berman <Stephen.Berman@gmx.net> writes:
>>> Could it be that the SMTP server does ssmtp (usually on port 465)
>>> instead of SMTP+STARTTLS?
>>
>> The does indeed use port 465 (and I set smtpmail-smtp-service to 465).
>> Are you saying that smtpmail.el does not support ssmtp?
>
> I don't know, but I don't see any option to activate it.
>
>>> Do you see a greeting message from the server
>>> when you connect to it with telnet?
>>
>> No:
>>
>> $ telnet mail.myprovider.com
>> Trying 123.456.78.9...
>> telnet: connect to address 123.456.78.9: Connection timed out
>
> I should have mentioned that you have to try the port you want to
> connect to, i.e.
>
> telnet mail.myprovider.com 465
With this I get the same results as with smtpmail.el:
$ telnet mail.myprovider.com 465
Trying 123.456.78.9...
Connected to mail.myprovider.com.
Escape character is '^]'.
454 TLS connection failed: timed out (#4.3.0)
Connection closed by foreign host.
>> I know nothing about ssmtp. Assuming the server does use it, is there a
>> way to access it from Gnus?
>
> ssmtp simply means that the TLS connection is established immediately,
> whereas SMTP+STARTTLS first does the EHLO-stuff in clear text and the
> TLS connection is only established if the server advertises it to the
> client. AFAIK, ssmtp is more or less deprecated and servers support it
> only because of MS Outlook. Nowadays, TLS connections are usually done on
> the standard port 25, so this is the first you should try. You can test
> this by using a tool like 'swaks' or simply with telnet:
>
> telnet mail.myprovider.com 25
>
> and after the greeting you type something like
>
> EHLO my.address.com
>
> and if the server answers
>
> 250-STARTTLS
>
> it should work with smtpmail.el.
Telnetting to port 25 just times out as above with no port. I also
tried swaks:
$ swaks -s mail.myprovider.com
To: stephen.berman@gmx.net
=== Trying mail.myprovider.com:25...
*** Error connecting 0.0.0.0 to mail.myprovider.com:25:
*** IO::Socket::INET: connect: timeout
$ swaks -s mail.myprovider.com -p 465
To: stephen.berman@gmx.net
=== Trying mail.myprovider.com:465...
=== Connected to mail.myprovider.com.
<** Timeout (30 secs) waiting for server response
-> QUIT
<** Timeout (30 secs) waiting for server response
=== Connection closed with remote host.
Again, I can send and receive mail via this server using KMail, which I
set up simply by providing the server's FQDN and my user name (KMail
figured out the port and authorization method and prompts for my
password). So I expected (and still hope) there's some way to access it
with Gnus.
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-06 0:13 ` Stephen Berman
@ 2008-03-06 11:17 ` David
2008-03-07 14:26 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: David @ 2008-03-06 11:17 UTC (permalink / raw)
To: help-gnu-emacs
Stephen Berman <Stephen.Berman@gmx.net> writes:
> Telnetting to port 25 just times out as above with no port. I also
> tried swaks:
>
> $ swaks -s mail.myprovider.com
If it is indeed ssmtp you would have to call swaks with
swaks --auth --tls-on-connect -p 465 -s mail.myprovider.com
> Again, I can send and receive mail via this server using KMail, which I
> set up simply by providing the server's FQDN and my user name (KMail
> figured out the port and authorization method and prompts for my
> password). So I expected (and still hope) there's some way to access it
> with Gnus.
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.
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-06 11:17 ` David
@ 2008-03-07 14:26 ` Stephen Berman
2008-03-07 15:03 ` David
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2008-03-07 14:26 UTC (permalink / raw)
To: help-gnu-emacs
On Thu, 06 Mar 2008 12:17:23 +0100 David <de_bb@arcor.de> wrote:
> Stephen Berman <Stephen.Berman@gmx.net> writes:
>> Telnetting to port 25 just times out as above with no port. I also
>> tried swaks:
>>
>> $ swaks -s mail.myprovider.com
>
> If it is indeed ssmtp you would have to call swaks with
>
> swaks --auth --tls-on-connect -p 465 -s mail.myprovider.com
Ah, thanks. That works.
>> Again, I can send and receive mail via this server using KMail, which I
>> set up simply by providing the server's FQDN and my user name (KMail
>> figured out the port and authorization method and prompts for my
>> password). So I expected (and still hope) there's some way to access it
>> with Gnus.
>
> 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? If the
latter, how would I make Gnus aware of the tunnel?
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.
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-07 14:26 ` Stephen Berman
@ 2008-03-07 15:03 ` David
2008-03-07 22:03 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: David @ 2008-03-07 15:03 UTC (permalink / raw)
To: help-gnu-emacs
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).
> 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.
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-07 15:03 ` David
@ 2008-03-07 22:03 ` Stephen Berman
2008-03-08 14:47 ` David
[not found] ` <mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 17+ messages in thread
From: Stephen Berman @ 2008-03-07 22:03 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-07 22:03 ` Stephen Berman
@ 2008-03-08 14:47 ` David
2008-03-08 23:29 ` Stephen Berman
[not found] ` <mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 17+ messages in thread
From: David @ 2008-03-08 14:47 UTC (permalink / raw)
To: help-gnu-emacs
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.
You local postfix listens on another port (25), so it should not pick up
the mail. You must have done something wrong in your smtpmail.el
configuration. Here's how it should work:
(setq smtpmail-default-smtp-server "localhost")
(setq smtpmail-smtp-service 2000)
(require 'smtpmail)
(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-debug-info t)
(setq smtpmail-auth-credentials
'(("localhost" 2000 "name" "pass")))
Note that smtp-server and smtp-service are set before the 'require'
(though I'm not sure if this is still necessary).
> 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.
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.
> 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).
Sorry, I'm afraid I won't have the time to do it. Additionally, I
consider ssmtp to be broken and mail servers usually only support it
because of MS Outlook anyway, so I see no reason to support
this. SMTP+STARTTLS is the right thing to do.
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-08 14:47 ` David
@ 2008-03-08 23:29 ` Stephen Berman
2008-03-09 12:15 ` David
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2008-03-08 23:29 UTC (permalink / raw)
To: help-gnu-emacs
On Sat, 08 Mar 2008 15:47:54 +0100 David <de_bb@arcor.de> wrote:
> 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.
>
> You local postfix listens on another port (25), so it should not pick up
> the mail. You must have done something wrong in your smtpmail.el
> configuration. Here's how it should work:
>
> (setq smtpmail-default-smtp-server "localhost")
> (setq smtpmail-smtp-service 2000)
> (require 'smtpmail)
> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-debug-info t)
> (setq smtpmail-auth-credentials
> '(("localhost" 2000 "name" "pass")))
When I tried it I had failed to set smtpmail-smtp-service to 2000
(though I did have that port set in smtpmail-auth-credentials), and its
default value is 25, so that explains why postfix intervened.
Unfortunately, when I set it to 2000 as above, it was rejected:
open-network-stream: make client process failed: connection refused,
:name, SMTP, :buffer, *trace of SMTP session to localhost*, :host,
localhost, :service, 2000
I temporarily disabled my firewall in case it was blocking access to
this port, but that didn't help. Same with other high ports I tried.
So I'm still stuck. :( Do you know what the problem could be now?
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-08 23:29 ` Stephen Berman
@ 2008-03-09 12:15 ` David
2008-03-09 15:35 ` Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: David @ 2008-03-09 12:15 UTC (permalink / raw)
To: help-gnu-emacs
Stephen Berman <Stephen.Berman@gmx.net> writes:
> open-network-stream: make client process failed: connection refused,
> :name, SMTP, :buffer, *trace of SMTP session to localhost*, :host,
> localhost, :service, 2000
>
> I temporarily disabled my firewall in case it was blocking access to
> this port, but that didn't help. Same with other high ports I tried.
> So I'm still stuck. :( Do you know what the problem could be now?
Try a privileged port (<1024). You can easily test the stunnel setup by
using 'telnet localhost PORT'; you should then see the mail server
greeting. Otherwise I wouldn't know what the problem is.
-David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
2008-03-09 12:15 ` David
@ 2008-03-09 15:35 ` Stephen Berman
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Berman @ 2008-03-09 15:35 UTC (permalink / raw)
To: help-gnu-emacs
On Sun, 09 Mar 2008 13:15:02 +0100 David <de_bb@arcor.de> wrote:
> Stephen Berman <Stephen.Berman@gmx.net> writes:
>> open-network-stream: make client process failed: connection refused,
>> :name, SMTP, :buffer, *trace of SMTP session to localhost*, :host,
>> localhost, :service, 2000
>>
>> I temporarily disabled my firewall in case it was blocking access to
>> this port, but that didn't help. Same with other high ports I tried.
>> So I'm still stuck. :( Do you know what the problem could be now?
>
> Try a privileged port (<1024). You can easily test the stunnel setup by
> using 'telnet localhost PORT'; you should then see the mail server
> greeting. Otherwise I wouldn't know what the problem is.
With 'telnet localhost PORT' I only get a connection if PORT is one that
some service is listening on (those with state LISTEN in the output of
`netstat -t -a -p --numeric-ports'), and stunnel is not among those.
Every other value of PORT returns this:
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
Whatever the problem is, it evidently does not have to do with
smtpmail.el, so is at least at this point OT here. If you have any
other ideas or suggestions, I'd be grateful for an email; otherwise I'll
try to pursue this on a more relevant forum. Thanks again for your
help.
Steve Berman
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem
[not found] ` <mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org>
@ 2008-03-09 17:26 ` Richard G Riley
2008-03-12 20:22 ` SMTP library problem [RESOLVED] Stephen Berman
0 siblings, 1 reply; 17+ messages in thread
From: Richard G Riley @ 2008-03-09 17:26 UTC (permalink / raw)
To: help-gnu-emacs
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.
>
> You local postfix listens on another port (25), so it should not pick up
> the mail. You must have done something wrong in your smtpmail.el
> configuration. Here's how it should work:
>
> (setq smtpmail-default-smtp-server "localhost")
> (setq smtpmail-smtp-service 2000)
> (require 'smtpmail)
> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-debug-info t)
> (setq smtpmail-auth-credentials
> '(("localhost" 2000 "name" "pass")))
>
> Note that smtp-server and smtp-service are set before the 'require'
> (though I'm not sure if this is still necessary).
>
>> 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.
>
> 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)))
| (setq smtpmail-smtp-server "smtp.gmail.com")
| (setq message-sendmail-envelope-from 'header)
|
| (if (message-mail-p)
| (save-excursion
| (let* ((from
| (save-restriction
| (message-narrow-to-headers)
| (message-fetch-field "from")))
| (account
| (cond
| ((string-match ".*rileyrgdev.*" from)"rileyrgdev")
*snip*
| ))
| )
| (setq message-sendmail-extra-arguments (list "-a" account))
| )))
| )
|
|
|
| (add-hook 'message-send-hook 'msmtp-change-smtp)
`----
and then, ~/.msmtp
,----
| defaults
| host smtp.gmail.com
| port 587
| auth on
| tls on
| tls_certcheck off
| logfile /tmp/msmtp.log
|
|
| account rileyrgdev
| user rileyrgdev@gmail.com
| password ******
| host myparticular.smtp.host
| from rileyrgdev@gmail.com
|
| ** SNIP**
|
| account default : rileyrgdev
`----
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: SMTP library problem [RESOLVED]
2008-03-09 17:26 ` Richard G Riley
@ 2008-03-12 20:22 ` Stephen Berman
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Berman @ 2008-03-12 20:22 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2008-03-12 20:22 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` SMTP library problem [RESOLVED] Stephen Berman
[not found] <mailman.8306.1204670276.18990.help-gnu-emacs@gnu.org>
2008-03-05 6:42 ` SMTP library problem Volkan YAZICI
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.