DEV Community

loading...

Can Someone Smarter Than Me Help Troubleshoot Why My Server's Emails Are Going To Spam?

Jack Harner πŸš€
I'm Jack! I'm a Freelance Developer. I have experience with WordPress, Shopify, BigCommerce, React, Linux Admin, & More! Ask Me Anything!!
・3 min read

I have a LEMP server running Ubuntu 14.04 and using Mail-in-a-Box as the mail server.

I have a LAMP server running Ubuntu 16.04 that I had initially setup Postfix to use as an SMTP Relay through the Mail in a Box. I thought it was working, but now it seems all my emails are going to spam. It's really just for the one site so I uninstalled Postfix and just installed a WordPress SMTP plugin but that didn't seem to make a difference.

As far as I can find, none of my domain names or IPs are showing up on Blacklists

I ran an email through the Is Not Spam tester and here are the results:

==========================================================
Summary of Results
==========================================================

SPF Check : pass
Sender-ID Check : pass
DKIM Check : pass
SpamAssassin Check : ham (non-spam)
==========================================================
Details:
==========================================================

HELO hostname: box.harnerdesigns.com
Source IP: <My Mail Server IP>
mail-from: hello@harnerdesigns.com
Anonymous To: <random email>@isnotspam.com
--------------------------------------------------------------
SPF check details:
---------------------------------------------------------------

Result: pass
ID(s) verified: smtp.mail=hello@harnerdesigns.com
DNS record(s):
harnerdesigns.com. 1799 IN TXT "v=spf1 include:servers.mcsv.net include:box.harnerdesigns.com include:server.harnerdesigns.com ?all"


---------------------------------------------------------------
Sender-ID check details:
---------------------------------------------------------------

Result: pass

ID(s) verified: smtp.mail=hello@harnerdesigns.com
DNS record(s):
harnerdesigns.com. 1799 IN TXT "v=spf1 include:servers.mcsv.net include:box.harnerdesigns.com include:server.harnerdesigns.com ?all"


---------------------------------------------------------------
DKIM check details:
---------------------------------------------------------------

Result: pass
ID(s) verified: header.From=hello@harnerdesigns.com
Selector=mail
domain=harnerdesigns.com
DomainKeys DNS Record=mail._domainkey.harnerdesigns.com

---------------------------------------------------------------
SpamAssassin check details:
---------------------------------------------------------------
SpamAssassin 3.4.1 (2015-04-28)

Result: ham (non-spam) (03.7points, 10.0 required)

pts rule name description
--------- ---------------------- -------------------------------


* 3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100%
* [score: 1.0000]
* -0.0 SPF_HELO_PASS SPF: HELO matches SPF record
* -0.0 SPF_PASS SPF: sender matches SPF record
* -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
* 0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100%
* [score: 1.0000]
* 0.1 HTML_MESSAGE BODY: HTML included in message
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
* domain
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Spam-Status: Yes, hits=3.7 required=-20.0 tests=BAYES_99,BAYES_999,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RP_MATCHES_RCVD,
SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.0
X-Spam-Score: 3.7

To learn more about the terms used in the SpamAssassin report, please search
here: http://wiki.apache.org/spamassassin/
Enter fullscreen mode Exit fullscreen mode

Couple Questons

  1. Do I need to include harnerdesigns.com in the SPF record? box.harnerdesigns.com is the mail server and server.harnerdesigns.com is the LAMP server, but harnerdesigns.com is what domain all the email will be sent as.
  2. Looking at the X-Spam-Status is the required=-20.0 just part of how Is Not Spam sets it up so it blocks everything? Everything I've seen says you just need to keep your spam score under 5 to get through most filters.
  3. I'm not sure how else to troubleshoot this issue. Any suggestions on where to look next?

Discussion (2)

Collapse
jsrn profile image
James

I just had a look at my own SPF record, and it only references sendgrid, not my sending domain, so I think you're fine on that front?

I'm a little concerned by

* 3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100%
* 0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100%

What sort of message body are you sending here?

Collapse
jackharner profile image
Jack Harner πŸš€ Author

The message body from that test was, I believe, a "Thank you for your order" notification.

I just tested it again with the following:

Hello,

How are you today? Have you had time to consider that proposal?
-- 
Thanks,
Jack Harner

And it still got those two messages.