Sync up with FLIM 1.14.4.
[elisp/lemi.git] / mail / smtpmail.el
index 6a6bd59..d037486 100644 (file)
@@ -1,6 +1,6 @@
 ;;; smtpmail.el --- SMTP interface for mail-mode
 
-;; Copyright (C) 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,98,99,2000,01,02 Free Software Foundation, Inc.
 
 ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
 ;; Keywords: mail
@@ -155,8 +155,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))