aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/mm-encode.el13
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f0ba8af760e..d934d6c2c2e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
12008-04-24 Luca Capello <luca@pca.it> (tiny change)
2
3 * mm-encode.el (mm-safer-encoding): Add optional argument `type'.
4 Don't use QP for message/rfc822.
5 (mm-content-transfer-encoding): Pass `type' to mm-safer-encoding.
6
12008-04-13 Reiner Steib <Reiner.Steib@gmx.de> 72008-04-13 Reiner Steib <Reiner.Steib@gmx.de>
2 8
3 [Backport GNKSA related changes from the Gnus trunk.] 9 [Backport GNKSA related changes from the Gnus trunk.]
diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el
index d22c59c5018..3101b14d19e 100644
--- a/lisp/gnus/mm-encode.el
+++ b/lisp/gnus/mm-encode.el
@@ -96,14 +96,19 @@ This variable should never be set directly, but bound before a call to
96 "application/octet-stream" 96 "application/octet-stream"
97 (mailcap-extension-to-mime (match-string 0 file)))) 97 (mailcap-extension-to-mime (match-string 0 file))))
98 98
99(defun mm-safer-encoding (encoding) 99(defun mm-safer-encoding (encoding &optional type)
100 "Return an encoding similar to ENCODING but safer than it." 100 "Return an encoding similar to ENCODING but safer than it."
101 (cond 101 (cond
102 ((eq encoding '7bit) '7bit) ;; 7bit is considered safe. 102 ((eq encoding '7bit) '7bit) ;; 7bit is considered safe.
103 ((memq encoding '(8bit quoted-printable)) 'quoted-printable) 103 ((memq encoding '(8bit quoted-printable))
104 ;; According to RFC2046, 5.2.1, RFC822 Subtype, "quoted-printable" is not
105 ;; a valid encoding for message/rfc822:
106 ;; No encoding other than "7bit", "8bit", or "binary" is permitted for the
107 ;; body of a "message/rfc822" entity.
108 (if (string= type "message/rfc822") '8bit 'quoted-printable))
104 ;; The remaining encodings are binary and base64 (and perhaps some 109 ;; The remaining encodings are binary and base64 (and perhaps some
105 ;; non-standard ones), which are both turned into base64. 110 ;; non-standard ones), which are both turned into base64.
106 (t 'base64))) 111 (t (if (string= type "message/rfc822") 'binary 'base64))))
107 112
108(defun mm-encode-content-transfer-encoding (encoding &optional type) 113(defun mm-encode-content-transfer-encoding (encoding &optional type)
109 "Encode the current buffer with ENCODING for MIME type TYPE. 114 "Encode the current buffer with ENCODING for MIME type TYPE.
@@ -178,7 +183,7 @@ The encoding used is returned."
178 (mm-qp-or-base64) 183 (mm-qp-or-base64)
179 (cadr (car rules))))) 184 (cadr (car rules)))))
180 (if mm-use-ultra-safe-encoding 185 (if mm-use-ultra-safe-encoding
181 (mm-safer-encoding encoding) 186 (mm-safer-encoding encoding type)
182 encoding)))) 187 encoding))))
183 (pop rules))))) 188 (pop rules)))))
184 189