What is the best way to setup a mail server in this day and age? [closed]

What software you choose to go with is ultimately down to you, but the usual sensibilities apply;

  1. Require authentication for sending/receiving messages, TLS highly recommended.
  2. Have the PTR records for your SMTP server correctly setup; not everyone will penalise you for this, but some will.
  3. Implement SPF record with a hard fail for non-matching senders (-all)
  4. Implement DKIM (nb: DKIM != DomainKeys) - you may choose to implement both, but don't implement DomainKeys and not DKIM since DomainKeys is old hat at this point.

Finally, be vigilant over who you hand out mail accounts to and/or do spam checking on outbound mail if you have a fear of accountholders abusing their account (or getting their credentials stolen and abused)

The only thing in the above list that should actually require setup on the SMTPd is DKIM/DomainKeys, personally I use DKIM-milter for Postfix.


The biggest thing you can do is to setup your DNS and server headers properly. This means:

  • Server reports itself as 'mx.example.com'
  • Server's A record resolves to 'mx.example.com'
  • PTR record for server's outbound IP resolves to 'mx.example.com'

You can also look at setting up SPF and Microsoft's derivative, SenderID, and DKIM (DomainKeys is deprecated by DKIM).

Once you have the IP you're going to be sending mail from, check to see if it's been blacklisted. MXToolbox has a good one that I commonly use.

Running a mail server sucks. I run my own personal one and it's okay. I also work for a managed hosting company and when I was on the support side, I helped with more problems for folks wanting to run their own. If you want to do mass mailing, use someone like sendgrid.com.