Web server and mail in different droplets

Hello guys, I have a doubt that I have a headache.

I have my droplet A and my droplet B in my droplet A I have a web server and in droplet B I want to put the mail server.

In my droplet B I will use postfix to handle the mails but I want them to leave with the next user and do not leave I have read that you have to modify the mx and txt of droplet B but I still do not know how they help me?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


For the purpose of setting up a proper e-mail server, I would highly recommend using something that will auto-configure everything for you. It’ll be far less of a headache and easier to manage.

This will simplify things quite a bit and it’s what I recommend to others looking to do the same.

As far as DNS records for the mail server, what you specifically need to be concerned with is SPF and DKIM, though DMARC may also be required in the not too distance future.

*Droplet A host name should be: www

*Droplet B host name should be: mail

in your Registrar DNS under MX you need to add the hostname.domainname.tld of your webserver.

DNS should be corrected on the Mail host (Droplet Server itself) under /etc/resolv.conf

Here you need to add the DNS of your Provider… but also easy to use Public Name servers as google. It should look like this:

Generated by NetworkManager

search domainname.tld nameserver nameserver

*Also your Host name doesn’t need to be specific to what that host will provide as I have a droplet running both Mail and WWW services… But the Host names must be correct in the hosts file.

It looks like all is working…

Here is an example of some of my

myhostname = mail.DOMAIN.TDL alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = DOMAIN.TDL <---------------------------------//// ?? I think this is problem ?? mydestination = mail.DOMAIN.TDL #relay_domains = relayhost = mynetworks = [::ffff:]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4

You should comment out the first myorgin = /etc/mailname

Debian specific: Specifying a file name will cause the first

line of that file to be used as the name. The Debian default

is /etc/mailname.

I comment out my mailname because my #myorigin = /etc/mailname

My emails sent out as aliase@domain.tld