Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A problem:

Email from my server comes like this:

Content-Type: text/plain; charset="UTF-8"

Content-Transfer-Encoding: base64



PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09

PT09IA0KZGV2IA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09

PT09PT09PT09PT09PT09IA0KICAgICAgICAgICAgICAgIA0KKioqIFRIQU5LIFlPVSBGT1IgWU9V
[...]

This is being displayed like this in Thunderbird, while when its displayed in say gmail it looks as it should.

Now, there are multiple servers with same code - and all emails send by all servers but this one are looking good in Thunderbird. This is a clone of same code but different server setup.

Server is Ubuntu 10.04LTS, using postfix, php 5... other than that pretty standard configuration.

What can be wrong?

share|improve this question
    
It looks that the e-mail is garbled, but apparently GMail checks for common screwups and can un-garble them (in other words, they take "be liberal in what you accept" one step further). –  Piskvor Jul 20 '11 at 11:40

1 Answer 1

up vote 5 down vote accepted

How is the PHP code distributed to your servers? From version control? By copying it from developers workstation? rsyncing it from master server?

What I'm thinking is that someone using Windows might have edited the PHP file generating the e-mails directly on that server, causing line feeds to be \r\n (DOS) instead of just \n (Unix). That might mess up the message headers in a way that some clients could still show your messages OK, but others would get confused.

share|improve this answer
    
We use version control. But even before we used it issue was the same - basically it was there always, since I first moved working code to that server. So my initial though was - something is different in server configuration but I am not sure where to look to be honest. –  RandomWhiteTrash Jul 20 '11 at 10:19
    
Mr Janne you are a star! Apparently whole class to handle emails was using \r\n and it was like this in every server, so it was always wrong and we were just lucky that it did work on other servers. Damn, previous development team should be strangled :). Thanks again! –  RandomWhiteTrash Jul 21 '11 at 7:16
    
I had a "pleasure" of debugging similar bug around six years ago. It was such hard thing to find that I will probably remember that one on my death bed. Great that this time my wild shot in the dark was bullseye! :D –  Janne Pikkarainen Jul 21 '11 at 8:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.