Best practice for mailserver setup

  • Posted September 11, 2014


I followed an tutorial about setting up a mailserver.

I have setup the following DNS records for my domain in DO`s DNS manager: Mx 5 Txt @ “v=spf1 mx -all” A IP.AD.RE.SS

This should setup mail.mydomain as mailserver right? I am using virtualmin which has postfix mailserver running.

This is not (yet) working for this domain, but I got it working on another domain, so that does not really matter for now. What matters is that i`m wondering if this is the ideal configuration for a mailserver. Am I not missing a few backup TXT or Mx records?

What are the best practices, DNS records or postfix tips to setup mailserver for reliable e-mail sending and receiving? Also, what are the pitfalls of my setup? I use dovecot for IMAP mail sending and receiving.

I`m totally new on this so hopefully someone can help.

What is essential that I can setup a mailserver like, or , something like that.


Submit an 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.

With this configuration you are able to send mail for all servers in the world :)

remember that your vps name need to be the same of your mx name: When you have your vps name as your mx record name, your PTR record on DO dns servers answer with “”, this is essentials to your server work perfectly.