summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/sendmail.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index ee512b3af31..28463208c45 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -863,11 +863,14 @@ the user from the mailer."
(error "Message contains non-ASCII characters"))))
;; Complain about any invalid line.
(goto-char (point-min))
- (while (< (point) (mail-header-end))
- (unless (looking-at "[ \t]\\|.*:\\|$")
- (push-mark opoint)
- (error "Invalid header line (maybe a continuation line lacks initial whitespace)"))
- (forward-line 1))
+ (re-search-forward (regexp-quote mail-header-separator) (point-max) t)
+ (let ((header-end (or (match-beginning 0) (point-max))))
+ (goto-char (point-min))
+ (while (< (point) header-end)
+ (unless (looking-at "[ \t]\\|.*:\\|$")
+ (push-mark opoint)
+ (error "Invalid header line (maybe a continuation line lacks initial whitespace)"))
+ (forward-line 1)))
(goto-char opoint)
(run-hooks 'mail-send-hook)
(message "Sending...")