Commit 8de31eec authored by Glenn Morris's avatar Glenn Morris

Small mail-utils fix for bug 7760.

* lisp/mail/mail-utils.el (mail-mbox-from): Handle From: headers with
multiple addresses.
parent 01e62600
2011-01-02 Glenn Morris <rgm@gnu.org>
* mail/mail-utils.el (mail-mbox-from): Handle From: headers with
multiple addresses. (Bug#7760)
2010-12-31 Michael Albinus <michael.albinus@gmx.de> 2010-12-31 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-methods): Add recursive options to "scpc", * net/tramp.el (tramp-methods): Add recursive options to "scpc",
...@@ -12324,7 +12329,7 @@ See ChangeLog.14 for earlier changes. ...@@ -12324,7 +12329,7 @@ See ChangeLog.14 for earlier changes.
;; coding: utf-8 ;; coding: utf-8
;; End: ;; End:
Copyright (C) 2009, 2010 Free Software Foundation, Inc. Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Emacs. This file is part of GNU Emacs.
......
;;; mail-utils.el --- utility functions used both by rmail and rnews ;;; mail-utils.el --- utility functions used both by rmail and rnews
;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
;; 2009, 2010 Free Software Foundation, Inc. ;; 2009, 2010, 2011 Free Software Foundation, Inc.
;; Maintainer: FSF ;; Maintainer: FSF
;; Keywords: mail, news ;; Keywords: mail, news
...@@ -398,13 +398,19 @@ matches may be returned from the message body." ...@@ -398,13 +398,19 @@ matches may be returned from the message body."
(defun mail-mbox-from () (defun mail-mbox-from ()
"Return an mbox \"From \" line for the current message. "Return an mbox \"From \" line for the current message.
The buffer should be narrowed to just the header." The buffer should be narrowed to just the header."
(let ((from (or (mail-fetch-field "from") (let* ((from (mail-strip-quoted-names (or (mail-fetch-field "from")
(mail-fetch-field "really-from") (mail-fetch-field "really-from")
(mail-fetch-field "sender") (mail-fetch-field "sender")
(mail-fetch-field "return-path") (mail-fetch-field "return-path")
"unknown")) "unknown")))
(date (mail-fetch-field "date"))) (date (mail-fetch-field "date"))
(format "From %s %s\n" (mail-strip-quoted-names from) ;; A From: header can contain multiple addresses, a "From "
;; line must contain only one. (Bug#7760)
;; See eg RFC 5322, 3.6.2. Originator Fields.
(end (string-match "[ \t]*[,\n]" from)))
(format "From %s %s\n" (if end
(substring from 0 end)
from)
(or (and date (or (and date
(ignore-errors (ignore-errors
(current-time-string (date-to-time date)))) (current-time-string (date-to-time date))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment