From: Glenn Morris Date: Tue, 3 Feb 2009 08:09:03 +0000 (+0000) Subject: (unrmail): In the absence of Mail-from, prefer Date over current-time. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/58400e4fa88a691d4dce2eaaba2b74f103eb5045 (unrmail): In the absence of Mail-from, prefer Date over current-time. (Bug#2175) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81c7b01638..ca787cfcd2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-02-03 Glenn Morris + * mail/unrmail.el (unrmail): In the absence of Mail-from, prefer Date + over current-time. (Bug#2175) + * mail/rmail.el (rmail-convert-babyl-to-mbox): Disable undo while inserting the converted mailbox. (rmail-get-new-mail): Restore the loop over inboxes when two or more diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index 9d1717368b..8fb15f1813 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -184,11 +184,21 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (setq mail-from (or (mail-fetch-field "Mail-From") (concat "From " - (mail-strip-quoted-names (or (mail-fetch-field "from") - (mail-fetch-field "really-from") - (mail-fetch-field "sender") - "unknown")) - " " (current-time-string)))) + (mail-strip-quoted-names + (or (mail-fetch-field "from") + (mail-fetch-field "really-from") + (mail-fetch-field "sender") + "unknown")) + " " + (let ((date (mail-fetch-field "date"))) + (or + (and date + (setq date + (ignore-errors + (format-time-string + "%a %b %e %T %Y" + (date-to-time date))))) + (current-time-string)))))) ;; If the message specifies a coding system, use it. (let ((maybe-coding (mail-fetch-field "X-Coding-System")))