I have been struggling with an email issue and I believe I've tracked it back to the Mime Mail module, but I'm stuck. Please review and advise. I've included plenty of debug info, but you'll hopefully get the gist of it with these first few paragraphs....
I have a number of emails bouncing with the message "Remote host said: 501 Malformed MAIL FROM: - psmtp". Upon checking the logs and sources of test messages, I found that when Mime Mail is installed, a space is injected at the beginning of the sender's email address. My test procedure is below.
The following little script was run (from the Devel execute PHP block) on a Drupal 5.7 site with Mime Mail installed. It simply sends a message using PHP's core mail() function and then an identical message using the drupal_mail() function. The $from address is the same address stored as variable site_mail. The two recipient addresses are aliases to the same account on another server. I used different ones to help me distinguish the two messages in the qmail log.
[Long string of headers removed ... see comment below for solution.]
Comments
Comment #1
gnosis commentedFixed. I finally tracked this problem to a bug in a patch that I was unaware had been applied to mimemail.module.
See http://drupal.org/node/261028 for solution and updated patch. As mentioned in that thread, the patch is not generally recommended, but may be useful for some.
Comment #1.0
gnosis commentedRemoving a bunch of headers from report; they weren't helping anything and had some email addresses in them.