Gnus development mailing list
 help / color / mirror / Atom feed
* GIF/jpeg attached as quoted-printable in MIME?
@ 1999-09-08 21:24 Bjorn Halvor Solberg
  1999-09-09  0:14 ` Bjorn Halvor Solberg
  0 siblings, 1 reply; 10+ messages in thread
From: Bjorn Halvor Solberg @ 1999-09-08 21:24 UTC (permalink / raw)


When sending JPEG or GIF files through C-c C-a, it appears they get
encoded as quoted-printable instead of base64.  A similar thread
(starting at MsgID <6w7lp55yc1.fsf@lucent.com>) seem to have the same
problem, though I can't see any solution was presented.  I tried setting
format-alist to nil, and also tried to use insert-file-contents-literally
as was suggested throughout the thread, but saw no difference.

As in the original thread, it only happens with jpeg/gif files, even if I
specify application/octet-stream for content-type.  It does not happen
with other binaries, even if I specify image/jpeg (or gif).

I'm running emacs-20.4.1 and pgnus-0.96.  This was working fine under
pgnus-0.80.  Any help and pointers are appreciated.

Bjorn.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-08 21:24 GIF/jpeg attached as quoted-printable in MIME? Bjorn Halvor Solberg
@ 1999-09-09  0:14 ` Bjorn Halvor Solberg
  1999-09-25  8:40   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Bjorn Halvor Solberg @ 1999-09-09  0:14 UTC (permalink / raw)


Bjorn Halvor Solberg writes:

> When sending JPEG or GIF files through C-c C-a, it appears they get
> encoded as quoted-printable instead of base64.  [...]

Many thanks to Shenghuo ZHU for pointing out the variable
mm-content-transfer-encoding-defaults and how mm-qp-or-base64 works, in
mm-encode.el.  I added ("image/.*" base64) to the list, and gif/jpeg is
now encoded using base64.

The problem was really that software on the recipient side didn't know
what to do with the QP-encoded image, Gnus itself handled that just fine
as a recipient.

Bjorn.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-09  0:14 ` Bjorn Halvor Solberg
@ 1999-09-25  8:40   ` Lars Magne Ingebrigtsen
  1999-09-25 10:23     ` Kai Großjohann
  1999-09-26 21:46     ` Johan Kullstam
  0 siblings, 2 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-25  8:40 UTC (permalink / raw)


Bjorn Halvor Solberg <bhso@pacbell.net> writes:

> The problem was really that software on the recipient side didn't know
> what to do with the QP-encoded image, Gnus itself handled that just fine
> as a recipient.

I'm thinking that perhaps it's a mistake to decide whether to QP or
base64 things based on efficiency.  Does all software know how to
decode a QP-d picture?  I would kinda be surprised if that were the
case... 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-25  8:40   ` Lars Magne Ingebrigtsen
@ 1999-09-25 10:23     ` Kai Großjohann
  1999-09-25 10:38       ` Lars Magne Ingebrigtsen
  1999-09-26 21:46     ` Johan Kullstam
  1 sibling, 1 reply; 10+ messages in thread
From: Kai Großjohann @ 1999-09-25 10:23 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I'm thinking that perhaps it's a mistake to decide whether to QP or
> base64 things based on efficiency.  Does all software know how to
> decode a QP-d picture?  I would kinda be surprised if that were the
> case... 

Maybe all attachments should be base64 encoded whereas you do the
normal (efficiency) check for inline parts.  Would that be a suitable
heuristic? 

kai
-- 
I like BOTH kinds of music.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-25 10:23     ` Kai Großjohann
@ 1999-09-25 10:38       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-25 10:38 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Maybe all attachments should be base64 encoded whereas you do the
> normal (efficiency) check for inline parts.

Text attachements in charsets that are near us-ascii should probably
still be qp'd, I think...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-25  8:40   ` Lars Magne Ingebrigtsen
  1999-09-25 10:23     ` Kai Großjohann
@ 1999-09-26 21:46     ` Johan Kullstam
  1999-09-27 14:03       ` Toby Speight
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Kullstam @ 1999-09-26 21:46 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Bjorn Halvor Solberg <bhso@pacbell.net> writes:
> 
> > The problem was really that software on the recipient side didn't know
> > what to do with the QP-encoded image, Gnus itself handled that just fine
> > as a recipient.
> 
> I'm thinking that perhaps it's a mistake to decide whether to QP or
> base64 things based on efficiency.

this is not the problem.  the choosing idea is perfectly fine.  the
implementation has let us down in the details.  the problem is/was a
buggy chooser function and a buggy quoted-printable encoder.

> Does all software know how to
> decode a QP-d picture?  I would kinda be surprised if that were the
> case... 

there's something wrong with the quoted-printable encoding for binary
files.  (this is how i discovered the buggy quoted-printable-or-base64
function.)  text with the odd weird char seem to work ok.  i think it
is something to do with very long text lines.  i think software knows
how to decode QP.  gnus/emacs just needs to fix its encoding.  

i have decoded quoted-printable (which gnus-0.96 emacs 20.4 sent) in
both emacs and netscape and get the same wrong answer (i.e., corrupt
file).  i suspect the encoder.  the corruption was a spurious bang
char (!) followed by a newline.

the qp-or-base64 choser function has been bogus in 0.9[56].  in 0.96
it would choose quoted-printable for all long attachments.  since the
chooser should now be fixed.  these kinds of image sent with
quoted-printable problems should go away.  however, this doesn't mean
we ought not fix quoted-printable in the first place.

-- 
J o h a n  K u l l s t a m
[kullstam@ne.mediaone.net]
Don't Fear the Penguin!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-26 21:46     ` Johan Kullstam
@ 1999-09-27 14:03       ` Toby Speight
  1999-09-27 17:59         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Toby Speight @ 1999-09-27 14:03 UTC (permalink / raw)


Johan> Johan Kullstam <URL:mailto:kullstam@ne.mediaone.net>

0> In article <m2r9jle47q.fsf@sophia.axel.nom>, Johan wrote:

Johan> the qp-or-base64 choser function has been bogus in 0.9[56].  in
Johan> 0.96 it would choose quoted-printable for all long attachments.
Johan> since the chooser should now be fixed, these kinds of image
Johan> sent with quoted-printable problems should go away.

I hope people haven't been put off by the chooser bugs in 0.96; I
think that the principle is sound.  There have been two recent patches
to this, including one that eliminates the use of floating-point maths
in the calculation.


Johan> however, this doesn't mean we ought not fix quoted-printable in
Johan> the first place.

I have a concern about whether we do the Right Thing with newlines in
quoted-printable.  In text parts, newlines must also have carriage
returns; the q-p body will have CRs too, so newlines need not be
encoded.  In non-text parts, newlines must not (in general) have CRs
added - except those introduced by the QP-encoding.  So "foo\nbar" in
a non-text part should become "foo=0Abar" or "foo=0a=\nbar".

Do we canonicalise text EOLs before applying the encoding?  And do we
encode naked LFs?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-27 14:03       ` Toby Speight
@ 1999-09-27 17:59         ` Lars Magne Ingebrigtsen
  1999-09-27 18:26           ` Toby Speight
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-27 17:59 UTC (permalink / raw)


Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:

