I've moved to a new webhost and seeing some strange behavior. When i call php's mail() function to send some mail, i see a 'Message-Id:' followed by a 'Date:' in the body of the mail message. I'm using gmail to read it. The from email address is a noreply@mydomain.com. The body looks like this:Message-Id: <20080121054007.17BF1890E@mydomain.com>Date: Mon, 21 Jan 2008 00:40:07 -0500 (EST)Why is this happening, and how can i remove it??thx
1/21/2008 12:47:50 AM
Are you using a free host? Seems shitty, but maybe your host set up their mail server to add that automatically. Probably as a way to deter people from using their mail servers to send fraudulent type spam stuff.
1/21/2008 1:15:38 AM
nope not free server. Its a vps so im setting everything up. Im using ubuntu server. I installed postfix, changed my hostname (/etc/hostname) changed my php.ini with the sendmail string (I dont have access to box right now otherwise id include the string i used). I then restarted postfix.any ideas?
1/21/2008 12:02:35 PM
Huh. I recently had a problem appear where the mailTo string read:email1@domain1.com, email2@domain2.com, etc., etc.In the past it always worked, then all of a sudden it started including the space as part of the e-mail address. So the above line translated to:
email1@domain1.com%20email2@domain2.com%20etc.%20etc.
1/21/2008 12:16:41 PM
Can you paste all of the headers?
1/21/2008 12:23:11 PM
Are you setting a From: header?
1/21/2008 12:25:35 PM
Yes I'm setting a from header. I'll paste my mail() call and the message it generates when i get home tonight.
1/21/2008 12:35:38 PM
php.ini:sendmail_path = /usr/sbin/sendmail -i -t$headers = 'From: no-reply@sharednotebook.com' . "\r\n";mail($to, $subject, $message, $headers);resulting email:from no-reply@sharednotebook.comto myemail@my.comdate Jan 21, 2008 4:44 PMsubject my subject Message-Id: <20080121224438.0CE81890E@sharednotebook.com>Date: Mon, 21 Jan 2008 17:44:37 -0500 (EST)rest of body
1/21/2008 5:50:32 PM
^ i have the same sendmail path (except that the switches are reversed). i had just sent myself a test email from my web server a few days ago, so i looked it up and saw that it did NOT have the Message-Id in the body, but it WAS in the "original" view in the header. here is an excerpt from that email, with private info removed of course.
1/21/2008 6:26:16 PM
I figured it out. I had an extra "\r\n" at the end.
1/21/2008 6:39:11 PM