Emails sent from my domain always end up in Gmail spam


I've spent the past weeks fiddling with setting up Postfix as a SMTP server on my Linode server. Everything works great in theory:

  • SPF passes
  • DKIM works
  • DMARC works
  • the mail gets sent via TLS
  • the PTR record returns my domain name

And even testing on returns me a 10/10 score, confirming that my setup is good.

And yet all my emails still end up in the spam filter on Gmail, and don't even get delivered to emails.

I'm at a complete loss now - I've tried pretty much everything I could find on Google/StackOverflow, but to no avail.

The content of the emails is a sample order confirmation, which I've verified via SpamAssassin to be of no spammy nature whatsoever. I'm sending the mails through NodeMailer via the SMTP transport on my own server

Any pointers or ideas about where to go from here?

I've attached the headers of the received mail here just in case it might be of any help. Thanks for reading.

Delivered-To: [email protected]
Received: by 2002:a9d:7851:0:0:0:0:0 with SMTP id c17csp673538otm;
        Wed, 8 Jan 2020 05:03:27 -0800 (PST)
X-Google-Smtp-Source: APXvYqyN4S1Zbe7mpTCrxQ6mgGkN7R9SHA1CG26DA38B8hZzbRHhWFU4B8LTZ9JDp/Kav+DqWys4
X-Received: by 2002:a05:6000:367:: with SMTP id f7mr4364238wrf.174.1578488606743;
        Wed, 08 Jan 2020 05:03:26 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1578488606; cv=none;; s=arc-20160816;
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arc-20160816;
ARC-Authentication-Results: i=1;;
       dkim=pass [email protected] header.s=dec2019 header.b=MFsedXzA;
       spf=pass ( domain of [email protected] designates IP.TO.MY.LINODE as permitted sender) [email protected];
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE)
Return-Path: <[email protected]>
Received: from ( [IP.TO.MY.LINODE])
        by with ESMTPS id p11si2386458wrj.178.2020.
        for <[email protected]>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 08 Jan 2020 05:03:26 -0800 (PST)
Received-SPF: pass ( domain of [email protected] designates IP.TO.MY.LINODE as permitted sender) client-ip=IP.TO.MY.LINODE;
       dkim=pass [email protected] header.s=dec2019 header.b=MFsedXzA;
       spf=pass ( domain of [email protected] designates IP.TO.MY.LINODE as permitted sender) [email protected];
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE)
Received: from ( [IP.TO.MY.LINODE])
    by (Postfix) with ESMTPS id 1EEC05A168
    for <[email protected]>; Wed,  8 Jan 2020 14:03:26 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;
    s=dec2019; t=1578488606;
Content-Type: multipart/alternative;
From: My Shop <[email protected]>
To: [email protected]
Subject: Order Confirmation #NT-00000018
Message-ID: <[email protected]>
Date: Wed, 08 Jan 2020 13:03:25 +0000
MIME-Version: 1.0

7 Replies

Its take time to "Warming Up an IP Address"

Did you check if the IP is blacklisted?

Sometimes the only thing you can do is contact the email provider and ask them why things are going to spam and if there is anything they or you can do.

Running your own mail server is always going to be a pain in the backside when it comes to spam issues.

If you use a service like Amazon SES as a smarthost to send mail, it will not get rejected based on the originating IP address.

Unless your mail volume is particularly high, sending from your own IP is not worth the hassle.

You can check blacklist inclusion (either by IP address or domain name) here:

This site works for BOTH IPv4 and IPv6 addresses…easy and pretty comprehensive.

You need to do this periodically. I try to do it at least once/month for all of IPv4, IPv6 and domain names.

-- sw

@bjarkebech It does appear that your records are set up correctly. If you've received any bounce back error messages, I would see if the mail provider has and specific explanation for them. Below are some Gmail and iCloud links that may offer additional information during your investigation.

Good luck!

Wow, wasn't expecting such a quick response. Thank you guys so much.

I've now looked into it a bit more, and it appears my IP is on the iCloud blacklist (despite being all-OK in the MXToolbox SuperTool linked by @stevewi - thanks!). I've sent them a dispute claim, but am not going to bother hosting my own mail server anymore - this has proven to be a much bigger hassle than I expected. I can only assume this is the reason my mails won't reach Gmail either.

For anyone experiencing the same issues, I checked /var/log/mail.log on my server and found messages about the mails not reaching the iCloud servers - can't believe I didn't think to check there.

@dubidub, thank you for introducing me to Amazon SES. Only wish I'd heard of it before spending so much time messing with this. I just tried it out and already got my first mail working and through the spam filter. With something that reasonably priced there is really no reason to roll your own anymore.

Thanks a lot for your help everyone!

Email servers aren't hard…just complex. One of my main reason for signing up with Linode was to get out of shared-hosting hell with respect to how my mail was handled.

I have a whole set of custom infrastructure built around postfix(1) -- greylisting, custom spam filtering, tagging based on regexes/senders/recipients, dovecot(1) sieve, DKIM, SPF, etc. Since I'm retired and have the time & experience to work on this stuff, it's a hobby project for me.

I'm currently working on DMARC…however the installation packages from Debian/Ubuntu drag in MySQL…something I would never use. I'm experimenting with building it myself to use SQLite instead.

-- sw


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct