Bobcares

DigitalOcean SMTP blocked – Here’s how to fix it

by | Dec 22, 2018

Mail function in web applications is a great feature to reach out to your online customers. It uses the mail protocol called SMTP.

But, what if SMTP is blocked on your DigitalOcean Droplet ?

All emails will fail!

DigitalOcean Droplets can have SMTP blocked due to reasons like bad firewall, built-in restrictions, and so on.

At Bobcares, we help customers to fix SMTP connection in Droplets as part of our Managed Cloud Services.

Today, we’ll discuss the top reasons for DigitalOcean SMTP block and how we fix them.

 

What causes SMTP block in DigitalOcean ?

By default, mail protocol on a server make use of port 25 for the connection. But there can be many reasons for mail port to fail.

Now, let’s see the top two reasons for SMTP block.

1. Firewall restrictions

From our experience in managing servers, we see that firewall restrictions often cause SMTP block in DigitalOcean Droplets.

This firewall restriction can be of 2 types.

a) Firewall within the server

Here, problem mainly happens due to wrong rules in the server firewall. For example, if there is rule that blocks all outbound traffic from the server, it will block SMTP port 25 too.

b) Firewall at ISP

Similarly, firewall restrictions at internet service provider also can affect the SMTP traffic.

Port 25 is one of the most abused port for spamming. As a result, many ISPs block outgoing email on port 25 from dynamic IP addresses. So, even if SMTP port is open in your Droplet, you will have problems in sending mails.

 

2. Inbuilt block by provider

Yet another reason for SMTP block in DigitalOcean droplet is built-in restriction by provider.

In some new Droplets, Digital Ocean blocks SMTP traffic for 60 days as part of their security restrictions. This again causes mail to fail. They will lift this restriction only after providing further details about the purpose of emails from the server.

 

How to fix DigitalOcean SMTP block ?

We’ve now seen the possible reasons for the SMTP block. The exact fix largely depends on identifying the reason of the block.

That’s why, when a user reports problem with SMTP traffic, our Cloud Specialists first analyze the server and isolate the part at which block happens. Many times, the block can be within the server, at ISP level or even with cloud provider.

We’ll  now see how we fix the SMTP block at various levels.

 

1. Changing firewall

When we identify the problem as server firewall, we add specific rules to allow traffic on SMTP port. For example, in a Droplet, we add the following rules to accept port 25.

iptables -I OUTPUT -p tcp --dport 25 -j ACCEPT

Similarly, we often use the command ufw also to enable port 25.

ufw allow 25

Even after opening port 25 within the server, if there are further problems, we further check the ISP settings. And, we work with ISP to fix the firewall at their end too.

 

2. Using alternate port

When server provider itself is blocking SMTP, the workaround is to use alternate port for SMTP.

Here, our Cloud Engineers configure mail server on alternate ports like 2525. Then we allow the custom port in the server firewall too. Thus, the restriction on port 25 will not affect the traffic.

Another option is to use third party mail providers like Zoho, Mailgun, SendGrid, etc. Here, we configure all mails from the web application to go via these mail programs. Again, these programs allow custom ports too.

 

Conclusion

DigitalOcean Droplets often experience problems with mail due to SMTP port block. Today, we’ve seen the top reasons for the block and how our Cloud Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF