How to send emails using droplets?

July 21, 2018 595 views
Email DNS Ubuntu 16.04

Hello person

Recently Digital Ocean has released my account to perform e-mail sending off the server.

The problem is that whenever I send an email to Hotmail.com or some other Microsoft address the emails return instantly.

I did the test by sending it to Gmail, and the email came directly to Spam.

How do I fix these problems?

The return email from microsoft is this:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

myemail@hotmail.com
host hotmail-com.olc.protection.outlook.com [104.47.2.33]
SMTP error from remote mail server after MAIL FROM:email@mydomain.com SIZE=1662:
550 5.7.1 Unfortunately, messages from [167.99.224.177] weren't sent. Please contact your Internet service provider since part of their network is on our block list (S3150). You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. [DB5EUR01FT045.eop-EUR01.prod.protection.outlook.com]
Reporting-MTA: dns; mydomain.com

Action: failed
Final-Recipient: rfc822;myemail@hotmail.com
Status: 5.0.0
Remote-MTA: dns; hotmail-com.olc.protection.outlook.com
Diagnostic-Code: smtp; 550 5.7.1 Unfortunately, messages from [167.99.224.177] weren't sent. Please contact your Internet service provider since part of their network is on our block list (S3150). You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. [DB5EUR01FT045.eop-EUR01.prod.protection.outlook.com]

2 Answers

Hello friend!

I have to warn you that most of this is deep learning and a lot of time spent. You will get advice here and there that may or may not help, but email is a field that constantly changes as spammers change tactics and others are forced to change their tactics in spam prevention. If you're looking to get into inbox delivery you will need to devote a lot of time and effort to this, continually, for the foreseeable future. If you just want to deliver email without the hassle, you should outsource that effort to someone like SendGrid (for example, though many others exist).

If you still want to continue, here is something I wrote up a while ago:

There are a lot of reasons why e-mail may land in spam folders. To get a quick opinion on it, you can visit the link below and send an e-mail to the address that it generates you. This will give you a full report on how your e-mail appears to recipient servers.

http://www.mail-tester.com

These are the most common reasons why e-mails are filtered to spam folders:

  1. Inconsistent headers
  2. PTR lookup failure / no DNS record matching PTR
  3. SPF Failure
  4. Content

Inconsistent headers could be something like you sending from your server but in the “From” field it shows that it was sent from somewhere else, like Yahoo, Hotmail, etc. The “From” field should show an address that your server should be sending as (typically your domain).

You should make sure that your server’s hostname is a fully qualified domain name (example: server.mydomain.com) and that the droplet is named to match, so that the PTR record is set. Additionally, your DNS should have that hostname (example: server.mydomain.com) pointing to your droplet IP address so that reverse lookups are consistent.

Your SPF record is a DNS record of the type “TXT” which includes either a reference to a DNS record that points to your droplet IP address or the droplet IP address itself. For example, if I want to send mail as mydomain.com and I want to send from my website, as well as a droplet with the IP of 1.2.3.4, my SPF record might look like this:

“v=spf1 +a +ip4:1.2.3.4 ~all”

The “~all” tells the receiving mail server to basically do what it thinks is best if the mail does not match the “+a” (domain’s primary A record) or the “+ip4:1.2.3.4” (the droplet’s IP address). You can also use “-all” instead which suggests to the recipient mail server that any e-mail not originating from these points should be discarded.

Finally, content. Your content can be read as spam whether you intend for it to be or not. Try sending e-mails without long signatures, images, brand names, or website names to rule out the content of your e-mails. However, keep in mind that past content can impact your future e-mails as well.

Now, it is important to note that the most common belief is that blacklists cause filtering to spam folders. In most cases, blacklisting will actually cause e-mail rejection, not filtering to spam folders. However, it is certainly a possibility, even if not a probability, that blacklistings can impact what folder your e-mails land in. You can look up blacklistings for your IP address here:

http://whatismyipaddress.com/blacklist-check

Do note that not every blacklist is relevant. Recipient servers have to actually use them for them to matter. Many are not widely used, and therefore do not matter. If you question whether this is the case with a particular blacklist, feel free to ask us, we generally know which ones are important.

If I can be of any further assistance, please be sure to let me know.

Kind Regards,
Jarland

  • Hello,

    First of all I would like to thank you for your great response and help me, thank you very much, everything was very well explained and detailed.
    I tried to perform the settings that suggested, I modified the whole DNS, but doing some tests realized that the problem is in VPS IP, is there any way to fix this without taking a lot of time?

    I also tried to use SendGrid shortly after reading your suggestion but for some reason Hotmail was still refusing the emails sent through SendGrid's SMTP.

    Look:
    http://prntscr.com/kajlty

    I'm using Exim4 to do the sending of emails, I configured SendGrid's SMTP in it.

    I intend to send very few emails in my VPS, no more than 100 per month, but I have 4 domains in the same VPS.

    Do you know any other way to fix this?

    Thank's for your time.

Have another answer? Share your knowledge.