1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(mail-send): Complain about invalid header line.

This commit is contained in:
Richard M. Stallman 1997-08-30 18:03:33 +00:00
parent e523f7e526
commit 413d1aa236

View file

@ -575,6 +575,13 @@ the user from the mailer."
(or (y-or-n-p "Message contains non-ASCII characters; send anyway? ")
(error "Aborted"))
(error "Message contains non-ASCII characters"))))
;; Complain about any invalid line.
(goto-char (point-min))
(while (not (looking-at (regexp-quote mail-header-separator)))
(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...")
@ -633,10 +640,11 @@ the user from the mailer."
(if mail-aliases
(expand-mail-aliases (point-min) delimline))
(goto-char (point-min))
;; ignore any blank lines in the header
;; Ignore any blank lines in the header
(while (and (re-search-forward "\n\n\n*" delimline t)
(< (point) delimline))
(replace-match "\n"))
(goto-char (point-min))
(let ((case-fold-search t))
(goto-char (point-min))
(while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline t)