I spent hours last night tearing my hair out trying to fix a mystifying PHP problem.
My Irish music website, The Session, has a "forgotten your password?" feature. It’s a typical feature of a community website. If someone can’t recall their username or password, they simply have to enter their email address to have their details mailed to them.
In the case of The Session, they receive an email with the subject line "Your details from The Session" which contains the relevant log-on details.
At least, that’s what supposed to happen. I had an email from someone who attempted to do just that but they were still waiting for their email.
I tested the "forgotten your password?" feature and, sure enough, it wasn’t working. I started to pull my scripts apart to see if I could figure out what the problem was.
I was able to conclude fairly quickly that it wasn’t a fundamental problem with PHP interacting with sendmail: my contact page was still working just fine.
I tried reformulating my scripts. I tried googling for accounts of similar problems. I tried all the user-provided hints and tips on the PHP website.
Eventually, using the "-f" flag in the headers, I was able to have rejected mail routed to my own email account. That’s when I noticed something weird: all the password reminder emails were being flagged as containing a virus. Most odd.
Then it dawned on me: it was the subject line. By simply recognising the words "your details", some server-side spam filter was flagging all the emails as potential carriers of the MyDoom virus.
(This MyDoom virus must be making life really difficult for any system admins who might need to mail out server reports - they’ll need to start getting creative with their subject lines.)
After hours and hours spent hacking and coding, it turned out that the problem was ridiculously easy to fix. All I had to do was change the subject line to something more innocuous like "A reminder from The Session".