Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are emails sent by my server marked as SPAM?

Tags:

email

spam

My website, all written in PHP, has an automatic system to notify users via email. Everything worked perfectly until i moved everything on a new less expensive dedicated server (new IP, also). Now, from the new server, all the emails are sent to the spam folder. Why? What happened? Gmail says it's marked as spam because it violates these guidelines about the sender. Here is the message header of one of the emails

Delivered-To: [email protected]
Received: by 10.64.224.200 with SMTP id re8csp1701580iec;
        Sun, 1 Feb 2015 07:30:19 -0800 (PST)
X-Received: by 10.140.22.5 with SMTP id 5mr1380826qgm.72.1422804619177;
        Sun, 01 Feb 2015 07:30:19 -0800 (PST)
Return-Path: <[email protected]>
Received: from ns362512.ip-91-121-174.eu ([2001:41d0:1:ef28::1])
        by mx.google.com with ESMTP id e3si21772874qaf.113.2015.02.01.07.30.18
        for <[email protected]>;
        Sun, 01 Feb 2015 07:30:19 -0800 (PST)
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=2001:41d0:1:ef28::1;
Authentication-Results: mx.google.com;
       spf=none (google.com: [email protected] does not designate permitted sender hosts) [email protected]
Received: by ns362512.ip-91-121-174.eu (Postfix, from userid 504)
    id DFE0916074; Sun,  1 Feb 2015 16:28:52 +0100 (CET)
To: [email protected]
Subject: Qualcuno ha commentato il tuo post
X-PHP-Originating-Script: 504:new_notification.php
From: Racebooking <[email protected]>
Reply-To: no-reply
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Message-Id: <[email protected]>
Date: Sun,  1 Feb 2015 16:28:52 +0100 (CET)

The domain, racebooking.net, has a good reputation and MX, mail, smtp point to the same ip: 91.121.174.40 which is the same IP of racebooking.net (here is a test)

Any idea?

like image 362
Alberto Fontana Avatar asked Jan 23 '26 11:01

Alberto Fontana


1 Answers

Check this line in the header:

Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=2001:41d0:1:ef28::1;
Authentication-Results: mx.google.com;
       spf=none (google.com: [email protected] does not designate permitted sender hosts) [email protected]

I think you have not correctly configured the SPF entries in your DNS.

See this Google Products thread about this: https://productforums.google.com/forum/#!topic/apps/nvGcYDjONfc

I can see that you have no SPF entries defined for "racebooking.net":

$ dig +short racebooking.net txt
"1|www.racebooking.net"

You need to define an SPF entry like:

"v=spf1 mx a:mail0.racebooking.net -all"

You also need to include any other host from which you might be sending email (ie web applications sending email from @racebooking.net).

More info about what SPF is: http://en.wikipedia.org/wiki/Sender_Policy_Framework

like image 118
jjmontes Avatar answered Jan 26 '26 04:01

jjmontes