Mercurial > emacs
diff lisp/mail/unrmail.el @ 101770:dab601ced3e6
(unrmail): In the absence of Mail-from, prefer Date over current-time.
(Bug#2175)
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Tue, 03 Feb 2009 08:09:03 +0000 |
parents | 4ea3bd98b124 |
children | 60634423f085 |
line wrap: on
line diff
--- a/lisp/mail/unrmail.el Tue Feb 03 04:13:17 2009 +0000 +++ b/lisp/mail/unrmail.el Tue Feb 03 08:09:03 2009 +0000 @@ -184,11 +184,21 @@ (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")))