diff options
| author | Lars Magne Ingebrigtsen | 2016-04-26 00:59:50 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2016-04-26 00:59:50 +0200 |
| commit | fd8956d36abaaa90137cf9f9c4b4095e3a2ac7c1 (patch) | |
| tree | 7d577d84988e775d496a2bbc58d9c3e9c3ade600 | |
| parent | 77ba0f1c5a259615ec049e21d061c4646e29f1d6 (diff) | |
| download | emacs-fd8956d36abaaa90137cf9f9c4b4095e3a2ac7c1.tar.gz emacs-fd8956d36abaaa90137cf9f9c4b4095e3a2ac7c1.zip | |
smtpmail would say it's done before it is
* lisp/mail/smtpmail.el (smtpmail-via-smtp): Move the sending
of the data end marker from here... (bug#23020).
(smtpmail-send-data): ... to here, so that we don't get a
"Sending done" before we've sent the final "." (which can make
the SMPT server reject the email.
| -rw-r--r-- | lisp/mail/smtpmail.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 8e0bb3ae6ba..f21b847b49b 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -858,8 +858,6 @@ Returns an error if the server cannot be contacted." | |||
| 858 | ;; Send the contents. | 858 | ;; Send the contents. |
| 859 | (smtpmail-command-or-throw process "DATA") | 859 | (smtpmail-command-or-throw process "DATA") |
| 860 | (smtpmail-send-data process smtpmail-text-buffer) | 860 | (smtpmail-send-data process smtpmail-text-buffer) |
| 861 | ;; DATA end "." | ||
| 862 | (smtpmail-command-or-throw process ".") | ||
| 863 | ;; Return success. | 861 | ;; Return success. |
| 864 | nil)) | 862 | nil)) |
| 865 | (when (and process | 863 | (when (and process |
| @@ -957,10 +955,11 @@ Returns an error if the server cannot be contacted." | |||
| 957 | (process-send-string process "\r\n")) | 955 | (process-send-string process "\r\n")) |
| 958 | 956 | ||
| 959 | (defun smtpmail-send-data (process buffer) | 957 | (defun smtpmail-send-data (process buffer) |
| 960 | (let ((data-continue t) sending-data | 958 | (let ((data-continue t) |
| 961 | (pr (with-current-buffer buffer | 959 | (pr (with-current-buffer buffer |
| 962 | (make-progress-reporter "Sending email " | 960 | (make-progress-reporter "Sending email " |
| 963 | (point-min) (point-max))))) | 961 | (point-min) (point-max)))) |
| 962 | sending-data) | ||
| 964 | (with-current-buffer buffer | 963 | (with-current-buffer buffer |
| 965 | (goto-char (point-min))) | 964 | (goto-char (point-min))) |
| 966 | (while data-continue | 965 | (while data-continue |
| @@ -970,6 +969,8 @@ Returns an error if the server cannot be contacted." | |||
| 970 | (end-of-line 2) | 969 | (end-of-line 2) |
| 971 | (setq data-continue (not (eobp)))) | 970 | (setq data-continue (not (eobp)))) |
| 972 | (smtpmail-send-data-1 process sending-data)) | 971 | (smtpmail-send-data-1 process sending-data)) |
| 972 | ;; DATA end "." | ||
| 973 | (smtpmail-command-or-throw process ".") | ||
| 973 | (progress-reporter-done pr))) | 974 | (progress-reporter-done pr))) |
| 974 | 975 | ||
| 975 | (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end) | 976 | (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end) |