martes, 9 de julio de 2013

Blank email body on Exchange 2010

Hi people!

Today I would like to point out something that drove me crazy for over a week. A customer called us regarding some messages being generated from a server, let's call it SERVER1, and sent through smtp relay configured in Exchange, were being received with blank content (no email body). At first I though to myself... "Oh my god, here comes another end-user Outlook problem", but after I tried it myself, I saw that no matter what client you tried to open the message with, outlook, gmail, or any other web or installed client, all the emails sent from this server were completely blank.

I tested it myself with the following:

 220 internal.relay.domain.com Microsoft ESMTP MAIL Service ready at Tue, 9 Jul 20  
 13 13:05:46 +0200  
 helo mydomain.com  
 250 internal.relay.docout.es Hello [172.28.0.35]  
 mail from: testemail@relay.com  
 rcpt to: destination@domain.com  
 250 2.1.5 Recipient OK  
 data  
 354 Start mail input; end with <CRLF>.<CRLF>  
 to: destination@domain.com  
 from: testemail@relay.com  
 subject: subject from SERVER1  
 This is my content  
 .  
 250 2.6.0 <5cf64727-f4bf-44ca-a084-e4e4d432964b@SERVER1.domain.com> [Internal  
 Id=3365140] Queued mail for delivery  
 quit  
 221 2.0.0 Service closing transmission channel  

Sure enough, just as customer said, this mail was received with blank contents instead of the "this is my content" text.



I started looking around, Exchange config, the relay connector configuration, the firewall just in case it was blocking something, the local antivirus installed on server... these are usually the most common reasons for not receiving part of an email, but no results whatsoever.

Finally, after randomly testing, I found the problem. This is the final SMTP connection result:

 220 internal.relay.domain.com Microsoft ESMTP MAIL Service ready at Tue, 9 Jul 20  
 13 13:05:46 +0200  
 helo mydomain.com  
 250 internal.relay.docout.es Hello [172.28.0.35]  
 mail from: testemail@relay.com  
 rcpt to: destination@domain.com  
 250 2.1.5 Recipient OK  
 data  
 354 Start mail input; end with <CRLF>.<CRLF>  
 to: destination@domain.com  
 from: testemail@relay.com  
 subject: subject from SERVER1  

 This is my content  
 .  
 250 2.6.0 <5cf64727-f4bf-44ca-a084-e4e4d432964b@SERVER1.domain.com> [Internal  
 Id=3365140] Queued mail for delivery  
 quit  
 221 2.0.0 Service closing transmission channel  

If you don't look close enough, you won't probably even notice the difference between the 2 transmissions. The difference is no other than A BLANK LINE after the subject has been inserted.

Apparently, if you do not insert a blank line, depeding on what god you pray on, the system considers everything as a subject, but keeps on cutting the subject down to the firs line only, discarding the "real" contents/text.

Weird, if you ask me ;)

Nissy

EYQ5ARBJ72ZN

No hay comentarios:

Publicar un comentario en la entrada