<<< Date Index >>>     <<< Thread Index >>>

Re: utf8 file corruption after transmission over email



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Friday, May  8 at 03:00 PM, quoth Aaron S.:
> I have a mystery that I'm trying to solve to no avail.

Hopefully we can help!

> I got a little sample XML (utf-8) encoded file that I'm trying to 
> send as attachment. When I attach it, mutt correctly identifies it: 
> [text/plain, 8bit, utf-8, 0.3K], since there are non-ASCII 
> characters, in this case there is only 1 such character.

Well, actually, that's an incorrect identification. It's NOT a 
text/plain file, it's an xml file. According to RFC 3023, it should 
either be sent as application/xml or as text/xml.

Now, that misidentification shouldn't cause the problem you're having, 
but correcting it *probably* will fix the problem. I bet that if you 
add the following to your ~/.mime.types file, the problem goes away:

     application/xml     jff

> After I send it, this attached file becomes currupt.

I tried sending your file to myself, both with and without that line 
in my mime.types file, and the file didn't get corrupted either way.

My guess is that this is ACTUALLY your mail server's fault (did you 
send it through an MSFT Exchange server maybe? They're really bad 
about this). Here's what I think happened: you have configured mutt to 
send things in 8-bit mode (i.e. $allow_8bit). Thus, when sending a 
utf-8 file attachment with an unusual character in it, mutt sent it 
completely unmodified, because that's supposed to be safe to do when 
sending in 8-bit mode. But some servers (and I've had this happen more 
often than not with Exchange servers) attempt to convert all messages 
into 7-bit form. Unfortunately, they're often very bad at it. I've had 
several messages corrupted by Exchange servers simply because they 
couldn't handle curly-quotes correctly. It's happened often enough 
that I finally just unset allow_8bit so that mutt would always take 
care of encoding my messages in a 7-bit safe manner, because mutt is 
so much better at it than they are.

Anyway, does that help?

~Kyle
- -- 
Anyway, have fun.
And don't bother reporting any bugs for the next few days. I won't 
care anyway.
                            -- Linus Torvalds, when kernel 2.4 came out
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJKBLqJAAoJECuveozR/AWeBBQP/j1tOe19BTFKo/AN4gzcDhTS
72ug8j7pY3M75W7DJ33Bx3p6gafGEwaiHh6mePt/0L4YuHzGpZxhog9FmmzptJmG
1ROfdmkJ4DYH7zrXTHvLBufrp1I/hlAGqsogncrs+N/gLV6QNzJno3FnY9xkVbxe
DNm3MgkksZ1U9uMXyhrHsoJ+NQ01zuzP6BtEp1uVQKOHnluEd8jzyR9Dow5j5/8A
zp84PLMCvHn5UIQl1cf8qoUGFSfznBmK6xMgBDXCy/bghjwliGdPsy8n3Y0VhD6V
16vqx3qcTwoSbbTaQcyqY++v82TvQAz8izat23C1OWxWnYoAiy5lEjMv5FBh5UkO
dyDZKAWM4XmM05c1GexEcmhfvAHOQ2Il93hluKA7ZIFGeDfyz4Hl+dkeY7aSX2ek
6caHXz+jQnRz6hgBnwk1GcoTDwdmAdtU8XZYCjYHo+1BotMyKzMcE7c/483pj4Kb
dOpluhcPXsjnHKJK3wvRzT9lQqfGy4XFU6SuxXIH8TIxucAvlw+ZWrwUdpx1btIm
tH1ESVyIr4RoAm8viVl/OUdZ2apF8an9faxMwa80YBVGog9TxfoCy0jYOxs0g9YW
KLhPmaeeHaBaFpeha//MN8zcMxNknx7WsFvg2eL7XyMoUj3s2LhlWE6eQu0Luijc
3NWylNKI3jMswtfFtUyQ
=Hbvl
-----END PGP SIGNATURE-----