Re: DOS text file attachments.
- To: mutt-users@xxxxxxxx
- Subject: Re: DOS text file attachments.
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Thu, 7 Feb 2008 00:14:02 -0600
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date: from:to:subject:message-id:references:mime-version:content-type: in-reply-to; q=dns/txt; s=default; bh=8ykqYSEWLwadIx7GFaO3HORQR/ c=; b=er0+fo81Ub5U2LpDsftNacOSXQu5GMLYGPj310dPNvYnZOJyGVt/knDxyv uATIWmsoOVtoqm+4rM1y/kDMPl+Jy8hdWOHrDPq9Kiva4M/BTZqDLRIhzY7hgQ82 oMDV94+CunW80N4Ipw6oxCKIUcq8rABn4AG862LJVyDh7xkXw=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=eI27bvMwxiEL/YJO8Y1bLHXN1C7ybo1+9/FR7tGd9G7Ao9HnL2KuYsM9lkcxQA9BAErQG4Tqm5hxW1TWYuCPrYf3OtEqr6sNpgsvg+TdXOOJ2Y+UfMFJyaR0ofsnL3QVnSUsFWLbbTIuGC6Y4xhx9Cqz7MgKz7eGACNhgTSXU1g=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent;
- In-reply-to: <20080207000158.GD2686@xxxxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- References: <20080207000158.GD2686@xxxxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.17 (2008-01-14)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday, February 7 at 12:01 AM, quoth scott.mutt@xxxxxxxxxxxxxx:
> I think the point that the people on the Postfix mailing list were trying
> to make is that the MUA (in this case mutt) should not be sending
> something to the MTA that is marked as text/plain, but has CRLF line
> endings since text/plain on Unix has just LF line endings.
Mmmm, I would put it slightly differently, because it depends on who
should be responsible for MIME encoding: the MTA or the MUA.
Each platform has it's own line-ending standard for "plain old text
files". On the other hand, "text/plain" has a very specific
line-ending meaning in the context of MIME encoding. As specified in
RFC 2046, section 4.1.1:
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.
It seems clear, then, that in sending a MIME-encoded object, labeled
"text/plain", with the wrong line endings, someone is at fault. The
line endings CANNOT be preserved if the file is to be sent encoded as
a MIME text/* object.
But, and here's the trick: it *WAS* correctly formatted. It's just
that ordinarily, things are *NOT* correctly formatted. The MTA world
has gotten so used to converting line endings on behalf of the user
that the MUA world now rarely considers line-endings to be a problem
they need to address (unless the MUA will be speaking SMTP directly).
So who is wrong? Is mutt wrong for being inconsistent: handing
incorrectly encoded text to the MTA most of the time but correctly
encoded text some of the time? Or is the MTA wrong for being lazy and
assuming that the MUA *always* sends incorrectly encoded text? In the
end, I don't think it matters.
What if the file had been left as-is, and the line endings had been
recognized as not needing conversion? The receiver would receive a
correctly encoded text/plain attachment, and when saving that
attachment to disk, his MUA would convert the line endings to whatever
the native scheme happened to be. There would be no extra lines, BUT
the file's status as a "DOS text" file would vanish the instant the
"DOS" was dropped from the label---there's no such thing as
"dostext/plain", after all.
In the end, I think it all comes down to expectations. Mutt deals in
text files, and expects that all files labeled as text files will be
"native" text files (for the obvious reason that this is almost always
a correct assumption). Text is a special-case MIME category: it is a
category that indicates that line-ending preservation is unimportant
and may be converted to whatever is most convenient. This is
relatively easy to work around with proper labeling: the goal is
simply to avoid labeling the file as something whose line-endings can
change as necessary (in other words: *any* non-text label will work).
For example, one could add a line to the mime.types file like this:
application/dostxt dostxt
Then all files ending in ".dostxt" will be safely base64 encoded
before being sent. The file's line endings would be preserved, and all
the recipient would have to do is decode the base64 encoding and
rename the file back to ending in ".txt".
Unfortunately, there is no way to tell mutt that the ".txt" ending is
ambiguous and files ending in ".txt" need to be handled two different
ways depending on whether they're *native* text or weirdly-encoded
text.
> Maybe I just tell mutt to use a shell script as the MTA and I get
> that to convert all text to LF line endings then pass it on to the
> real MTA. Would that work ?
That would assure that the DOS file was correctly encoded as a
text/plain attachment, yes. However, it would also make it impossible
to identify as a DOS-text file on the recipient's end. It would appear
as a DOS-text file on a Windows system, and as a Unix-text file on a
Unix system, and as a Mac-text file on a Mac.
So it depends on what problem you're trying to solve: if you're trying
to send a DOS-file, intact, through email, this is a bad idea. If
you're trying to send a recipient-dependent text file, no matter what
format it's saved in on your own system, then this would work
perfectly.
At that point, though, I'd question why on earth you were dealing in
DOS files on your Unix box. :)
> I assume all data from mutt to the MTA will be text ? i.e. already
> be base64 encoded if needs be ?
Yes.
Does that help?
~Kyle
- --
If I were you, I'd run!
- -- Mesh-Head
If you were me, you'd be
good-looking.
- -- the Six-String Samurai
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFHqqGqBkIOoMqOI14RAmcvAKCVXhBQgCRduyQdGLuToFBqmJxMIACfZc+q
SgQrTqfWZB7RUzZJsDbTY50=
=5W9G
-----END PGP SIGNATURE-----