From 9b7382d618a088e71c0a4b4cc2eebb5a17e3bf6f Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Fri, 26 Apr 2013 10:22:07 +0000 Subject: [PATCH] lisp/gnus/mail-source.el (mail-source-fetch-pop, mail-source-check-pop): Don't set the MAILHOST environment variable permanently (Bug#14271) --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/mail-source.el | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 1384df85ca3..e10dd1e94c7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Katsumi Yamaoka + + * mail-source.el (mail-source-fetch-pop, mail-source-check-pop): + Don't set the MAILHOST environment variable permanently (Bug#14271). + 2013-04-26 Glenn Morris * message.el (message-bury): Revert 2013-03-18 change. (Bug#14117) diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 9cc2e6ac09c..ff432fc39d8 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -809,6 +809,8 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) prescript-delay) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) + (process-environment (append (list (concat "MAILHOST=" server)) + process-environment)) result) (when (eq authentication 'password) (setq password @@ -816,8 +818,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) (cdr (assoc from mail-source-password-cache)) (read-passwd (format "Password for %s at %s: " user server))))) - (when server - (setenv "MAILHOST" server)) (setq result (cond (program @@ -877,6 +877,8 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) (mail-source-bind (pop source) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) + (process-environment (append (list (concat "MAILHOST=" server)) + process-environment)) result) (when (eq authentication 'password) (setq password @@ -886,8 +888,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) (format "Password for %s at %s: " user server)))) (unless (assoc from mail-source-password-cache) (push (cons from password) mail-source-password-cache))) - (when server - (setenv "MAILHOST" server)) (setq result (cond ;; No easy way to check whether mail is waiting for these. -- 2.39.2