Article View: news.software.nntp
Article #46592Re: uuencoded text attachments rejected
From: Andrew Gierth
Date: Thu, 25 May 2000 00:00
Date: Thu, 25 May 2000 00:00
61 lines
3234 bytes
3234 bytes
>>>>> "Jeremy" == Jeremy <bofh@netscum.dk> writes:
> Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
>> input line in local format: "foo<CR>" (delimited by LF)
>> converted to canonical form: "foo<CR><CRLF>"
>> converted to QP: "foo=0D<CRLF>"
>>
>> and then converted back the same way. However, the canonical form is
>> illegal under the rules for text/plain, which require that CR not
>> occur except as part of a linebreak (always <CRLF> in canonical form).
Jeremy> But, thinking about this, is it really wrong? After encoding, there
Jeremy> is no bare CR in the text. Or is it prohibited even in encoded form?
It's prohibited in the _canonical_ form:
4.1.1. Representation of Line Breaks
The canonical form of any MIME "text" subtype MUST always represent a
line break as a CRLF sequence. Similarly, any occurrence of CRLF in
MIME "text" MUST represent a line break. Use of CR and LF outside of
line break sequences is also forbidden.
This rule applies regardless of format or character set or sets
involved.
All encodings of text/* types must convert to this canonical form
before applying the content-transfer-encoding.
For an example of why the above still doesn't work, consider that on a
platform that uses CRLF as the native delimiter the decoded text will
be:
"foo<CR><CR><LF>"
and on a platform that uses CR,
"foo<CR><CR>"
so the data has been mangled anyway in spite of the QP encoding.
You _can_ encode text with a specific line ending convention in QP,
you just have to do it as some media type other than text/*, and avoid
using hard line breaks in the encoding. For example, you could do
this:
Content-Type: multipart/mixed; boundary="cut-here--"
--cut-here--
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
this is text with MSDOS-type line endings that should be received=0D=0A=
intact by any conforming MIME implementation.=0D=0A
--cut-here----
This only works inside a compound MIME type such as multipart/mixed,
though, because of the need to omit the final line break in the
enclosed entity. (A QP-encoded entity can't end with a soft line
break.)
--
Andrew.
Technical Details
Message-ID:
<87em6qa27z.fsf@erlenstar.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<siojuuko150@corp.supernews.com> <87g0r7cszs.fsf@erlenstar.demon.co.uk> <959228508.237122@news.netscum.dk> <87vh03b5zt.fsf@erlenstar.demon.co.uk> <959273523.134004@news.netscum.dk>Show Full Headers
Complete Article Headers
Message-ID: <87em6qa27z.fsf@erlenstar.demon.co.uk> Subject: Re: uuencoded text attachments rejected Date: Thu, 25 May 2000 00:00:00 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> References: <siojuuko150@corp.supernews.com> <87g0r7cszs.fsf@erlenstar.demon.co.uk> <959228508.237122@news.netscum.dk> <87vh03b5zt.fsf@erlenstar.demon.co.uk> <959273523.134004@news.netscum.dk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 627276884 X-Mayan-Date: Long count = 12.19.7.4.5; tzolkin = 11 Chicchan; haab = 8 Zip X-Complaints-To: andrew@erlenstar.demon.co.uk Organization: disorganised X-Attribution: AG X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-P-Persistent-Headers: are a bad idea. Newsgroups: news.software.nntp X-Post-Filter: postfilter v0.6 alpha