CentOS, Postfix, opendkim, SPF, mail going to span for gmail

April 30, 2014 4.5k views
Hello, I have spent the last three day's trying my very best to get my email services working correctly. Unfortunately mail sent to gmail is going to spam. I have tried all I can think of including: * Setting up an SPF record * Setting up opendkim Here is a mail header: Delivered-To: phulme@threehillslane.com Received: by with SMTP id dt2csp205769qab; Tue, 29 Apr 2014 16:51:59 -0700 (PDT) Received: from duprod.divvyup.com.au (duprod.divvyup.com.au. []) by mx.google.com with ESMTP id 5si10316402qch.25.2014. for ; Tue, 29 Apr 2014 16:51:58 -0700 (PDT) Received: by duprod.divvyup.com.au (Postfix, from userid 502) id 7D9AF83EDF; Tue, 29 Apr 2014 19:51:56 -0400 (EDT) X-Received: by with SMTP id h4mr935288qaq.35.1398815519466; Tue, 29 Apr 2014 16:51:59 -0700 (PDT) Return-Path: Received-Spf: pass (google.com: domain of community@divvyup.com.au designates as permitted sender) client-ip=; Authentication-Results: mx.google.com; spf=pass (google.com: domain of community@divvyup.com.au designates as permitted sender) smtp.mail=community@divvyup.com.au; dkim=pass header.i=@divvyup.com.au Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=divvyup.com.au; s=email; t=1398815516; bh=/5uwtCczjhI3dGKtrYQWaePMjha4qCzOSEcspbECRkU=; h=Date:To:Subject:From; b=xOtocT3eBlaG53IagQaYPmoMLhmvud3LGzHgWOk17gQcl4Cj3c1qyFT9Ci/fc/Y3L DMBYgN4m2Xn+D24tVBBX7TF6oniTJnhSOVuGYhg1gM5AzopcUGuykwKz0NJtIGMPjs TqYL1AhzoylPn3VrsYuyW0htl/9IGZU+XQw1zJoI= User-Agent: Heirloom mailx 12.4 7/29/08 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20140429235156.7D9AF83EDF@duprod.divvyup.com.au> Over this And here is a my SPF record: v=spf1 a mx ptr ip4: mx:duprod.divvyup.com.au ~all And an extract from my maillog Apr 29 19:29:04 duprod postfix/pickup[407]: 810E583EE0: uid=502 from= Apr 29 19:29:04 duprod postfix/cleanup[1131]: 810E583EE0: message-id=<20140429232904.810E583EE0@duprod.divvyup.com.au> Apr 29 19:29:04 duprod opendkim[30104]: 810E583EE0: DKIM-Signature field added (s=email, d=divvyup.com.au) Apr 29 19:29:04 duprod postfix/qmgr[30207]: 810E583EE0: from=, size=489, nrcpt=1 (queue active) Apr 29 19:29:05 duprod postfix/smtp[1134]: 810E583EE0: to=, relay=aspmx.l.google.com[]:25, delay=1.4, delays=0.09/0.01/0.46/0.85, dsn=2.0.0, status=sent (250 2.0.0 OK 1398814147 g2si4067389qaf.20 - gsmtp) I really need to get this going, so any help would be appreciated..
3 Answers
Hi there,

Sadly, this is an often common side effect of running your own mail server... There are services you can look into so that you are not self-hosting and being snagged by spam detection from the major providers. However, more often than not this is the anticipated functions of their spam filters.
So does this mean that the only effective way to send mail to a gmail/google account is to subscribe to a paid service? Mail forms a critical function in my application and I need it to be rock solid.
emails sent from my mail server never go to Spam folder. My DNS looks like this:
@ IN A your-ip
mail CNAME @
@ TXT "v=spf1 ip4:your-ip -all"

Try to add a TXT and remove the SPF record. Remember to wait for a DNS refresh and try it.
Have another answer? Share your knowledge.