From 71d8a1403c2992134945daa8737ef44186ed6596 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 10 Apr 2009 11:54:53 +0000 Subject: (unrmail): If "Mail-From" header is found, append a newline to it. --- lisp/mail/unrmail.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lisp/mail/unrmail.el') diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index bb73b82c9ef..cd71ec58571 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -191,7 +191,13 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (save-excursion (search-forward "\n\n" nil 'move) (point))) ;; Fetch or construct what we should use in the `From ' line. - (setq mail-from (or (mail-fetch-field "Mail-From") + (setq mail-from (or (let ((from (mail-fetch-field "Mail-From"))) + ;; mail-mbox-from (below) returns a + ;; string that ends in a newline, but + ;; but mail-fetch-field does not, so + ;; we append a newline here. + (if from + (format "%s\n" from))) (mail-mbox-from))) ;; If the message specifies a coding system, use it. @@ -213,7 +219,7 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (goto-char (point-min)) ;; Insert the `From ' line. - (insert mail-from "\n") + (insert mail-from) ;; Record the keywords and attributes in our special way. (insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n") (when keywords -- cgit v1.2.1