changeset 88285:c619ed3d2827

(rmail-convert-mbox-format): Decode messages with content-transfer-encoding quoted-printable, because it's easy to do. (rmail-unknown-mail-followup-to): Compare with rmail-user-mail-address-regexp instead of computing the default value.
author Alex Schroeder <alex@gnu.org>
date Mon, 23 Jan 2006 16:54:15 +0000
parents 0be17d16f2ef
children 32c6e924fc14
files lisp/mail/rmail.el
diffstat 1 files changed, 28 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Mon Jan 23 16:52:48 2006 +0000
+++ b/lisp/mail/rmail.el	Mon Jan 23 16:54:15 2006 +0000
@@ -48,6 +48,7 @@
 (require 'rmailhdr)
 (require 'rmailkwd)
 (require 'mail-parse)
+(require 'qp)
 
 (defvar deleted-head)
 (defvar font-lock-fontified)
@@ -2055,12 +2056,20 @@
 		    (delete-char 1)))
 		(setq end (marker-position end-marker))
 		(set-marker end-marker nil)))
-
-	    ;; encoded-words in from and subject
-	    (dolist (header '("Subject" "From"))
+	    ;; Convert encoded-words in from and subject
+	    (dolist (header '("From" "Subject"))
 	      (let ((value (rmail-header-get-header header)))
 		(rmail-header-add-header
 		 header (mail-decode-encoded-word-string value))))
+	    ;; Convert quoted printable transfer encoding because it
+	    ;; is easy to do.
+	    (let ((encoding (rmail-header-get-header
+			     "content-transfer-encoding")))
+	      (when (and encoding
+			 (string= (downcase encoding)
+				  "quoted-printable"))
+		(quoted-printable-decode-region (rmail-header-get-limit)
+						(point-max))))
 
 	    ;; Make sure we have an Rmail BABYL attribute header field.
 	    ;; All we can assume is that the Rmail BABYL header field is
@@ -2107,35 +2116,22 @@
 (defun rmail-unknown-mail-followup-to ()
   "Handle a \"Mail-Followup-To\" header field with an unknown mailing list.
 Ask the user whether to add that list name to `mail-mailing-lists'."
-   (save-restriction
-     (rmail-narrow-to-non-pruned-header)
-     (let ((mail-followup-to (mail-fetch-field "mail-followup-to" nil t)))
-       (when mail-followup-to
-	 (let ((addresses
-		(split-string
-		 (mail-strip-quoted-names mail-followup-to)
-		 ",[[:space:]]+" t)))
-	   (dolist (addr addresses)
-	     (when (and (not (member addr mail-mailing-lists))
-			(not
-			 ;; taken from rmailsum.el
-			 (string-match
-			  (or rmail-user-mail-address-regexp
-			      (concat "^\\("
-				      (regexp-quote (user-login-name))
-				      "\\($\\|@\\)\\|"
-				      (regexp-quote
-				       (or user-mail-address
-					   (concat (user-login-name) "@"
-						   (or mail-host-address
-						       (system-name)))))
-				      "\\>\\)"))
-			  addr))
-			(y-or-n-p
-			 (format "Add `%s' to `mail-mailing-lists'? "
-				 addr)))
-	       (customize-save-variable 'mail-mailing-lists
-					(cons addr mail-mailing-lists)))))))))
+  (save-restriction
+    (rmail-narrow-to-non-pruned-header)
+    (let ((mail-followup-to (mail-fetch-field "mail-followup-to" nil t)))
+      (when mail-followup-to
+	(let ((addresses
+	       (split-string
+		(mail-strip-quoted-names mail-followup-to)
+		",[[:space:]]+" t)))
+	  (dolist (addr addresses)
+	    (when (and (not (member addr mail-mailing-lists))
+		       (not (string-match rmail-user-mail-address-regexp addr))
+		       (y-or-n-p
+			(format "Add `%s' to `mail-mailing-lists'? "
+				addr)))
+	      (customize-save-variable 'mail-mailing-lists
+				       (cons addr mail-mailing-lists)))))))))
 
 (defun rmail-show-message (&optional n no-summary)
   "Show message number N (prefix argument), counting from start of file.