diff options
| author | Richard M. Stallman | 1997-08-30 18:03:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-30 18:03:33 +0000 |
| commit | 413d1aa2369bc2a469c27bbfb33629ffeba4b18b (patch) | |
| tree | e7d17d61fd2af6de6bc5bcaad3e6d3285c6b602d | |
| parent | e523f7e5266d89a4dc625d69d09a90bdf044f673 (diff) | |
| download | emacs-413d1aa2369bc2a469c27bbfb33629ffeba4b18b.tar.gz emacs-413d1aa2369bc2a469c27bbfb33629ffeba4b18b.zip | |
(mail-send): Complain about invalid header line.
| -rw-r--r-- | lisp/mail/sendmail.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 9437cf2542a..3ead946218f 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -575,6 +575,13 @@ the user from the mailer." | |||
| 575 | (or (y-or-n-p "Message contains non-ASCII characters; send anyway? ") | 575 | (or (y-or-n-p "Message contains non-ASCII characters; send anyway? ") |
| 576 | (error "Aborted")) | 576 | (error "Aborted")) |
| 577 | (error "Message contains non-ASCII characters")))) | 577 | (error "Message contains non-ASCII characters")))) |
| 578 | ;; Complain about any invalid line. | ||
| 579 | (goto-char (point-min)) | ||
| 580 | (while (not (looking-at (regexp-quote mail-header-separator))) | ||
| 581 | (unless (looking-at "[ \t]\\|.*:\\|$") | ||
| 582 | (push-mark opoint) | ||
| 583 | (error "Invalid header line (maybe a continuation line lacks initial whitespace)")) | ||
| 584 | (forward-line 1)) | ||
| 578 | (goto-char opoint) | 585 | (goto-char opoint) |
| 579 | (run-hooks 'mail-send-hook) | 586 | (run-hooks 'mail-send-hook) |
| 580 | (message "Sending...") | 587 | (message "Sending...") |
| @@ -633,10 +640,11 @@ the user from the mailer." | |||
| 633 | (if mail-aliases | 640 | (if mail-aliases |
| 634 | (expand-mail-aliases (point-min) delimline)) | 641 | (expand-mail-aliases (point-min) delimline)) |
| 635 | (goto-char (point-min)) | 642 | (goto-char (point-min)) |
| 636 | ;; ignore any blank lines in the header | 643 | ;; Ignore any blank lines in the header |
| 637 | (while (and (re-search-forward "\n\n\n*" delimline t) | 644 | (while (and (re-search-forward "\n\n\n*" delimline t) |
| 638 | (< (point) delimline)) | 645 | (< (point) delimline)) |
| 639 | (replace-match "\n")) | 646 | (replace-match "\n")) |
| 647 | (goto-char (point-min)) | ||
| 640 | (let ((case-fold-search t)) | 648 | (let ((case-fold-search t)) |
| 641 | (goto-char (point-min)) | 649 | (goto-char (point-min)) |
| 642 | (while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline t) | 650 | (while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline t) |