Yenya's World

Wed, 07 May 2014

GMail Spam Filter

Apparently, GMail spam filter got too zealous. I have my own domain, and I run my own SMTP server on it. Now it seems Google has decided to reject all mail from my server:

<>: host[2a00:1450:4013:c01::1b] said: 550-5.7.1
    [] Our system has detected that this
    550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam
    sent 550-5.7.1 to Gmail, this message has been blocked. Please visit
    for 550 5.7.1 more information. o49si12858332eef.38 - gsmtp (in reply to
    end of DATA command)

In the mentioned page, they recommend putting "SPAM" in the subject of forwarded mail :-/ in order to trick GMail to accept it. But then, it is not forwarded mail at all, it is mail originated on the same host from which the SMTP client is trying to send it to GMail.

So, are we getting to the world where only Google and few other big players are allowed to run their own SMTP servers? And after that, they wil "suddenly" decide to stop talking to each other, as we have seen in the XMPP case with Google Talk. The morale of the story is: don't rely on services you cannot control for your private data and communication. They will drop your incoming mail as supposed spam and you will not be able to do anything about it.

UPDATE 2014/05/21: Workaround Available
Apparently, this is indeed IPv6-related, and the workaround is either to use IPv4 for Gmail, or better, make Postfix fall back to IPv4 after trying IPv6 first. This way, Google gets a penalty of two connections, and hopefully will have motivation to fix their problem.

The solution is described here, and more can be read in the postfix-users list archive (another source). The solution is:

Add the following to /etc/postfix/

smtp_reply_filter = pcre:/etc/postfix/smtp_reply_filter

Create a file named /etc/postfix/smtp_reply_filter with the following line:

/^5(\d\d )5(.*information. \S+ - gsmtp.*)/ 4${1}4$2

and reload the Postfix configuration using postfix reload command.

Section: /computers (RSS feed) | Permanent link | 4 writebacks

4 replies for this story:

Milan Zamazal wrote:

Do you have both SPF and DKIM set up for your mail domain? If not then you should and it'll probably solve the Gmail problem. (Of course, I wouldn't recommend using Gmail to anyone, but we sometimes need to communicate with their users.)

Yenya wrote: Re: Milan Zamazal

Nope, I don't have SPF nor DKIM set up. Anyway, the outgoing mail in question was sent with envelope sender (MAIL FROM) from another domain than mine (that domain also does not have SPF/DKIM set up). However, I have also tried to send a test mail with MAIL FROM being in my own domain, and Google has rejected it as well. The strange thing is that after several test mails, it has started to pass through the Gmail filter, including the very same messages which have been previously rejected.

misch wrote: IPv6?

I had similar experience ... but ONLY on IPv6 connections. As soon as I switched to IPv4-only for sending mail via google mailservers, every mail was accepted. And when I switched back to IPv6, google started rejecting my mail again. DKIM was enabled (and working) and DNS PTR record was also set-up correctly. And, most important, every other mailserver had no problem accepting mails from me via IPv6 ... except for google. Strange.

Yenya wrote: Re: misch

Interesting. Yes, it is over IPv6.

Reply to this story:

URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Key image: key image (valid for an hour only)
Key value: (to verify you are not a bot)


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)