Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: Luca Capello <luca@pca.it>
Cc: emacs-pretest-bug@gnu.org, rfrancoise@debian.org, ding@gnus.org
Subject: Re: 23.0.60; [gnus] incorrect Content-Transfer-Encoding for inline message/rfc822 entities
Date: Thu, 24 Apr 2008 23:58:08 +0200	[thread overview]
Message-ID: <v9iqy69aq7.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <87wsmojpej.fsf@gismo.pca.it> (Luca Capello's message of "Wed, 23 Apr 2008 22:18:44 +0200")

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	other threads:[~2008-04-24 21:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <87wsmojpej.fsf@gismo.pca.it>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9iqy69aq7.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=luca@pca.it \
    --cc=rfrancoise@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).