summaryrefslogtreecommitdiff
path: root/lisp/mail/smtpmail.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2003-08-26 17:42:27 +0000
committerGlenn Morris <rgm@gnu.org>2003-08-26 17:42:27 +0000
commitff98122692e5f21e3dd91d2513c7b1897b6e7ac9 (patch)
tree3dade5151de872801e1ee1c9b5f9ef08c7b7a75b /lisp/mail/smtpmail.el
parentac3ba2bf75732c1c5b560b18d8fe8b385b052103 (diff)
downloademacs-ff98122692e5f21e3dd91d2513c7b1897b6e7ac9.tar.gz
Fix previous change:
(smtpmail-send-queued-mail): Set smtpmail-mail-address before calling smtpmail-via-smtp. (smtpmail-via-smtp): Add fall-back values for envelope-from.
Diffstat (limited to 'lisp/mail/smtpmail.el')
-rw-r--r--lisp/mail/smtpmail.el23
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index a9382aa69b4..5306e3e9408 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -223,6 +223,8 @@ This is relative to `smtpmail-queue-dir'.")
(case-fold-search nil)
delimline
(mailbuf (current-buffer))
+ ;; Examine this variable now, so that
+ ;; local binding in the mail buffer will take effect.
(smtpmail-mail-address
(or (and mail-specify-envelope-from (mail-envelope-from))
user-mail-address))
@@ -401,11 +403,14 @@ This is relative to `smtpmail-queue-dir'.")
(with-temp-buffer
(let ((coding-system-for-read 'no-conversion))
(insert-file-contents file-msg))
- (if (not (null smtpmail-recipient-address-list))
- (if (not (smtpmail-via-smtp smtpmail-recipient-address-list
- (current-buffer)))
- (error "Sending failed; SMTP protocol error"))
- (error "Sending failed; no recipients")))
+ (let ((smtpmail-mail-address
+ (or (and mail-specify-envelope-from (mail-envelope-from))
+ user-mail-address)))
+ (if (not (null smtpmail-recipient-address-list))
+ (if (not (smtpmail-via-smtp smtpmail-recipient-address-list
+ (current-buffer)))
+ (error "Sending failed; SMTP protocol error"))
+ (error "Sending failed; no recipients"))))
(delete-file file-msg)
(delete-file (concat file-msg ".el"))
(delete-region (point-at-bol) (point-at-bol 2)))
@@ -547,6 +552,12 @@ This is relative to `smtpmail-queue-dir'.")
(host (or smtpmail-smtp-server
(error "`smtpmail-smtp-server' not defined")))
(port smtpmail-smtp-service)
+ ;; smtpmail-mail-address should be set to the appropriate
+ ;; buffer-local value by the caller, but in case not:
+ (envelope-from (or smtpmail-mail-address
+ (and mail-specify-envelope-from
+ (mail-envelope-from))
+ user-mail-address))
response-code
greeting
process-buffer
@@ -696,7 +707,7 @@ This is relative to `smtpmail-queue-dir'.")
"")))
; (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
(smtpmail-send-command process (format "MAIL FROM: <%s>%s%s"
- smtpmail-mail-address
+ envelope-from
size-part
body-part))