Forums / General Questions / Email from (phpmail) marked as spam

Email from (phpmail) marked as spam

Views: 2,356

Results 1 to 9 of 9
3 Dec 2015, 3:25 AM
#1
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Email from (phpmail) marked as spam

Note: On creating this post in the Zen Cart forum, clicking Preview completely erased the post so I had to start again. Argh.


Recently "order confirmation email" sent from Zen Cart began getting marked as spam. In the email headers I note two new spam score entries.

XPRIO ("Has X-Priority header")
KAM_ASCII_DIVIDERS ("Spam that uses ascii formatting tricks")

I assume I can edit phpmail library code so the XPRIO header is not added to email sent from Zen Cart. And that I can alter the formatting of email sent from Zen Cart to avoid the KAM_ASCII_DIVIDERS score.

I was not aware of this issue until after upgrading to ZC 1.54

Any recommends?

Note the store is configured to sent only TEXT formatted email.

Thanks.

3 Dec 2015, 9:21 AM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Email from (phpmail) marked as spam

Woodymon:

.....

Recently "order confirmation email" sent from Zen Cart began getting marked as spam. In the email headers I note two new spam score entries....

Two questions:

How did you find out that your order confirmation emails are marked as spam - from clients or from a copy which you receive?

Is your site on a shared server?

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Dec 2015, 5:22 PM
#3
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Email from (phpmail) marked as spam

frank18:

Two questions:

How did you find out that your order confirmation emails are marked as spam - from clients or from a copy which you receive?

Is your site on a shared server?

Thanks. The two score entries show up in order confirmation email spam score headers in email messages Zen Cart sends to both the customer and in the copy sent to the store.

I want to be able to edit the stores outgoing emails to prevent the inclusion of those two email (meta) headers. I suspect in a phpmailer class file built into Zen Cart generates the X-Priority entry (which is completely unnecessary). This is the primary issue I wish to resolve.

As to the secondary issue, possibly some CSS responsible for the layout of the outgoing email messages, generates the KAM_ASCII_DIVIDERS score

I was hoping someone here may have observed/dealt with the same issues. I may have to contact the phpmailer developer to figure this out.

3 Dec 2015, 5:29 PM
#4
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Email from (phpmail) marked as spam

Also, looking at file modify dates for the ZC 1.54 files in the online shop, I notice /includes/classes/class.phpmailer.php has a recent date of Aug 31, 2015. Whereas most the other files show Dec 24, 2014.

I don't recall modifying that file. I try to be diligent in documenting the patches I install. Was a patch for that file released by the ZC developers, that may have updated that file, and I forgot to document the patch install?

Comments in the file header show PHPMailer Version: 5.2.6

I'll do a compare with the core 1.54 version to see what's diff.

3 Dec 2015, 6:26 PM
#5
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Email from (phpmail) marked as spam

Below is relevant code from phpmailer 5.2.6 in ZenCart 1.54 class.phpmailer.php

Any recommends on the best way to keep X-Priority from being included in the sent email header?

ln 54

public $Priority          = 3;

ln 1438-1446

    $result .= $this->HeaderLine('X-Priority', $this->Priority);
    if ($this->XMailer == '') {
        $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (https://github.com/PHPMailer/PHPMailer/)');
    } else {
      $myXmailer = trim($this->XMailer);
      if ($myXmailer) {
        $result .= $this->HeaderLine('X-Mailer', $myXmailer);
      }
    }
3 Dec 2015, 6:31 PM
#6
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Email from (phpmail) marked as spam

You may wish to upgrade to a newer version of PHPMailer. As of Jun 29, 2015, releases of PHPMailer no longer set the "X-Priority" header by default. This change appears to have been made to appease a rule sometimes enabled in SpamAssasin.

If you wish to manually patch PHPMailer instead of upgrading to a newer version, take a peek at the committed patch to PHPMailer.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

3 Dec 2015, 7:24 PM
#7
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Email from (phpmail) marked as spam

lhungil:

You may wish to upgrade to a newer version of PHPMailer. As of Jun 29, 2015, releases of PHPMailer no longer set the "X-Priority" header by default. This change appears to have been made to appease a rule sometimes enabled in SpamAssasin.

Right on, lhungil. As always you are the man ;-)

I searched through the github issues but didn't find anything that applied. Thanks for the recommends.

So to upgrade the phpmailer in Zen Cart 1.54, do I just copy the latest version 5.2.14 class.phpmailer.php (from github) to /includes/classes/class.phpmailer.php ?

Do I need to copy any other phpmailer github files over? (e.g. class.smtp.php) or make other changes to Zen Cart?

Thanks.

3 Dec 2015, 10:01 PM
#8
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Email from (phpmail) marked as spam

FYI, I just copied the updated class.phpmailer.php file over to /includes/classes/ and ran a few tests on the shop and the issue appears resolved. Thanks again.

30 Dec 2015, 10:57 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Email from (phpmail) marked as spam

FYI, ZC v1.5.5 will contain the phpMailer 5.2.14 code

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.