GMail detecting mail as spam


I've been trying for a long time to get our company's mail server send mail that will get accepted by the GMail spam filter. I have managed making it work for Yahoo Mail and Hotmail, sadly GMail is still marking our mails as spam.

I have configured DKIM, SPF, DMARC and verified our mail server IP address against blacklists. I also have pasted here the headers GMail gets when we send a mail.

Received: by with SMTP id hc6csp107427icb;
        Wed, 20 Aug 2014 07:34:26 -0700 (PDT)
X-Received: by with SMTP id ev2mr59101019wjb.76.1408545265402;
        Wed, 20 Aug 2014 07:34:25 -0700 (PDT)
Return-Path: <>
Received: from ( [])
        by with ESMTPS id dj10si4827754wib.79.2014.
        for <>
        (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 20 Aug 2014 07:34:25 -0700 (PDT)
Received-SPF: pass ( domain of designates as permitted sender) client-ip=;
       spf=pass ( domain of designates as permitted sender);
Received: from localhost (localhost [])
  by (Postfix) with ESMTP id ED2BB2017AC
  for <>; Wed, 20 Aug 2014 17:33:23 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; h=
  :message-id:to:from:from:date:date; s=dkim; t=1408545197; x=
  1409409197; bh=e04RtoyF7G39lfCvA9LLhTz4nF64siZtN5IYmC18Xsc=; b=o
X-Amavis-Modified: Mail body modified (using disclaimer) -
X-Virus-Scanned: Debian amavisd-new at
Received: from ([])
  by localhost ( []) (amavisd-new, port 10024)
  with ESMTP id 3JcgXZAXeFtX for <>;
  Wed, 20 Aug 2014 17:33:17 +0300 (EEST)
Received: from whiterock.local (unknown [])
  by (Postfix) with ESMTPSA id 05CAE200280
  for <>; Wed, 20 Aug 2014 17:33:15 +0300 (EEST)
Date: Wed, 20 Aug 2014 17:34:15 +0300
From: Company Mail <>
Message-ID: <etPan.53f4b8b8.46e87ccd.11669@whiterock.local>
Subject: hey there!
X-Mailer: Airmail (247)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

How was your summer?


Thanks a lot!

Best Answer

I have seen this to happen in other ocasions, when the received from is reported as localhost, with as IP address.

The fact that this does not match with your DNS records is certainly getting your email marked as spam.

You should review your DNS records (A and MX) and the headers that you send in your SMTP server. Your server is sending what it believe it is his IP address, so you will need to configure your /etc/hosts to let your server know what is the external IP address of your server.