Subject: | Sending mails to hotmail.com with CR/LF line endings |
Hello,
Again I have some issues with Courriel :) Or... or with something
else... but follow the problem description:
SMTP protocol requires line endings with CRLF sequence. That's what
Courriel currently does. I never tried to change that and all my tests
were passed.
I tried to send emails (multipart, with attachments) generated by
Courriel on Linux machine with qmail to another Linux machine with
qmail, deliver into Maildir format and read with Thunderbird. Worked
like a charm.
Another set of tests generated emails (also multipart with attachments)
on the same Linux/qmail, delivered to Gmail. Again, no problems.
Then I sent few emails to our customers.. and there were few problems.
Customers with hotmail.com accounts received "empty emails" - they saw
no body text and attachment with size 0 bytes. I created account there
and confirmed this.
My current lame solution is:
my $data = $email->as_string;
$data =~ s/\r\n/\n/gs; # this fixed the hotmail.com delivery
send_email($recipient, $data);
After changing all CR/LF line endings in raw email data to LFs all my
emails to hotmail.com account are delivered correctly.
There are a few other servers with similar errors, not only hotmail.com.
I will try to investigate together with customers if possible.
ico
PS: I also tested mails from my Thunderbird/Linux. Every email uses LF
line endings. Don't have access to any Windows machines, will try to
send some emails from Outlook and compare. Now I am a bit confused with
this whole CR/LF thing...