diff options
author | Peder O. Klingenberg <peder@klingenberg.no> | 2014-11-15 16:22:29 +0100 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2014-11-15 16:22:29 +0100 |
commit | 20478c2bd3eab268136b47d14cdee2442efb6ba9 (patch) | |
tree | 624f4de24aa83c282b4db79ea47d27cd2e88f881 /lisp/mail | |
parent | b8c9a4e36dc3525fa03e0e0d862693dc26137b5f (diff) | |
download | emacs-20478c2bd3eab268136b47d14cdee2442efb6ba9.tar.gz |
(report-emacs-bug): Make a better guess at envelope-from
Fixes: debbugs:19054
* mail/emacsbug.el (report-emacs-bug): Make a better guess at
envelope-from when reporting through sendmail.
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/emacsbug.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 329a3209cee..4cfd3e2051e 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -142,6 +142,12 @@ This requires either the OS X \"open\" command, or the freedesktop (concat "mailto:" to))) (error "Subject, To or body not found"))))) +;; It's the default mail mode, so it seems OK to use its features. +(autoload 'message-bogus-recipient-p "message") +(autoload 'message-make-address "message") +(defvar message-send-mail-function) +(defvar message-sendmail-envelope-from) + ;;;###autoload (defun report-emacs-bug (topic &optional unused) "Report a bug in GNU Emacs. @@ -169,7 +175,12 @@ Prompts for bug subject. Leaves you in a mail buffer." ;; that report-emacs-bug-orig-text remains valid. (Bug#5178) (message-sort-headers) ;; Stop message-mode stealing the properties we will add. - (set (make-local-variable 'message-strip-special-text-properties) nil)) + (set (make-local-variable 'message-strip-special-text-properties) nil) + ;; Make sure we default to the From: address as envelope when sending + ;; through sendmail. + (when (and (not message-sendmail-envelope-from) + (message-bogus-recipient-p (message-make-address))) + (set (make-local-variable 'message-sendmail-envelope-from) 'header))) (rfc822-goto-eoh) (forward-line 1) ;; Move the mail signature to the proper place. @@ -349,10 +360,6 @@ usually do not have translators for other languages.\n\n"))) (define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3") -;; It's the default mail mode, so it seems OK to use its features. -(autoload 'message-bogus-recipient-p "message") -(defvar message-send-mail-function) - (defun report-emacs-bug-hook () "Do some checking before sending a bug report." (save-excursion |