emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/backports-25.2 d7de0c4 25/46: smtpmail would say i


From: Noam Postavsky
Subject: [Emacs-diffs] scratch/backports-25.2 d7de0c4 25/46: smtpmail would say it's done before it is
Date: Sun, 2 Oct 2016 14:04:49 +0000 (UTC)

branch: scratch/backports-25.2
commit d7de0c4cacbbe6cdad3fef3fe0374ce29db038ab
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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.
    
    (cherry picked from commit fd8956d36abaaa90137cf9f9c4b4095e3a2ac7c1)
---
 lisp/mail/smtpmail.el |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 8e0bb3a..f21b847 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -858,8 +858,6 @@ Returns an error if the server cannot be contacted."
            ;; Send the contents.
            (smtpmail-command-or-throw process "DATA")
            (smtpmail-send-data process smtpmail-text-buffer)
-           ;; DATA end "."
-           (smtpmail-command-or-throw process ".")
            ;; Return success.
            nil))
       (when (and process
@@ -957,10 +955,11 @@ Returns an error if the server cannot be contacted."
   (process-send-string process "\r\n"))
 
 (defun smtpmail-send-data (process buffer)
-  (let ((data-continue t) sending-data
+  (let ((data-continue t)
         (pr (with-current-buffer buffer
               (make-progress-reporter "Sending email "
-                                      (point-min) (point-max)))))
+                                      (point-min) (point-max))))
+        sending-data)
     (with-current-buffer buffer
       (goto-char (point-min)))
     (while data-continue
@@ -970,6 +969,8 @@ Returns an error if the server cannot be contacted."
        (end-of-line 2)
         (setq data-continue (not (eobp))))
       (smtpmail-send-data-1 process sending-data))
+    ;; DATA end "."
+    (smtpmail-command-or-throw process ".")
     (progress-reporter-done pr)))
 
 (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start 
header-end)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]