Skip to content

Latest commit

 

History

History

mailserver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This directory contains an Ansible playbook for setting up a set of mail servers under CentOS/RHEL/Fedora.

A single mail server setup consists of Postfix (a Mail Transport Agent - MTA), Maildrop (a Mail Delivery Agent - MDA), Gonzofilter (a bayes classifying spam filter) and Dovecot (a IMAP server).

The playbook is designed to configure multiple mail server hosts, i.e. usually two, to have a redundant mail infrastructure.

2020, Georg Sauthoff mail@gms.tf

Requirements

  • at least two hosts in different datacenters with static IP addresses (ok, if you must you can also start with just one)
  • ability to create reverse DNS (PTR) records
  • ability to configure DNS records for the involved domains

Getting Started

Have a look at the example inventory file (hosts.sample), the example host and group vars (host_vars.sample/, group_vars.sample/) and create real ones under hosts, host_vars/ and group_vars/.

Execute the playbook in dry mode and check the output:

ansible-playbook mailserver.yml -b --diff --check

Further useful Ansible command line options include -l ... and --tags ....

Out of Scope

Setup steps not (yet?) covered by this playbook:

  • Let's Encrypt Setup - the playbook expects the keys to be available under /etc/letsencrypt/live/
  • Reverse DNS (PTR) records setup - this is just very provider specific and often not even accessible via an API (think: you may have to request PTR changes via the support)
  • DNS setup - again, different nameserver hosters have different APIs, no common standard. And I'm not aware of an Ansible module that supports some common name server hosters/DNS servers.
  • Gonzofilter training - see the Gonzofilter README for details.

DNS Setup

Basically, you have to care about the following things:

See Also

Even if your setup is perfect, it's a good idea to keep an eye on blacklists. Your mail server might end up there by mistake or because of actions by previous owners of your domain/IP-addresses/subnet.