Mails sent from Joomla are teated as spam by Gmail. How to setup WHM mail for Joomla?

gruz

Registered
Mar 12, 2013
3
0
1
cPanel Access Level
Website Owner
Here is what I have:
CENTOS 6.4 x86_64 vmware – cpanel WHM 11.38.2 (build 3)
And 2-3 dozens of joomla installations.

Domain: domain.com
WHM account I use for tests: albertat

My joomla global configuration was set up to use [email protected] as sender. Recently it stopped working saying something like this:
Code:
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [email protected]
    SMTP error from remote mail server after end of data:
    host gmail-smtp-in.l.google.com [74.125.25.26]:
    550-5.7.1 [198.199.7.80       1] Our system has detected an unusual rate of
    550-5.7.1 unsolicited mail originating from your IP address. To protect our
    550-5.7.1 users from spam, mail sent from your IP address has been blocked.
    550-5.7.1 Please visit http://www.google.com/mail/help/bulk_mail.html to review
    550 5.7.1 our Bulk Email Senders Guidelines. vs3si1352209pab.346 - gsmtp

------ This is a copy of the message, including all the headers. ------

Return-path: <[email protected]>
Received: from username by cpanel.domain.com with local (Exim 4.80.1)
	(envelope-from <[email protected]>)
	id 1VCyBT-0006JO-OI
	for [email protected]; Fri, 23 Aug 2013 14:42:16 -0600
To: [email protected]
Subject: Alberta Tactical Rifle Supply :: Email
Date: Fri, 23 Aug 2013 14:42:15 -0600
From: Some Title Here <[email protected]>
Message-ID: <[email protected]>
X-Priority: 3
X-Mailer: PHPMailer 5.2.6 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
X-OutGoing-Spam-Status: No, score=3.9

Email from name removed <br />Message:<br />===================================<br /><br />id:<br />10<br /><br />date time:<br /><a data-list="list_1_com_fabrik_1" class="fabrik___rowlink fabrik_edit" href="/index.php/custom-rifle-build-sheet/form/1/">2013-08-23</a><br /><br />What are you building:<br />Precision rifle<br /><br />Calibre:<br />223<br /><br />Stock:<br />McMillan::http://www.domain.com/mcmillan-stocks.php<br /><br />Specify model:<br /> - <br /><br />Barrel:<br /> - <br /><br />Manufacturer:<br />Lilja::http://www.domain.com/<br /><br />Twist rate:<br /> - <br /><br />Contour:<br /> - <br /><br />Length:<br /> - <br /><br />Muzzle brake:<br />ATRS Gill brake<br /><br />Trigger:<br />Jewel<br /><br />Action:<br />Infidel<br /><br />Bottom Metal:<br />HS precision<br /><br />Scope mount/rail:<br />0MOA<br /><br />Scope rings:<br />TPS<br /><br />If Nightforce scope ring selected:<br />Ultralight<br /><br />Scope:<br />Nightforce::http://domain.com/<br /><br />Specify Model:<br /> - <br /><br />Finish coating:<br />Stock<br /><br />Contact info:<br /> - <br /><br />Email address:<br />[email protected]<br /><br />Name:<br /> - <br /><br />Phone:<br /> - <br /><br />
I investigated the problem and found out that Gmail is right. My server pretend to send emails "as if from gmail". So they are blocked by gmail.

I noticed, then the email headers this line:
Received: from username by cpanel.domain.com with local (Exim 4.80.1)

cpanel.domain - is my WHM domain name.

I tried to set the sender name in Joomla global configuration to [email protected]. The mail was delivered to my gmail account, but to a spam folder.

Code:
Delivered-To: [email protected]
Received: by 10.220.57.196 with SMTP id d4csp143820vch;
        Sat, 24 Aug 2013 07:16:28 -0700 (PDT)
X-Received: by 10.68.228.102 with SMTP id sh6mr5284040pbc.138.1377353787928;
        Sat, 24 Aug 2013 07:16:27 -0700 (PDT)
