How can I prevent my e-mails getting marked as spam?
You have your own e-mail server, but your e-mails are landing in the spam folder or do not even arrive? This can have several reasons. This tutorial will show you the most important tricks and often overseen configuration mistakes. If you have a webspace package, you will only need the point SPF of this tutorial. In this tutorial we will often use the fictional domain server.yourdomain.com and the IP address 184.108.40.206. Please replace them with your own ones when you are doing the tests or configuration.
The SMTP banner is the label of your e-mail server. When it connects to a different e-mail server, it is introducing itself with it. If you have a server from us, it will, at the beginning, answer with something like this:
A lot of e-mail providers will not accept such a label and send your e-mail directly into the spam folder. So it is better to choose a less generic one like:
Please note that it has to be a fully qualified domain name (FQDN). That means there has to be a subdomain like "server" in front of yourdomain.com. You can request the current SMTP banner by connecting to your server with Telnet over port 25. You can do this in Windows by entering the following command into the Windows command prompt:
telnet 220.127.116.11 25
Please use your own server IP here. If you are using Windows, you will have to activate Telnet first! (Start --> Control Panel --> Programs and Features --> Turn Windows features on or off--> wait a moment, then check the Telnet Client check box and finish with clicking on OK)
The output might look like this:
220 m1234.contabo.net ESMTP Postfix (Debian/GNU)
"m1234.contabo.net" is the important information in this line. You can leave the session by entering "quit" and hitting enter. In cPanel and Plesk, the mailserver's name in the SMTP banner is equal to the hostname. So you can alter it by changing the hostname in the administration panel.
If you are using Plesk on a Windows server, it is not so easy to change the banner. Please log into your server over RDP, open the tool "MailEnable" and go to: MailEnable Management --> Servers --> localhost --> Connectors. Then choose in the opening list SMTP, click on it with you right mouse key and open "Properties". In the opening window, there are four fields you have to fill in:
Local Domain Name
Here you have to enter you main domain. For example: yourdomain.com.
Default mail domain name
This is your e-mail server name in the SMTP banner. For example: server.yourdomain.com
Here you have to enter the DNS servers. If you have your server in one of our datacenters, the following addresses would work perfectly:
Notification email address
Please enter an existing e-mail address.
If you are using Postfix instead of an administration panel, you can change the SMTP banner by using this command in the terminal:
postconf -e "myhostname = server.yourdomain.com" && postfix reload
Please replace "server.yourdomain.com" with the new domain name of the e-mail server.
The PTR, or also called reverse DNS record, is the counterpart of the A-record in a DNS zone.
server.yourdomain.com --> 18.104.22.168
22.214.171.124 --> server.yourdomain.com
Most e-mail servers only accept an e-mail, if the PTR is exactly the same as the name of the mailserver in the SMTP-Banner! If you have for example the following SMTP-Banner:
220 server.yourdomain.com ESMTP Postfix (Debian/GNU)
You have to change your PTR like in the upper example, what can be done easily in the Customer Control Panel. Please notice, that you have to change the PTR of the IPv6 address too, if you are using IPv6 additionally to IPv4. It will not harm to do it anyway, if you are not sure.
With the SPF record you determine that it is only allowed to send e-mails from specific IP addresses. Many e-mail servers are considering e-mails from domains without SPF record as spam. You can add an SPF record in the Customer Control Panel with the DNS Zone Management. The following one should work in most cases:
86400 in TXT "v=spf1 +a +mx ~all"
It will allow the IP named in the A-record and the one of the mailserver, named in the MX-record.
If you use one of our webspace packages, please use the following one:
86400 in TXT "v=spf1 +a +mx +include:mail-relay.contabo.net ~all"
If you have a special configuration, you can use a tool like this to generate an individual SPF:
DKIM will help you to improve the reputation of your e-mails. Please take a look at our DKIM Tutorial for cPanel and Plesk!
We always do test our IP addresses, before we give them to our customers. But it is not impossible, that your IP is currently on a blacklist. This will cause your sending attempts to fail despite all your tries to achieve a perfect configuration. If you assume that your IP might be on such a list, you can test for the most important ones on this site:
Please enter the IP address of your server and wait some seconds for the test! If the IP is listed somewhere (marked in red), you should contact the owners of this list. They will offer a removal form on their home page. The IP should be removed in a few days. Some e-mail providers have their own lists, that can not be reviewed so easily. They normally will send you a bounce e-mail to signal, that the sending attempt failed, with the reason included in it. If they mention an internal blacklist, you can find below some links to the removal forms of such providers:
If you have problems getting your IP removed from such a list, please write an e-mail with the error message and the IP to [email protected] We will help you solving this problem.
If you have paid attention to all the points so far, and your e-mails have still problems with reaching the recipient or are landing in the spam folder, it is time to look for the reason in close detail. Have you got a reply when the e-mail was not accepted? Read this e-mail carefully. Often there stands the reason for this behaviour! If you have found such a message, but it does not help you, you are free to sent it with the complete header to our support. Our team of experts at [email protected] has a lot of experience with solving such problems!
If the e-mail is arriving but landing in spam, the header of the received e-mail might contain the reason for this classification. Furthermore many large e-mail providers like Google or Microsoft offer online information about their e-mail sending guidelines that are worth a look!
Please also take a look on the Website mail-tester.com. You can send an e-mail to the server here and the site will show you possible optimizations for your server and the e-mails!
If nothing helped
If you have worked through the whole tutorial, and there are still problems with sending e-mails, or you need help at some point, you can contact our support. We are there for you everyday from 8:00 to 23:00 (German time) at [email protected]