Report this

What is the reason for this report?

SMTP handshake not working, blocked on port 25?

Posted on June 13, 2024

I’m trying to run a basic script that verifies an email address. It uses an SMTP handshake like so:

server = smtplib.SMTP(timeout=10)
server.set_debuglevel(1)
server.connect(mx, port=25)
server.helo('example.com')
server.mail('you@example.com')
code, message = server.rcpt(email)
server.quit()

I know that Digital Ocean blocks on port 25 to prevent spam, but it would be great to be unblocked so I can do email verification. I do all email sending through Amazon SES so I only need port 25 unblocked for email verification.

I open a support ticket (#09070834) two days ago but haven’t heard back so figured I’d ask here. Thanks in advance



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey @kitzj,

In our public community, we aim to answer open questions about anything SysAdmin, DigitalOcean and beyond. However, we make every attempt to keep personal information safe and so don’t ever access personal account information here. This means we can’t provide help with any account or billing-related issues.

I have asked our amazing support team to check-in on your ticket. They will be able to help you further where we cannot! :)

That said, running your own mail server on a Droplet is generally more trouble than it is worth. Deliverability is hard to maintain, IP reputation takes time to build, and you are one spam complaint away from being blacklisted. Most people are better off using a dedicated SMTP service like https://smtpfa.st/, SendGrid, Mailgun, or Postmark and skipping the port unblock request entirely.

Hope that helps! - KFSys.

Hey,

Quick update in case that anyone comes across this in the future.

The SMTP ports (25, 465, and 587) are blocked on all Droplets for new accounts to prevent spam and other abuses of our platform.

Even if SMTP were available, DigitalOcean strongly recommends against running your own mail server in favor of using a dedicated email deliverability platform. Dedicated email deliverability platforms are better at handling deliverability factors like IP reputation.

To send mail from DigitalOcean, you can use an SMTP service like https://smtpfa.st/ or SendGrid.

Alternatively, you could reach out to the DigitalOcean support team and check if they could lift the block for you but in many cases this is not possible:

https://www.digitalocean.com/support/

- Bobby.

Heya, @kitzj

You can use a service like https://smtpfa.st/, SendGrid, Mailgun, or Postmark, much better for deliverability anyway. They allow SMTP over API, which is a good workaround and better for performance too.

Honestly the API route is usually the better option anyway, it is more reliable deliverability and you don’t have to worry about your IP getting blacklisted.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.