From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#14271: 24.3; MAILHOST set in mail-source.el when using pop3.el Date: Fri, 26 Apr 2013 11:37:36 +0900 Organization: Emacsen advocacy group Message-ID: References: <8761za9may.fsf@cletus.six.dalnet.ca> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1366943889 15534 80.91.229.3 (26 Apr 2013 02:38:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 02:38:09 +0000 (UTC) Cc: 14271@debbugs.gnu.org To: Monte Stevens Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 26 04:38:13 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UVYY7-0005d4-DJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2013 04:38:11 +0200 Original-Received: from localhost ([::1]:37142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVYY6-0006cs-W7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Apr 2013 22:38:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVYY4-0006cN-0r for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2013 22:38:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVYY2-0004Bi-O8 for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2013 22:38:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVYY2-0004Ba-KL for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2013 22:38:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UVYXz-0004Ol-Fq; Thu, 25 Apr 2013 22:38:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <8761za9may.fsf@cletus.six.dalnet.ca> Resent-From: Katsumi Yamaoka Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 26 Apr 2013 02:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14271 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 14271-submit@debbugs.gnu.org id=B14271.136694386216838 (code B ref 14271); Fri, 26 Apr 2013 02:38:03 +0000 Original-Received: (at 14271) by debbugs.gnu.org; 26 Apr 2013 02:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:43953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVYXe-0004NX-5n for submit@debbugs.gnu.org; Thu, 25 Apr 2013 22:37:42 -0400 Original-Received: from mail-hampton.hostforweb.net ([216.246.13.138]:53875 helo=hampton.hostforweb.net) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVYXZ-0004NO-Sh for 14271@debbugs.gnu.org; Thu, 25 Apr 2013 22:37:38 -0400 Original-Received: from localhost.localdomain ([127.0.0.1]:46959 helo=localhost) by hampton.hostforweb.net with smtp (Exim 4.80) (envelope-from ) id 1UVYXZ-003hJP-J0; Thu, 25 Apr 2013 21:37:37 -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.130006 (=?UTF-8?Q?=E7=9C=9F?= Gnus v0.6) Emacs/24.3.50 (i686-pc-cygwin) Cancel-Lock: sha1:5/v6BKjC6gnH6CxLemZ4YyRL2qo= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: acl_c_authenticated_local_user: root X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73698 Archived-At: --=-=-= Monte Stevens wrote: > My MAILHOST environment variable is empty. > I start emacs with `emacsclient -ta "" foo'. > `M-x getenv MAILHOST' = '' > I start Gnus with `M-x gnus'; Gnus fetches mail from two pop servers as > defined in my .gnus.el file. > `M-x getenv MAILHOST' = 'pop.eastlink.ca' [...] > The reason that this is a problem for me is that future mail from my > local user appear as `From: monte@pop.eastlink.ca' . Maybe setting MAILHOST is necessary for a user who uses a movemail program that is not that of pop3.el. But it should be needed only when running that program. So, I'd like to modify the pop3.el code so that it binds MAILHOST temporarily. A patch for Emacs 24.3 is below. Could others review it? (I'm going to commit it only to the trunk.) --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- mail-source.el~ 2013-01-01 20:37:17.000000000 +0000 +++ mail-source.el 2013-04-26 02:34:39.395042300 +0000 @@ -799,3 +799,3 @@ (mail-source-string (format "pop:%s@%s" user server)) - result) + omailhost result) (when (eq authentication 'password) @@ -807,3 +807,6 @@ (when server + (setq omailhost (getenv "MAILHOST")) (setenv "MAILHOST" server)) +(unwind-protect + (progn (setq result @@ -859,3 +862,6 @@ mail-source-password-cache)) - 0)))) + 0)) + (when server + (setenv "MAILHOST" omailhost)))))) + @@ -866,3 +872,3 @@ (mail-source-string (format "pop:%s@%s" user server)) - result) + omailhost result) (when (eq authentication 'password) @@ -876,3 +882,6 @@ (when server + (setq omailhost (getenv "MAILHOST")) (setenv "MAILHOST" server)) +(unwind-protect + (progn (setq result @@ -910,3 +919,5 @@ mail-source-password-cache))) - result))) + result) + (when server + (setenv "MAILHOST" omailhost)))))) --=-=-=--