emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.60; [gnus] incorrect Content-Transfer-Encoding for inline messa


From: Reiner Steib
Subject: Re: 23.0.60; [gnus] incorrect Content-Transfer-Encoding for inline message/rfc822 entities
Date: Thu, 24 Apr 2008 23:58:08 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2.50 (gnu/linux)

On Wed, Apr 23 2008, Luca Capello wrote:

> Today I forwarded the attached mail to the Debian development mailing
> list [1], but the mail was rejected by Postfix with error:
>
>   Diagnostic code: smtp;550 5.6.0 invalid message/* or multipart/*
>                    encoding domain
>
> The problem seems to be in the headers of the "message/rfc822" entity:
>
>   Content-Type: message/rfc822
>   Content-Disposition: inline
>   Content-Transfer-Encoding: quoted-printable
>
> In fact, according to RFC2046, ยง 5.2.1, RFC822 Subtype [2],
> "quoted-printable" is not a valid encoding:
>
>   No encoding other than "7bit", "8bit", or "binary" is permitted for
>   the body of a "message/rfc822" entity.
>
> The error is in lisp/gnus/mm-encode.el:mm-safer-encoding, which returns
> quoted-printable if the entity encoding is either 8bit or
> quoted-printable.  If I correctly read RFC2046 this is plainly wrong for
> the specific "message/rfc822" entity, as it should return 8bit instead,
> and as well as for base64 (it should return binary).  I tested the
> following patch for "message/rfc822" and "text/plain" entities:

I've installed it in the stable Gnus branch (v5-10).  It will be
synced to the trunk and to Emacs (trunk and Emacs_22 branch) later.

The patch looks good to me.  Thanks for your contribution.
Does anyone see a problem with this it?

> --- mm-encode.el.~1~  2008-04-23 19:37:22.000000000 +0200
> +++ mm-encode.el      2008-04-23 20:00:32.000000000 +0200
> @@ -96,14 +96,15 @@
>        "application/octet-stream"
>      (mailcap-extension-to-mime (match-string 0 file))))
>
> -(defun mm-safer-encoding (encoding)
> +(defun mm-safer-encoding (encoding &optional type)
>    "Return an encoding similar to ENCODING but safer than it."
>    (cond
>     ((eq encoding '7bit) '7bit) ;; 7bit is considered safe.
> -   ((memq encoding '(8bit quoted-printable)) 'quoted-printable)
> +   ((memq encoding '(8bit quoted-printable))
> +    (if (string= type "message/rfc822") '8bit 'quoted-printable))
>     ;; The remaining encodings are binary and base64 (and perhaps some
>     ;; non-standard ones), which are both turned into base64.
> -   (t 'base64)))
> +   (t (if (string= type "message/rfc822") 'binary 'base64))))
>
>  (defun mm-encode-content-transfer-encoding (encoding &optional type)
>    "Encode the current buffer with ENCODING for MIME type TYPE.
> @@ -178,7 +179,7 @@
>                           (mm-qp-or-base64)
>                         (cadr (car rules)))))
>                  (if mm-use-ultra-safe-encoding
> -                    (mm-safer-encoding encoding)
> +                    (mm-safer-encoding encoding type)
>                    encoding))))
>       (pop rules)))))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]