php email goes to spam

Hi, I have been trying for quite some time now to get our emails to not end up in the spam folder of Yahoo, AOL, and hotmail.  I have had no problems with Google thus far.

I have added domain keys and dkim to the emails and they both pass with Yahoo.  I have added SPF to the domain and rdns.  I have verified that the content of the email works when sent through gmail.  Our IP is not on any blacklist.  I have compared email headers and not found anything majorly different between our emails and emails that make it to the inbox, save for this line in Yahoo: X-YahooFilteredBulk:

What am I missing?

I have attached the email header for your scrutiny.  Thanks in advance for your time

X-Apparently-To:        via; Thu, 01 Apr 2010 14:43:13 -0700
Return-Path:             <>
X-YMailISG:             somereallynicelongstring--
X-Originating-IP:             []
Authentication-Results:   ; domainkeys=pass (ok);; dkim=pass (ok)
Received:             from (EHLO ( by with SMTP; Thu, 01 Apr 2010 14:43:13 -0700
Received:             from (localhost []) by (8.13.8/8.13.8) with ESMTP id o31LhBT3029362 for <>; Thu, 1 Apr 2010 15:43:11 -0600
DKIM-Signature:             v=1; a=rsa-sha256; c=simple/simple;; s=dk; t=1270158191; bh=somestring=; h=Date:Message-Id:To:Subject:MIME-Version:Content-type:From: Reply-To; b=somenicelongstring=
DomainKey-Signature:             a=rsa-sha1; s=dk;; c=simple; q=dns; b=somenicelongstring=
Received:             (from root@localhost) by (8.13.8/8.13.8/Submit) id o31LhACr029361; Thu, 1 Apr 2010 15:43:10 -0600
Date:             Thu, 1 Apr 2010 15:43:10 -0600
Message-Id:             <>
To:             some one <>
Subject:             Welcome to yearbook
MIME-Version:             1.0
Content-type:             text/plain; charset=iso-8859-1
From:             This sender is DomainKeys verified
yearbook support team <>  
Add sender to Contacts
X-Mailer:             PHP's mail() Function
Content-Length:             460
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the idea of sending a mail as "root@localhost" is bound to create problems.

Received:             from (localhost []) by
Received:             (from root@localhost) by

Are you setting your domain name with something that yahoo is resolving to "localhost" /

johndupaixAuthor Commented:
rdns lookup resolves correctly, hostname on computer is same as rdns return.  

I have noticed root@localhost in header but am not quite sure how to get rid of it.
 My domain is

i think you are running the script as root.  can you run it as a simple user and set the sender properly (also pays to check your sendmail config file to enable MASQUERADE options properly).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

johndupaixAuthor Commented:
Thanks again for your input.

I ran as postmaster.
by "set the sender properly" I understand that to mean in the header to the php call which I have as:
'From: yearbook support team <>'.

My masquerade options are as follows


The header line that used to have root@localhost now looks like this:
Received:                 (from postmaster@localhost) by (8.13.8/8.13.8/Submit) id o35FoVho012991; Mon, 5 Apr 2010 09:50:31 -0600

Have I set my masquerade options wrong?

You need to tweak your /etc/hosts file. Make it look like this:  yeabook-app localhost.localdomain localhost

(make sure the real domain you want to use is first in the list of domains for the localhost address. You might have to restart sendmail when you make this change.
johndupaixAuthor Commented:
Awsome!!!!   That did it!!

I ran this after changing the hosts file
/etc/rc.d/init.d/network restart

Glad that worked for you...
johndupaixAuthor Commented:
Interestingly, the header line still looks like this:

Received:                 (from postmaster@localhost) by (8.13.8/8.13.8/Submit) id o36FspMI017919; Tue, 6 Apr 2010 09:54:51 -0600

Out of curiosity, I changed the hosts file back and my emails are still making it to the inbox.

Also of interest is that this morning I received an email from Yahoo saying our company was rejected for their bulk mail program.  (we are not a spam company, we just have lots of opted in users).

Here is everything I did to get email going to the inbox:

changed hosts file as described above.
added masquerading as described above.
changed sender as described above.
requested acceptance into yahoo bulk email program
added reverse dns entry for email server
added domain keys to email
added dkim to email
made sure email server was not an open relay

Our emails are making it to the inbox.  

Thanks to all for your assistance.
johndupaixAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.