Bobcares

The curious case of Google tagging all mails as spam

by | Aug 22, 2013

Gmail is one of the most reliable and reputable mail services. So it piqued our tech team when our billing division reported that Google seemed to think our server is a spam source.

We routinely keep track of all spam black lists, and were quite sure that the server reputation was not affected. The mails that were sent to other major providers like Yahoo, Hotmail, etc were not affected. Only Google was sending all our mails to the spam folder.

 

Hire Bobcares Linux Server Administrators
Get super reliable servers and delighted customers

See how we do it!

 

 

The email header analysis

OK. So, it could be because of the recent HTML changes in the invoice, right? We needed to test that, and sent a plain text mail to our Gmail account. It still landed in the spam box. Hmm..

It was time for a more methodical analysis of mail headers.

The mail heders as we saw it is shown below:

Google conversing in IPv6 with our SMTP server

Google conversing in IPv6 with our SMTP server

Google was recording the following two SPF related errors in the mail headers.

 

Received-SPF: softfail (google.com: domain of transitioning test@mydomain.com does not designate 2a01:c0:2:105:xxxx:xxxx:xxxx:xxxx as a permitted sender) client-ip=2a01:c0:2:105:xxxx:xxxx:xxxx:xxxx;

Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning test@mydomain.com does not designate 2a01:c0:2:105:xxxx:xxxx:xxxx:xxxx as a permitted sender) smtp.mail=test@mydomain.com

 

It meant that the IPv6 IP 2a01:c0:2:105:xxxx:xxxx:xxxx:xxxx was not present in the SPF record of mydomain.com, and therefore Google was interpreting our mails as un-authorized mails. So, it was clear that Google was communicating with our server in IPv6, and not IPv4.

The root cause identification

Hmm.. How did that happen?

We didnt purposefully enable IPv6 in our server. It was a CentOS server with cPanel installed in it. IPv6 support was not due in cPanel until version 11.40, which wont be considered stable for at least the next 2 months. We had enabled IPv6 in a few of our servers, but not on this server.

Discussions in Google product forums noted that Google responded in IPv6 communication only if the ISP initiated IPv6 communication first. So, it definitely looked like our server started it. After a bit of searching, found that Exim is now enabled with IPv6 and gave higher priority to IPv6 addresses if it is present. So, it seemed like Exim looked for an IPv6 address for Gmail SMTP servers, got one, and promptly initiated an IPv6 connection.

Solving our spam problem

cPanel forums suggested the use of disable_ipv6 directive to disable IPv6 in Exim, but that step seemed retrograde. So, we chose the better option of enabling IPv6 support in our SPF records, and updated it as below:

 

mydomain.com. TXT “v=spf1 +a +mx +ip4:xxx.xxx.xxx.xxx/29 +ip6:2a01:c0:2:105:xxxx:xxxx:xxxx:xxxx ~all”

 

A couple of test mails later, we confirmed that Google no more sees our mail as spam.

Our SMTP server was fully IPv6 ready!

 

 


About the author
is a senior software engineer at Bobcares. He has extensive experience in managing technical support teams of web hosting companies and data centers. He is passionate about systems engineering, and loves to get his hands dirty on systems automation. His free time is spent reading books and being with his family.


.call_me_back{
background-color:#ECF0F1;
border-style:solid;
border-color:#C2C2C2;
width:445px;
height:200px;
border-radius:3px;
margin-top:4%;
margin-left:5px;
text-align:left;
color:#666666;
border-width:1px;
padding-left:1%;
}
.call_us a{
color:#639F0B;
font-size:14px;
cursor:pointer;
text-align:center;
}
.call_us a:hover{
color:#FF7801;
}

.btn-shop {
margin-top: 0 !important;
background-color: #4AA11F;
color: #FFFFFF;
display: inline-block;
font-size: 18px;
font-weight: normal;
margin-left: 10px;
margin-top: 40px;
padding: 20px 50px;
text-transform: uppercase;
}

.btn-shop:hover {
background-color: #323C46;
}

0 Comments

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF