Today's Lesson

Purdy on 2004-06-29T13:33:27

I was sending out some e-mails through a program and when I received it in Thunderbird, one of the lines had a ">" at the front. I went through several layers of trying to figure out what was going on, including changing code, outputting the MIME::Lite object to a filestream and doing an od -c through it and more.

Finally, I was just about to ask on Perlmonks and I thought, why not change the copy itself ... so I went through several variations and I figured out that if the line starts with "From" (the line originally read "From here, you can ..."), either the mail server or my mail client (my co-worker's Outlook would do the same, so methinks Postfix is doing this) are tweaking the message copy so that the line that starts with "From ..." doesn't interfere with the message header.

Interesting... in this case, I just changed the copy and moved on, but what if I REALLY wanted to start the line with From?

Jason


mbox ickiness

vsergu on 2004-06-29T15:41:43

It's a problem with the mbox format. Different programs seem to do the escaping and unescaping of "From " lines in the body in incompatible ways, so there's no guarantee you won't get stray greater-thans. Sometimes I rewrite or rewrap my message to avoid "From " at the start of a line. (Note that this has nothing to do with the "From:" header.)

Re:

Aristotle on 2004-12-17T22:26:41

There's a trivial solution: just encode the character. mutt does this, f.ex.

perl -MMIME::QuotedPrint -le'print decode_qp "=46rom"'