# HG changeset patch # User Henrik Enberg # Date 1137537098 0 # Node ID 1f1ae6ac5610b973af49e1e4b2a363c679c3818b # Parent ee955ad919b1d726ebd0d1c22929d049ea048253 (rmail-process-new-messages): Add an X-Coding-System header if one doesn't exist. diff -r ee955ad919b1 -r 1f1ae6ac5610 lisp/mail/rmail.el --- a/lisp/mail/rmail.el Tue Jan 17 21:33:34 2006 +0000 +++ b/lisp/mail/rmail.el Tue Jan 17 22:31:38 2006 +0000 @@ -1944,7 +1944,8 @@ (case-fold-search nil) (new-message-counter 0) (start (point-max)) - end attributes keywords message-descriptor-list date) + end attributes keywords message-descriptor-list + date coding) (or nomsg (message "Processing new messages...")) ;; Process each message in turn starting from the back and ;; proceeding to the front of the region. This is especially a @@ -1985,6 +1986,17 @@ (delete-char 1))) (setq end (marker-position end-marker)) (set-marker end-marker nil))) + + ;; Add an X-Coding-System header if we don't have one. + (unless (rmail-header-get-header "X-Coding-System") + (let ((case-fold-search t)) + (when (save-excursion + (goto-char start) + (search-forward "\n\n" nil t) + (re-search-backward rmail-mime-charset-pattern start t)) + (rmail-header-add-header "X-Coding-System" + (downcase (match-string 1)))))) + ;; Make sure we have an Rmail BABYL attribute header field. ;; All we can assume is that the Rmail BABYL header field is ;; in the header section. It's placement can be modified by