aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Josefsson2002-10-11 02:27:30 +0000
committerSimon Josefsson2002-10-11 02:27:30 +0000
commit56e5818fd65b2c87e43a3b39fe69116c3c0c6ffb (patch)
treecaf2ef082e8bd5132a6a8cff42274195332e7bed
parentd6abf0184ee38bdf48083a3928ee4f5e5edd0d0c (diff)
downloademacs-56e5818fd65b2c87e43a3b39fe69116c3c0c6ffb.tar.gz
emacs-56e5818fd65b2c87e43a3b39fe69116c3c0c6ffb.zip
* 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.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/mail/sendmail.el11
-rw-r--r--lisp/mail/smtpmail.el3
3 files changed, 22 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 427a41c3d99..7aff48aa8e6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12002-10-11 Simon Josefsson <jas@extundo.com>
2
3 * mail/sendmail.el (mail-envelope-from): New option `header' to
4 use RFC 2822 From: header as the envelope address.
5 (mail-envelope-from): New function, this should be used instead of
6 looking at the `mail-envelope-from' variable.
7 (sendmail-send-it): Use it.
8
9 * mail/smtpmail.el (smtpmail-via-smtp): Use it.
10
12002-10-11 Andre Spiegel <spiegel@gnu.org> 112002-10-11 Andre Spiegel <spiegel@gnu.org>
2 12
3 * dired.el (dired-insert-directory): Fix check for indentation 13 * dired.el (dired-insert-directory): Fix check for indentation
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index aefe64cc656..6be03ee439c 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -82,6 +82,7 @@ If this is nil while `mail-specify-envelope-from' is non-nil, the
82content of `user-mail-address' is used." 82content 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
@@ -774,6 +775,14 @@ the user from the mailer."
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.
781This 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.
@@ -822,7 +831,7 @@ external program defined by `sendmail-program'."
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)
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 82fbfdad5ed..2837c8f1bcb 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -540,6 +540,7 @@ This is relative to `smtpmail-queue-dir'.")
540 (host (or smtpmail-smtp-server 540 (host (or smtpmail-smtp-server
541 (error "`smtpmail-smtp-server' not defined"))) 541 (error "`smtpmail-smtp-server' not defined")))
542 (port smtpmail-smtp-service) 542 (port smtpmail-smtp-service)
543 (envelope-from (mail-envelope-from))
543 response-code 544 response-code
544 greeting 545 greeting
545 process-buffer 546 process-buffer
@@ -689,7 +690,7 @@ This is relative to `smtpmail-queue-dir'.")
689 ""))) 690 "")))
690; (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn))) 691; (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
691 (smtpmail-send-command process (format "MAIL FROM: <%s>%s%s" 692 (smtpmail-send-command process (format "MAIL FROM: <%s>%s%s"
692 (or mail-envelope-from 693 (or envelope-from
693 smtpmail-mail-address) 694 smtpmail-mail-address)
694 size-part 695 size-part
695 body-part)) 696 body-part))