From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/trunk r104665: Rewritten smtpmail.el to use `open-network-stream' to do STARTTLS Date: Thu, 23 Jun 2011 09:51:23 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1308790317 2837 80.91.229.12 (23 Jun 2011 00:51:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2011 00:51:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 23 02:51:53 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QZY99-00059R-2D for ged-emacs-devel@m.gmane.org; Thu, 23 Jun 2011 02:51:51 +0200 Original-Received: from localhost ([::1]:38224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZY98-0001jw-9y for ged-emacs-devel@m.gmane.org; Wed, 22 Jun 2011 20:51:50 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZY8s-0001jW-95 for emacs-devel@gnu.org; Wed, 22 Jun 2011 20:51:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZY8r-0008PT-2I for emacs-devel@gnu.org; Wed, 22 Jun 2011 20:51:34 -0400 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:43576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZY8q-0008PJ-Nx for emacs-devel@gnu.org; Wed, 22 Jun 2011 20:51:32 -0400 Original-Received: from localhost ([127.0.0.1]:43996) by orlando.hostforweb.net with smtp (Exim 4.69) (envelope-from ) id 1QZY8o-0003Hh-Ev; Wed, 22 Jun 2011 19:51:30 -0500 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (cygwin) Cancel-Lock: sha1:SHSyOMEe0XL5URDDuvLkZIoVv0A= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: Linux 2.6? (barebone, rare!) X-Received-From: 216.246.45.90 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140896 Archived-At: --=-=-= Lars Magne Ingebrigtsen wrote: [...] > --- a/lisp/mail/smtpmail.el 2011-05-30 17:23:47 +0000 > +++ b/lisp/mail/smtpmail.el 2011-06-21 21:10:52 +0000 [...] > + (setq result > + (open-network-stream > + "smtpmail" process-buffer host port > + :type smtpmail-stream-type > + :return-list t I've been using smtpmail with replacing `open-network-stream' with `my-open-network-stream'. That does login to the remote host by ssh and connects to the smtp port of the host using netcat. For the recent change (adding :return-list t), I've modified my function so as to return (PROCESS :greeting "200 Ok") rather than PROCESS. If there's a similar old program in the world, the following patch will help. But please ignore it if it is not worth installing. :) --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- smtpmail.el~ 2011-06-22 22:06:16.593125000 +0000 +++ smtpmail.el 2011-06-23 00:48:05.562125000 +0000 @@ -652,3 +652,3 @@ ;; If we couldn't access the server at all, we give up. - (unless (setq process (car result)) + (unless (setq process (or (car-safe result) result)) (throw 'done "Unable to contact server")) @@ -658,2 +658,3 @@ + (when (consp result) (let* ((greeting (plist-get (cdr result) :greeting)) @@ -664,2 +665,3 @@ (throw 'done (format "Connection not allowed: %s" greeting)))) + ) @@ -670,3 +672,3 @@ - (let* ((capabilities (plist-get (cdr result) :capabilities)) + (let* ((capabilities (plist-get (cdr-safe result) :capabilities)) (code (smtpmail-response-code capabilities))) --=-=-=--