> I have a concern about whether we do the Right Thing with newlines in
> quoted-printable.  In text parts, newlines must also have carriage
> returns; the q-p body will have CRs too, so newlines need not be
> encoded.  In non-text parts, newlines must not (in general) have CRs
> added - except those introduced by the QP-encoding.  So "foo\nbar" in
> a non-text part should become "foo=0Abar" or "foo=0a=\nbar".

"foo\nbar" in a non-text part should become "foo\nbar", shouldn't it?
Canonicalization is only an issue with text parts.  Uhm.  I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-27 17:59         ` Lars Magne Ingebrigtsen
@ 1999-09-27 18:26           ` Toby Speight
  1999-09-27 18:43             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Toby Speight @ 1999-09-27 18:26 UTC (permalink / raw)


Lars> Lars Magne Ingebrigtsen <URL:mailto:larsi@gnus.org>

0> In article <m3905s5j84.fsf@quimbies.gnus.org>, Lars wrote:

Lars> Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:

>> I have a concern about whether we do the Right Thing with newlines in
>> quoted-printable.  In text parts, newlines must also have carriage
>> returns; the q-p body will have CRs too, so newlines need not be
>> encoded.  In non-text parts, newlines must not (in general) have CRs
>> added - except those introduced by the QP-encoding.  So "foo\nbar" in
>> a non-text part should become "foo=0Abar" or "foo=0a=\nbar".

Lars> "foo\nbar" in a non-text part should become "foo\nbar", shouldn't
Lars> it?  Canonicalization is only an issue with text parts.

Exactly - but AIUI, encoded body parts are canonicalised during SMTP,
just like unencoded text parts.  Correct me if I'm wrong, but the
"foo\nbar" above will be received as "foo\r\nbar" and the receiver
_may or may not_ convert that back to "foo\nbar" (depending on the
recipient's local conventions).  But if "foo=0a=\nbar" is
canonicalised to "foo=0a=\r\nbar", it still decodes to "foo\nbar",
since "=\r\n" is ignored (the same as "=\n").  Does that make any kind
of sense?

Perhaps this is a topic to bring up in comp.mail.mime?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GIF/jpeg attached as quoted-printable in MIME?
  1999-09-27 18:26           ` Toby Speight
@ 1999-09-27 18:43             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-27 18:43 UTC (permalink / raw)


Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:

> Exactly - but AIUI, encoded body parts are canonicalised during SMTP,
> just like unencoded text parts.  Correct me if I'm wrong, but the
> "foo\nbar" above will be received as "foo\r\nbar" and the receiver
> _may or may not_ convert that back to "foo\nbar" (depending on the
> recipient's local conventions).

Right.  For instance, Windows users won't convert from \r\n to \n.
Probably.  Uhm.  Well, they might, it the part is a non-text part...

> But if "foo=0a=\nbar" is canonicalised to "foo=0a=\r\nbar", it still
> decodes to "foo\nbar", since "=\r\n" is ignored (the same as "=\n").
> Does that make any kind of sense?

Yes, that makes sense.

> Perhaps this is a topic to bring up in comp.mail.mime?

Yup.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1999-09-27 18:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-08 21:24 GIF/jpeg attached as quoted-printable in MIME? Bjorn Halvor Solberg
1999-09-09  0:14 ` Bjorn Halvor Solberg
1999-09-25  8:40   ` Lars Magne Ingebrigtsen
1999-09-25 10:23     ` Kai Großjohann
1999-09-25 10:38       ` Lars Magne Ingebrigtsen
1999-09-26 21:46     ` Johan Kullstam
1999-09-27 14:03       ` Toby Speight
1999-09-27 17:59         ` Lars Magne Ingebrigtsen
1999-09-27 18:26           ` Toby Speight
1999-09-27 18:43             ` Lars Magne Ingebrigtsen

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