From c316eb63720226518dd4c0e203e8ec935ea654bf Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 23 Jan 2006 16:54:26 +0000 Subject: [PATCH] (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. --- lisp/mail/ChangeLog | 15 ++++++++++++ lisp/mail/rmail.el | 60 +++++++++++++++++++++------------------------ 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/lisp/mail/ChangeLog b/lisp/mail/ChangeLog index cf60237c476..98fd7420366 100644 --- a/lisp/mail/ChangeLog +++ b/lisp/mail/ChangeLog @@ -1,3 +1,18 @@ +2006-01-23 Alex Schroeder + + * rmailsum.el (rmail-user-mail-address-regexp): Compute a default + value instead of assuming nil. Doc. + (rmail-summary-get-sender): Compare with + rmail-user-mail-address-regexp instead of computing the default + value. + + * rmail.el (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. + 2006-01-23 Henrik Enberg * rmail.el (rmail-decode-mbox-format): Rename from diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 28a7c67804d..eaa347f084e 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -48,6 +48,7 @@ (require 'rmailhdr) (require 'rmailkwd) (require 'mail-parse) +(require 'qp) (defvar deleted-head) (defvar font-lock-fontified) @@ -2055,12 +2056,20 @@ non-nil then do not show any progress messages." (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 @@ non-nil then do not show any progress messages." (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. -- 2.39.5