Gnus development mailing list
 help / color / mirror / Atom feed
* Re: 23.0.60; [gnus] incorrect Content-Transfer-Encoding for inline message/rfc822 entities
       [not found] <87wsmojpej.fsf@gismo.pca.it>
@ 2008-04-24 21:58 ` Reiner Steib
  0 siblings, 0 replies; only message in thread
From: Reiner Steib @ 2008-04-24 21:58 UTC (permalink / raw)
  To: Luca Capello; +Cc: emacs-pretest-bug, rfrancoise, ding

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/




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-24 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87wsmojpej.fsf@gismo.pca.it>
2008-04-24 21:58 ` 23.0.60; [gnus] incorrect Content-Transfer-Encoding for inline message/rfc822 entities Reiner Steib

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).