2009-08-24

Bare linefeeds in SMTP Messages, status 451

I was having a problem with mails that were not being sent as they were supposed to be, and the problem could be caused by the use of bare linefeeds in the message body.

A bare linefeed is a linefeed that has only a linefeed (LF = “\n” in C#/C++/Java, ASCII code 10 decimal) and no carriage return (CR = “\r”, ASCII code 13 decimal).

Internet e-mail standards forbid the use of bare linefeeds, and some mailservers will reject a mail using bare linefeeds, with the status 451 (other mailservers wil accept them and just correct the mistake itself).

In stead of using bare linefeeds, a linefeed should always come with a carriage return (CR + LF = “\r\n”).

Read the full story at http://www.dylanbeattie.net/docs/iis6_bare_linefeed.html.