How do I set up DNS for inbound emails?

May 14, 2016 387 views
DigitalOcean Email DNS Node.js MEAN Ubuntu

I would like to parse inbound emails in a Node.js app on an Ubuntu 14.04.4 x64 Droplet, so I'm trying to create an email address for my app's domain that can post to a webhook. How do I create an email address like (or

For parsing, I am using, and following Mailin's documentation I have changed my Domain records on Digital Ocean as follows:

MX    10 
A     subdomain    [ip address of my droplet]

I have the webhook set up at, and if I post using curl, I get the expected response, but I can't figure out how to post to the webhook via email.

Am I going about this the right way?

1 Answer

Hi @planetceres,

Great question! Before we proceed, perhaps give this a look over:

That said, it's something we have a ton of tutorials on, for example:

Before you go ahead and do that, consider perhaps hosting email at an email provider, and using your droplet to poll the account (through imap, pop3, or an api) instead, it may turn out to be less heartache for you in the long run. Hope this helps, and let us know if you have any more questions!

When setting up a web site or application under your own domain, it is likely that you will also want a mail server to handle the domain's incoming and outgoing email. While it is possible to run your own mail server, it is often not the best option for a variety of reasons. This guide will cover many of the reasons that you may not want to run your own mail server, and offer a few alternatives.
Have another answer? Share your knowledge.