changeset 71349:424b1f91f07b

* mail/sendmail.el (mail-send): Search explicitly for mail-header-separator when checking for corrupted header lines.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 15 Jun 2006 18:34:26 +0000
parents 10a6583c5ff7
children 0844ec8948e9
files lisp/ChangeLog lisp/mail/sendmail.el
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jun 15 00:57:53 2006 +0000
+++ b/lisp/ChangeLog	Thu Jun 15 18:34:26 2006 +0000
@@ -1,3 +1,8 @@
+2006-06-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* mail/sendmail.el (mail-send): Search explicitly for
+	mail-header-separator when checking for corrupted header lines.
+
 2006-06-15  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gdb-ui.el (gdb-same-frame): New option.
--- a/lisp/mail/sendmail.el	Thu Jun 15 00:57:53 2006 +0000
+++ b/lisp/mail/sendmail.el	Thu Jun 15 18:34:26 2006 +0000
@@ -863,11 +863,14 @@
 		(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...")