[BUGS] Why is my mail being horribly newlined?

Andrew Reilly areilly at bigpond.net.au
Fri Dec 14 09:31:54 EST 2007


On Fri, Dec 14, 2007 at 06:29:04AM +1100, Jerahmy Pocott wrote:
> On 13/12/2007, at 10:54 PM, Callum Gibson wrote:
> 
> > You appear to be using Apple Mail. Are you entering any newlines
> > when you type such as in the paragraph below? ie. did you press Enter
> > after "manager,", "tools", "system"? Or are you just letting Apple  
> > Mail
> > auto-wrap it for you in the compose new message window?
> 
> Yes, I put my own end of lines after those words.

Don't do that in Apple Mail.  Only use a newline at the end of a
paragraph.

> My thoughts are that
> it's either the text encoding used (apple likes UTF-8) or the newline
> character, traditionally Macs used <CR> though I'm fairly sure the
> default is now the unix <LF>, unless it's trying to be windows friendly
> and placing <CR>/<LF>..

No, that's a red herring.  Apple Mail (really Mail.app) is a
NeXT Step application, warmed-over for an Aqua look.  So it's
fully Unix on the inside, but even that is a red herring,
because SMTP mail has explicit things to say about line
terminations (they must be CR+LF, just like most internet
protocols), and you can be fairly certain that whatever is used
in the internal representation is being translated into that
form for sending.

> I don't believe the mail client enforces any wrapping..
> 
> I thought maybe it was the mail server doing it..

What I suspect is happening is that the mail server is very
probably doing a spot of header re-writing and filtering,
probably to ensure that messages are plain ascii, not HTML
or RTF.  Mail.app manages to comply with the 75-character
standard for text messages, while also giving the composition
window the appearance of a continuously-flowed (i.e., the
paragraph will stretch out if you resize your composition
window) by giving the message a MIME Content-Type tag of
"text/plain;format=flowed" or something like that.  When
Mail.app receives a message like that, it automatically turns
it back into fully-flowed paragraphs, so you can't see that
it's happening if you only ever use Mail.app.  Unfortunately,
Mail.app is the only application that I've ever encountered
that knows about "text/flowed", so they'll see plain text with
the default wrapping at 75 columns, which is normally OK *if*
you composed the message in the "flowed paragraph" way that
people normally do.  Inserting extra explicit carriage returns
the way you have is a recipe for disaster or at least ugliness.
The reason that I suspect the list server of mangling MIME
information out of the header is that now *you* can see both
the newlines that you inserted *and* the "flowed" newlines that
Mail.app added.

Cheers,

-- 
Andrew


More information about the BUGS mailing list