Gnus development mailing list
 help / color / mirror / Atom feed
From: Hrvoje Niksic <hniksic@xemacs.org>
Subject: Non-MML forwarding strips Content-Transfer-Encoding
Date: Tue, 23 Jul 2002 15:47:21 +0200	[thread overview]
Message-ID: <sxsk7nmimja.fsf@florida.munich.redhat.com> (raw)

[ Please Cc the responses to me as I'm not on the list. ]

A bug in the forwarding code has just bit me.

I set `message-forward-show-mml' to nil because I prefer to forward
mails as they are.  Recently something broke, though.  If you set
`message-forward-show-mml' to nil and try to forward a message encoded
as base64 (e.g. one that contains only a picture), the
Content-Transfer-Encoding header gets stripped from the embedded
message.  You end up with a buffer that looks like this:

[#part type=message/rfc822 raw=t bla bla ...]
X-From-Line: ...
<correct MIME headers sans Content-Transfer-Encoding>

<... base64 body ...>
[#/part]

Obviously, stripping Content-Transfer-Encoding is wrong.  The
resulting message is corrupted because its body will be interpreted to
contain 7bit data.  It is also wrong in principle -- when
`message-forward-show-mml' is unset, I expect little or no tinkering
with the embedded message.  Gnus should just make sure it is correctly
embedded as a part, and the rest will follow from that.

The one place where Content-Transfer-Encoding is removed is in
message-forward-make-body.  I tried the obvious fix of removing
Content-Transfer-Encoding from message-forward-ignored-headers and
having message-forward-make-body manually remove
Content-Transfer-Encoding when message-forward-show-mml is t:

    --- message.el.orig	Tue Jul 23 15:30:29 2002
    +++ message.el	Tue Jul 23 15:32:22 2002
    @@ -336,3 +336,3 @@

    -(defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
    +(defcustom message-forward-ignored-headers "^X-Gnus"
       "*All headers that match this regexp will be deleted when forwarding a message."
    @@ -5045,3 +5045,5 @@
                                (or (search-forward "\n\n" nil t) (point)))
    -	  (message-remove-header message-forward-ignored-headers t)))))
    +	  (message-remove-header message-forward-ignored-headers t)
    +	  (when message-forward-show-mml
    +	    (message-remove-header "^Content-Transfer-Encoding"))))))
       (message-position-point))

But even with this fix, something is *still* removing the
Content-Transfer-Encoding header.  `message-encode-message-body' and
`message-send-mail-partially' both do it, but I'm not sure how or
whether they get called.

Can someone please help?



             reply	other threads:[~2002-07-23 13:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 13:47 Hrvoje Niksic [this message]
2002-07-26 18:10 ` Simon Josefsson
2002-07-27 16:35   ` Hrvoje Niksic
2002-07-27 20:48     ` Simon Josefsson

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=sxsk7nmimja.fsf@florida.munich.redhat.com \
    --to=hniksic@xemacs.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).