diff options
| author | Lars Ingebrigtsen | 2012-09-04 18:00:10 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2012-09-04 18:00:10 +0200 |
| commit | 8ce192e317f321834851e31571833f33aa332aa2 (patch) | |
| tree | 66cd06bf09eced3672faeb86eb0fa90546e52f76 | |
| parent | 6ec9a5a7b5efb129807f567709ca858211ed7840 (diff) | |
| download | emacs-8ce192e317f321834851e31571833f33aa332aa2.tar.gz emacs-8ce192e317f321834851e31571833f33aa332aa2.zip | |
Have smtpmail.el prefer the From: header for the MAIL FROM envelope
* mail/smtpmail.el (smtpmail-send-it): Prefer the From: header
over `user-mail-address' for the SMTP MAIL FROM envelope.
(smtpmail-via-smtp): Ditto.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mail/smtpmail.el | 12 |
3 files changed, 15 insertions, 7 deletions
| @@ -1403,6 +1403,10 @@ If you had that set, you need to put | |||
| 1403 | 1403 | ||
| 1404 | in your ~/.authinfo file instead. | 1404 | in your ~/.authinfo file instead. |
| 1405 | 1405 | ||
| 1406 | *** SMTPmail defaults to using the address in the From: header as the | ||
| 1407 | SMTP MAIL FROM envelope. To override this, set `mail-envelope-from' | ||
| 1408 | to the address you wish to use instead. | ||
| 1409 | |||
| 1406 | ** SQL mode | 1410 | ** SQL mode |
| 1407 | 1411 | ||
| 1408 | *** New options `sql-port', `sql-connection-alist', `sql-send-terminator', | 1412 | *** New options `sql-port', `sql-connection-alist', `sql-send-terminator', |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4630d36691..4707834fe6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * mail/smtpmail.el (smtpmail-send-it): Prefer the From: header | ||
| 4 | over `user-mail-address' for the SMTP MAIL FROM envelope. | ||
| 5 | (smtpmail-via-smtp): Ditto. | ||
| 6 | |||
| 1 | 2012-09-04 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2012-09-04 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * progmodes/ruby-mode.el: Clean up keybindings. | 9 | * progmodes/ruby-mode.el: Clean up keybindings. |
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 804fe7a8798..69a405436a7 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -200,10 +200,10 @@ The list is in preference order.") | |||
| 200 | ;; local binding in the mail buffer will take effect. | 200 | ;; local binding in the mail buffer will take effect. |
| 201 | (smtpmail-mail-address | 201 | (smtpmail-mail-address |
| 202 | (or (and mail-specify-envelope-from (mail-envelope-from)) | 202 | (or (and mail-specify-envelope-from (mail-envelope-from)) |
| 203 | (smtpmail-user-mail-address) | 203 | (let ((from (mail-fetch-field "from"))) |
| 204 | (let ((from (mail-fetch-field "from"))) | ||
| 205 | (and from | 204 | (and from |
| 206 | (cadr (mail-extract-address-components from)))))) | 205 | (cadr (mail-extract-address-components from)))) |
| 206 | (smtpmail-user-mail-address))) | ||
| 207 | (smtpmail-code-conv-from | 207 | (smtpmail-code-conv-from |
| 208 | (if enable-multibyte-characters | 208 | (if enable-multibyte-characters |
| 209 | (let ((sendmail-coding-system smtpmail-code-conv-from)) | 209 | (let ((sendmail-coding-system smtpmail-code-conv-from)) |
| @@ -653,12 +653,10 @@ Returns an error if the server cannot be contacted." | |||
| 653 | (or smtpmail-mail-address | 653 | (or smtpmail-mail-address |
| 654 | (and mail-specify-envelope-from | 654 | (and mail-specify-envelope-from |
| 655 | (mail-envelope-from)) | 655 | (mail-envelope-from)) |
| 656 | (smtpmail-user-mail-address) | ||
| 657 | ;; Fall back on the From: header as the envelope From | ||
| 658 | ;; address. | ||
| 659 | (let ((from (mail-fetch-field "from"))) | 656 | (let ((from (mail-fetch-field "from"))) |
| 660 | (and from | 657 | (and from |
| 661 | (cadr (mail-extract-address-components from)))))) | 658 | (cadr (mail-extract-address-components from)))) |
| 659 | (smtpmail-user-mail-address))) | ||
| 662 | response-code | 660 | response-code |
| 663 | process-buffer | 661 | process-buffer |
| 664 | result | 662 | result |