* smtpmail.el (smtpmail-send-it): Work even if the first line of the subject
authoryamaoka <yamaoka>
Mon, 30 Jul 2001 11:03:21 +0000 (11:03 +0000)
committeryamaoka <yamaoka>
Mon, 30 Jul 2001 11:03:21 +0000 (11:03 +0000)
 field has no content (synch with Emacs 20.3).

ChangeLog
smtpmail.el

index 3c73ef3..7361d05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-16  Katsumi Yamaoka   <yamaoka@jpl.org>
+
+       * smtpmail.el (smtpmail-send-it): Work even if the first line of
+       the subject field has no content (synch with Emacs 20.3).
+
 2001-07-30  AMAKAWA Shuhei <sa264@cam.ac.uk>
 
        * smtp.el(smtp-submit-package): Send EHLO after starttls.
index dae1378..cdc396c 100644 (file)
@@ -154,8 +154,12 @@ This is relative to `smtpmail-queue-dir'.")
 ;;;               (insert "Sender: " (user-login-name) "\n")))
            ;; Don't send out a blank subject line
            (goto-char (point-min))
-           (if (re-search-forward "^Subject:[ \t]*\n" delimline t)
-               (replace-match ""))
+           (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
+               (replace-match "")
+             ;; This one matches a Subject just before the header delimiter.
+             (if (and (re-search-forward "^Subject:\\([ \t]*\n\\)+" delimline t)
+                      (= (match-end 0) delimline))
+                 (replace-match "")))
            ;; Put the "From:" field in unless for some odd reason
            ;; they put one in themselves.
            (goto-char (point-min))