emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] [emacs] 01/01: (report-emacs-bug): Make a better guess at


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] [emacs] 01/01: (report-emacs-bug): Make a better guess at envelope-from
Date: Sat, 15 Nov 2014 15:22:50 +0000

larsi pushed a commit to branch emacs-24
in repository emacs.

commit 20478c2bd3eab268136b47d14cdee2442efb6ba9
Author: Peder O. Klingenberg <address@hidden>
Date:   Sat Nov 15 16:22:29 2014 +0100

    (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.
---
 lisp/ChangeLog        |    5 +++++
 lisp/mail/emacsbug.el |   17 ++++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a6ab3b8..107b995 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-28  Peder O. Klingenberg  <address@hidden>
+
+       * mail/emacsbug.el (report-emacs-bug): Make a better guess at
+         envelope-from when reporting through sendmail (bug#19054).
+
 2014-11-14  Ivan Andrus  <address@hidden>
 
        * progmodes/python.el (python-ffap-module-path): Use
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 329a320..4cfd3e2 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]