A problem:

Email from my server comes like this:

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

Content-Transfer-Encoding: base64




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?

  • 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 left the building Jul 20 '11 at 11:40

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.

| 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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