I just wanted to chime in here with what I went through today, in case anyone else searches through this thread with the same problem.
First off - my setup:
CentOS 4.7 VPS with WHM/cPanel
We’ll call the primary address for the VPS “vps.com”, and my store’s domain on the VPS “store.com”
The problem started when I began sending out test emails from Magento, for orders, registration, etc. All my messages were being marked as spam in Gmail, Yahoo, and Hotmail. No matter what email address Magento was sending from… Sales, Support, Info - it was all being delivered with a return path of email@example.com. I couldn’t understand why had a return path of .
First thing I did was set up SPF and domain keys for the store.com domain, which is a good idea to do anyway, but didn’t fix the spam problem.
Then I edited the Magento email template files to set a specified return path for all store email, but was still arriving with as the return path.
I found this in the forums and thought my prayers were answered:
Unfortunately, it says that this doesn’t work for VPS’s running cPanel. Great.
Then I find that I can remedy the problem by adding “-t ” to the sendmail_path declaration for PHP. But with my server setup, you can’t specify a unique sendmail_path per account, no matter what you try with the .htaccess or other site-specific config scripts - you can only have one global setting. So obviously I didn’t want to leave the “-t ” sendmail_path for all my domains, so was back to square one.
After too many frustrating hours, I tried the method listed two posts before mine…
In Magento 1.3.0, the app/code/core/Zend/Mime.php file does not need to be altered, it is already set to “\n”.
I pasted in the new getMail function (be sure to comment out the original one), and I did comment out the line: ‘ssl’ => ‘tls’,
Finally I commented out the two ini_set lines in the send function like it said to (which is a separate function that is elsewhere in the file).
I left everything else the same as it is on this thread, with the exception of entering the user name and password of email. With that one login, Magento is able to send to any of the other accounts set up for the store.
And at the end of all that… Hallelujah!
All mail sent has the proper return path of , and mail is going right to inbox, no more spam!
So, if anyone here is on a VPS with cPanel and is trying to figure out how to set a proper return path - don’t waste time futzing with custom sendmail_path settings, or Zend_Mail_Transport_Sendmail, or Zend_Mail::setDefaultTransport, or any of the other hacks you invariably found on your numerous google queries. This method works, and takes about 2 minutes.
UPDATE: Yahoo is still marking as spam, even though in the header, it says authentication passed. Oh well. Gmail and Hotmail (Live) go right to inbox. I’ll just try and add a “be sure to check your spam folder” notice in the email sent confirmation screens.