Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I configured postfix on snow leopard by adding the following line to /etc/hostconfig:


I then configured postfix to relay through my ISP's SMTP server. I added the following two lines in their respective places within /etc/postfix/

myhostname =
relayhost =

I then have a simple PHP mail function wrapper as follows:

send_email("", "", "Test Email", "<p>This is a simple HTML email</p>");
echo "Done";

function send_email($from,$to,$subject,$message){
 $header="From: <".$from.">
 $header.= 'MIME-Version: 1.0' . "
 $header.= 'Content-type: text/html; charset=iso-8859-1' . "
 if(!$send_mail){ echo "ERROR"; }

With this, I am receiving an e-mail that appears to be improperly formatted. The message header is showing up in the body of the e-mail. The raw message content is as follows:

Return-Path: <>
Delivery-Date: Tue, 27 Apr 2010 18:12:48 -0400
Received: from ( [])
 by (node=mxus2) with ESMTP (Nemesis)
 id 0M4XlU-1NCtC81GVY-00z5UN for; Tue, 27 Apr 2010 18:12:48 -0400
Message-Id: <7vpiof$>
Received: from ([])
  by with ESMTP; 27 Apr 2010 16:12:47 -0600
X-Cloudmark-SP-Filtered: true
X-Cloudmark-SP-Result: v=1.0 c=1 a=VphdPIyG4kEA:10 a=hATtCjKilyj9ZF5m5A62ag==:17 a=mC_jT1gcAAAA:8
 a=QLyc3QejAAAA:8 a=DGW4GvdtALggLTu6w9AA:9 a=KbDtEDGyCi7QHcNhDYYwsF92SU8A:4
 a=uch7kV7NfGgA:10 a=5ZEL1eDBWGAA:10
Received: from unknown (HELO ([])
  by with ESMTP; 27 Apr 2010 16:12:48 -0600
Received: by (Postfix, from userid 70)
 id BB08D14ECFC; Tue, 27 Apr 2010 15:12:47 -0700 (PDT)
Subject: Test Email
X-PHP-Originating-Script: 501:test.php
Date: Tue, 27 Apr 2010 18:12:48 -0400
X-UI-Junk: AutoMaybeJunk +30 (SPA);

From: <>
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
Message-Id: <>
Date: Tue, 27 Apr 2010 15:12:47 -0700 (PDT)

<p>This is a simple HTML email</p>

And here are the contents of my /var/log/mail.log file after sending the email:

Apr 27 15:29:01 User-iMac postfix/qmgr[705]: 74B1514EDDF: removed
Apr 27 15:29:30 User-iMac postfix/pickup[704]: 25FBC14EDF0: uid=70 from=<_www>
Apr 27 15:29:30 User-iMac postfix/master[758]: fatal: open lock file pid/ unable to set exclusive lock: Resource temporarily unavailable
Apr 27 15:29:30 User-iMac postfix/cleanup[745]: 25FBC14EDF0: message-id=<>
Apr 27 15:29:30 User-iMac postfix/qmgr[705]: 25FBC14EDF0: from=<>, size=423, nrcpt=1 (queue active)
Apr 27 15:29:30 User-iMac postfix/smtp[747]: 25FBC14EDF0: to=<>,[]:25, delay=0.21, delays=0.01/0/0.1/0.1, dsn=2.0.0, status=sent (250 ok:  Message 25784419 accepted)
Apr 27 15:29:30 User-iMac postfix/qmgr[705]: 25FBC14EDF0: removed

Two other people in the office have followed the exact same process and are running the exact same script, version of snow leopard, php, etc. and everything is working fine for them. I've even copied their config files to my machine, restarted postfix, restarted apache, all to no avail.

Does anyone know what steps I could take to resolve the issue? This is boggling my mind...


share|improve this question
I was able to fix by removing the line mail.add_x_header = On. Apparently there is a bug with the mail header in PHP 5.3 =/ – devvy Apr 27 '10 at 23:28
up vote 0 down vote accepted

Yes, as taspeotis mentioned, I fixed it by removing the line "mail.add_x_header = On" from my php.ini

I'll see if I can mark this as the answer.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .