comparison lisp/mail/sendmail.el @ 47837:b9705a05fa60

* mail/sendmail.el (mail-envelope-from): New option `header' to use RFC 2822 From: header as the envelope address. (mail-envelope-from): New function, this should be used instead of looking at the `mail-envelope-from' variable. (sendmail-send-it): Use it. * mail/smtpmail.el (smtpmail-via-smtp): Use it.
author Simon Josefsson <jas@extundo.com>
date Fri, 11 Oct 2002 02:27:09 +0000
parents d5e1e2adcb67
children d347ebc48f79
comparison
equal deleted inserted replaced
47836:14b87846802e 47837:b9705a05fa60
80 "*If non-nil, designate the envelope-from address when sending mail. 80 "*If non-nil, designate the envelope-from address when sending mail.
81 If this is nil while `mail-specify-envelope-from' is non-nil, the 81 If this is nil while `mail-specify-envelope-from' is non-nil, the
82 content of `user-mail-address' is used." 82 content of `user-mail-address' is used."
83 :version "21.1" 83 :version "21.1"
84 :type '(choice (string :tag "From-name") 84 :type '(choice (string :tag "From-name")
85 (const :tag "Use From: header from message" header)
85 (const :tag "Use `user-mail-address'" nil)) 86 (const :tag "Use `user-mail-address'" nil))
86 :group 'sendmail) 87 :group 'sendmail)
87 88
88 ;;;###autoload 89 ;;;###autoload
89 (defcustom mail-self-blind nil "\ 90 (defcustom mail-self-blind nil "\
772 ;; If buffer has no file, mark it as unmodified and delete auto-save. 773 ;; If buffer has no file, mark it as unmodified and delete auto-save.
773 (if (not buffer-file-name) 774 (if (not buffer-file-name)
774 (progn 775 (progn
775 (set-buffer-modified-p nil) 776 (set-buffer-modified-p nil)
776 (delete-auto-save-file-if-necessary t)))))) 777 (delete-auto-save-file-if-necessary t))))))
778
779 (defun mail-envelope-from ()
780 "Return the envelope mail address to use when sending mail.
781 This function uses `mail-envelope-from'."
782 (if (eq mail-envelope-from 'header)
783 (nth 1 (mail-extract-address-components
784 (mail-fetch-field "From")))
785 mail-envelope-from))
777 786
778 ;; This does the real work of sending a message via sendmail. 787 ;; This does the real work of sending a message via sendmail.
779 ;; It is called via the variable send-mail-function. 788 ;; It is called via the variable send-mail-function.
780 789
781 ;;;###autoload 790 ;;;###autoload
820 "/usr/lib/sendmail")) 829 "/usr/lib/sendmail"))
821 ;; Examine these variables now, so that 830 ;; Examine these variables now, so that
822 ;; local binding in the mail buffer will take effect. 831 ;; local binding in the mail buffer will take effect.
823 (envelope-from 832 (envelope-from
824 (and mail-specify-envelope-from 833 (and mail-specify-envelope-from
825 (or mail-envelope-from user-mail-address)))) 834 (or (mail-envelope-from) user-mail-address))))
826 (unwind-protect 835 (unwind-protect
827 (save-excursion 836 (save-excursion
828 (set-buffer tembuf) 837 (set-buffer tembuf)
829 (erase-buffer) 838 (erase-buffer)
830 (unless multibyte 839 (unless multibyte