aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/mail/mail-utils.el22
2 files changed, 20 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4a89aca9ac4..88295cb6a1c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-01-02 Glenn Morris <rgm@gnu.org>
2
3 * mail/mail-utils.el (mail-mbox-from): Handle From: headers with
4 multiple addresses. (Bug#7760)
5
12010-12-31 Michael Albinus <michael.albinus@gmx.de> 62010-12-31 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * net/tramp.el (tramp-methods): Add recursive options to "scpc", 8 * net/tramp.el (tramp-methods): Add recursive options to "scpc",
@@ -12324,7 +12329,7 @@ See ChangeLog.14 for earlier changes.
12324;; coding: utf-8 12329;; coding: utf-8
12325;; End: 12330;; End:
12326 12331
12327 Copyright (C) 2009, 2010 Free Software Foundation, Inc. 12332 Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
12328 12333
12329 This file is part of GNU Emacs. 12334 This file is part of GNU Emacs.
12330 12335
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index a8def04100e..19ddada1025 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -1,7 +1,7 @@
1;;; mail-utils.el --- utility functions used both by rmail and rnews 1;;; mail-utils.el --- utility functions used both by rmail and rnews
2 2
3;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 3;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4;; 2009, 2010 Free Software Foundation, Inc. 4;; 2009, 2010, 2011 Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
7;; Keywords: mail, news 7;; Keywords: mail, news
@@ -398,13 +398,19 @@ matches may be returned from the message body."
398(defun mail-mbox-from () 398(defun mail-mbox-from ()
399 "Return an mbox \"From \" line for the current message. 399 "Return an mbox \"From \" line for the current message.
400The buffer should be narrowed to just the header." 400The buffer should be narrowed to just the header."
401 (let ((from (or (mail-fetch-field "from") 401 (let* ((from (mail-strip-quoted-names (or (mail-fetch-field "from")
402 (mail-fetch-field "really-from") 402 (mail-fetch-field "really-from")
403 (mail-fetch-field "sender") 403 (mail-fetch-field "sender")
404 (mail-fetch-field "return-path") 404 (mail-fetch-field "return-path")
405 "unknown")) 405 "unknown")))
406 (date (mail-fetch-field "date"))) 406 (date (mail-fetch-field "date"))
407 (format "From %s %s\n" (mail-strip-quoted-names from) 407 ;; A From: header can contain multiple addresses, a "From "
408 ;; line must contain only one. (Bug#7760)
409 ;; See eg RFC 5322, 3.6.2. Originator Fields.
410 (end (string-match "[ \t]*[,\n]" from)))
411 (format "From %s %s\n" (if end
412 (substring from 0 end)
413 from)
408 (or (and date 414 (or (and date
409 (ignore-errors 415 (ignore-errors
410 (current-time-string (date-to-time date)))) 416 (current-time-string (date-to-time date))))