The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'E-mail Discussions' started by gruz, Aug 24, 2013.

  1. gruz

    gruz Registered

    Joined:
    Mar 12, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    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 myusername@gmail.com 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:
    
      someusername@gmail.com
        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: <myusername@gmail.com>
    Received: from username by cpanel.domain.com with local (Exim 4.80.1)
    	(envelope-from <myusername@gmail.com>)
    	id 1VCyBT-0006JO-OI
    	for someusername@gmail.com; Fri, 23 Aug 2013 14:42:16 -0600
    To: someusername@gmail.com
    Subject: Alberta Tactical Rifle Supply :: Email
    Date: Fri, 23 Aug 2013 14:42:15 -0600
    From: Some Title Here <myusername@gmail.com>
    Message-ID: <3ba5ae0d6edd674872f7ff94d3accd88@anotherhostname.domain.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=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 />yetanotherusername@gmail.com<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 username@cpanel.domain.com. The mail was delivered to my gmail account, but to a spam folder.

    Code:
                                                       
    Delivered-To: someusername@gmail.com
    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: <username@cpanel.domain.com>
    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 username@cpanel.domain.com 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 username@cpanel.domain.com designates 198.199.x.xx as permitted sender) smtp.mail=username@cpanel.domain.com
    Received: from username by cpanel.domain.com with local (Exim 4.80.1)
    	(envelope-from <username@cpanel.domain.com>)
    	id 1VDEdd-0006vR-Ih
    	for someusername@gmail.com; Sat, 24 Aug 2013 08:16:25 -0600
    To: someusername@gmail.com
    Subject: some title here :: Email
    Date: Sat, 24 Aug 2013 08:16:25 -0600
    From: some title here <username@cpanel.domain.com>
    Message-ID: <0e24999d5b8906874560cf719b1862ad@albertatacticalrifle.remotelyyours.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 />someusername@gmail.com<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.
     
    #1 gruz, Aug 24, 2013
    Last edited by a moderator: Aug 25, 2013
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    It's not that those emails are treated as spam, but your IP is blocked by gmail:
    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.
     
  3. gruz

    gruz Registered

    Joined:
    Mar 12, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    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.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page