Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: ding@gnus.org
Subject: Re: Non-MML forwarding strips Content-Transfer-Encoding
Date: Fri, 26 Jul 2002 20:10:02 +0200	[thread overview]
Message-ID: <iluadoez7gl.fsf@latte.josefsson.org> (raw)
In-Reply-To: <sxsk7nmimja.fsf@florida.munich.redhat.com> (Hrvoje Niksic's message of "Tue, 23 Jul 2002 15:47:21 +0200")

Hrvoje Niksic <hniksic@xemacs.org> writes:

> [ 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.

Yup.  Removing it is Right when message-forward-show-mml is non-nil,
the default, though.  So it is probably only a matter of not testing
that combination.  This should fix that particular problem.

--- message.el.~6.240.~	2002-06-29 16:38:03.000000000 +0200
+++ message.el	2002-07-26 19:07:45.000000000 +0200
@@ -5190,7 +5190,9 @@
 			    (or (search-forward "\n\n" nil t) (point)))
 	  (delete-region (point-min) (point-max)))
       (when (and (not current-prefix-arg)
-		 message-forward-ignored-headers)
+		 message-forward-ignored-headers
+		 ;; don't remove CTE, X-Gnus etc when doing "raw" forward:
+		 message-forward-show-mml)
 	(save-restriction
 	  (narrow-to-region b e)
 	  (goto-char b)

> 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:
...
> 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?

The above is sufficient for me.  m-e-m-b only removes the header in
the new message, not in the forwarded one, it seems, so there
shouldn't be a need to modify it.

If this isn't sufficient for you, I'm not sure what to do except
debugging every step of sending the mail to track what is happening.




  reply	other threads:[~2002-07-26 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 13:47 Hrvoje Niksic
2002-07-26 18:10 ` Simon Josefsson [this message]
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=iluadoez7gl.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    --cc=ding@gnus.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).