From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: SMTP library problem Date: Fri, 07 Mar 2008 23:03:50 +0100 Message-ID: <87skz2gpix.fsf@escher.local.home> References: <954cc8bb0803041009pda5f74aq23323b1e9dc4e85b@mail.gmail.com> <87zltdwhl7.fsf@escher.local.home> <87tzjlvtzs.fsf@escher.local.home> <87r6eo1zht.fsf@escher.local.home> <87r6emtxts.fsf@escher.local.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204927538 2281 80.91.229.12 (7 Mar 2008 22:05:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Mar 2008 22:05:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 07 23:06:04 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JXkgh-0003Yv-BZ for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Mar 2008 23:05:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXkg9-000334-Kz for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Mar 2008 17:04:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXkfj-0002tO-F8 for help-gnu-emacs@gnu.org; Fri, 07 Mar 2008 17:04:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXkfh-0002rF-V8 for help-gnu-emacs@gnu.org; Fri, 07 Mar 2008 17:04:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXkfh-0002qy-Ia for help-gnu-emacs@gnu.org; Fri, 07 Mar 2008 17:04:09 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JXkfg-0002oM-U0 for help-gnu-emacs@gnu.org; Fri, 07 Mar 2008 17:04:09 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JXkfZ-0004mq-DQ for help-gnu-emacs@gnu.org; Fri, 07 Mar 2008 22:04:01 +0000 Original-Received: from i5387d9e3.versanet.de ([83.135.217.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Mar 2008 22:04:01 +0000 Original-Received: from Stephen.Berman by i5387d9e3.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Mar 2008 22:04:01 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i5387d9e3.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52145 Archived-At: On Fri, 07 Mar 2008 16:03:21 +0100 David wrote: > Stephen Berman 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