Return-Path: <[email protected]>
Received: from cpanel.domain.com (cpanel.domain.com. [198.199.xx.xx])
        by mx.google.com with ESMTPS id rt3si3319620pbc.173.1969.12.31.16.00.00
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Sat, 24 Aug 2013 07:16:27 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of [email protected] designates 198.199.x.xx as permitted sender) client-ip=198.199.x.xx;
Authentication-Results: mx.google.com;
       spf=pass (google.com: best guess record for domain of [email protected] designates 198.199.x.xx as permitted sender) [email protected]
Received: from username by cpanel.domain.com with local (Exim 4.80.1)
	(envelope-from <[email protected]>)
	id 1VDEdd-0006vR-Ih
	for [email protected]; Sat, 24 Aug 2013 08:16:25 -0600
To: [email protected]
Subject: some title here :: Email
Date: Sat, 24 Aug 2013 08:16:25 -0600
From: some title here <[email protected]>
Message-ID: <[email protected]urs.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.6 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
X-OutGoing-Spam-Status: No, score=1.7
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - cpanel.domain.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [573 32007] / [47 12]
X-AntiAbuse: Sender Address Domain - cpanel.domain.com
X-Get-Message-Sender-Via: cpanel.domain.com: authenticated_id: albertat/primary_hostname/system user
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php /home/username/public_html/index.php 
X-Source-Dir: domain.com:/public_html

Email from Some Title Here<br />Message:<br />===================================<br /><br />id:<br />21<br /><br />date time:<br /><a data-list="list_1_com_fabrik_1" class="fabrik___rowlink fabrik_edit" href="/index.php/custom-rifle-build-sheet/form/1/">2013-08-24</a><br /><br />What are you building:<br />Precision rifle<br /><br />Calibre:<br />223<br /><br />Stock:<br />McMillan::http://www.domain.com/mcmillan-stocks.php<br /><br />Specify model:<br /> - <br /><br />Barrel:<br /> - <br /><br />Manufacturer:<br />Lilja::http://www.domain.com/<br /><br />Twist rate:<br /> - <br /><br />Contour:<br /> - <br /><br />Length:<br /> - <br /><br />Muzzle brake:<br />ATRS Gill brake<br /><br />Trigger:<br />Jewel<br /><br />Action:<br />Infidel<br /><br />Bottom Metal:<br />HS precision<br /><br />Scope mount/rail:<br />0MOA<br /><br />Scope rings:<br />TPS<br /><br />If Nightforce scope ring selected:<br />Ultralight<br /><br />Scope:<br />Nightforce::http://domain.com/<br /><br />Specify Model:<br /> - <br /><br />Finish coating:<br />Stock<br /><br />Contact info:<br /> - <br /><br />Email address:<br />[email protected]<br /><br />Name:<br />Der Grosse Maus Test<br /><br />Phone:<br /> - <br /><br />
As far as I can judge, the reason why the email is delivered to spam is
X-OutGoing-Spam-Status: No, score=1.7

But why do I have that score? Is this something connected to the email headers?

What I have doubts about is the SPF record I have:
v=spf1 a mx include:smtp.secureserver.net ~all

/http://view.xscreenshot.com/96ae24fb5920367b5c3140b949126b28

I have doubts because the sender domain is cpanel.domain.com, while the SPF record belongs to domain.com

How should I setup WHM to make my Joomla send totally legal mails?

Thanks in advance.
 
Last edited by a moderator:

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
It's not that those emails are treated as spam, but your IP is blocked by gmail:
Our system has detected an unusual rate of unsolicited mail originating from your IP address. To protect our users from spam, mail sent from your IP address has been blocked.
Whatever settings you change in your server or in Joomla installations do not change the fact that your IP is blocked.
My advice is:
1. change the IP your server is sending emails from.
2. find out why it got blocked.
3. and after that, get the original IP unblocked.
 

gruz

Registered
Mar 12, 2013
3
0
1
cPanel Access Level
Website Owner
I think you have not read my post carefully.

In one case it's blocked. I changed the sender email and it's not blocked but placed to a spam folder.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello :)

It's possible that Google detects the message as SPAM due to the nature of how it's sent from a PHP script. I recommend sending a test email to Google from an email client to see if you experience the same behavior. Beyond configuring RDNS and adding a SPF record, you may also want to try having Joomla use SMTP authentication for email purposes if that is not already configured.

Thank you.