summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-07-06 10:30:49 +0000
committerGerd Moellmann <gerd@gnu.org>2001-07-06 10:30:49 +0000
commitcf42076d6596dba0243e68becdc2852e3eb2775a (patch)
tree6193d3d517659e1e01272b8c2c8cc7bf3714e4d0
parented31909a78e9e5562d1ed912c2665ccc60f55c1e (diff)
downloademacs-cf42076d6596dba0243e68becdc2852e3eb2775a.tar.gz
(mail-specify-envelope-from): Doc fix.
(mail-envelope-from): New user option. (sendmail-send-it): Use it.
-rw-r--r--lisp/mail/sendmail.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f354ddb59c5..1ff0453e62e 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -67,7 +67,8 @@ controlled by a separate variable, `mail-specify-envelope-from'."
;;;###autoload
(defcustom mail-specify-envelope-from nil
"*If non-nil, specify the envelope-from address when sending mail.
-The value used to specify it is whatever is found in `user-mail-address'.
+The value used to specify it is whatever is found in
+`mail-envelope-from', with `user-mail-address' as fallback.
On most systems, specifying the envelope-from address
is a privileged operation."
@@ -75,6 +76,14 @@ is a privileged operation."
:type 'boolean
:group 'sendmail)
+(defcustom mail-envelope-from nil
+ "*If non-nil, designate the envelope-from address when sending mail.
+If this is nil while `mail-specify-envelope-from' is non-nil, the
+content of `user-mail-address' is used."
+ :version "21.1"
+ :type 'boolean
+ :group 'sendmail)
+
;;;###autoload
(defcustom mail-self-blind nil "\
*Non-nil means insert BCC to self in messages to be sent.
@@ -801,8 +810,7 @@ external program defined by `sendmail-program'."
(mailbuf (current-buffer))
(program (if (boundp 'sendmail-program)
sendmail-program
- "/usr/lib/sendmail"))
- (originator user-mail-address))
+ "/usr/lib/sendmail")))
(unwind-protect
(save-excursion
(set-buffer tembuf)
@@ -968,8 +976,9 @@ external program defined by `sendmail-program'."
(append (list (point-min) (point-max)
program
nil errbuf nil "-oi")
- (and mail-specify-envelope-from
- (list "-f" originator))
+ (and mail-specify-envelope-from
+ (list "-f" (or mail-envelope-from
+ user-mail-address)))
;;; ;; Don't say "from root" if running under su.
;;; (and (equal (user-real-login-name) "root")
;;; (list "-f" (user-login-name)))