* FLIM-ELS (flim-modules): Install mel-b-el also for
[elisp/flim.git] / smtpmail.el
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))