Mail server_Package installation - SomethingWithHorizons/mailserver GitHub Wiki
Install the packages required for the mail server to perform its task.
The mail server first and foremost requires an SMTP server to be able to send and receive e-mails. Second it needs a database to store and maintain domains users and their aliases. Finally it an IMAP server is required to provide user clients (Thunderbird, Rainloop, etc.) access to the e-mails stored on the file-system of the server.
The FOSS domain offers various package alternatives to choose from. Several popular postfix package exist, as do various database systems (strictly speaking a database is not even needed, as data could also be stored in plain text-files). As expected, several IMAP server packages are offered in the repositories too.
:information_source: This guide deploys MariaDB as its database being a fork of MySQL and can as such be used as a drop-in replacement (and/or swapped at will).
Procedure
-
Change the hostname of the mailserver to a Fully Qualified Domain Name (FQDN) to ensure the hostname is correctly configured by postfix:
hostnamectl set-hostname <ROOT DOMAIN><ROOT DOMAIN>should be the domain you have registered (e.g.example.org).:bulb: You can check the FQDN setting by issuing:
hostname --fqdnthat should return the domain you have registered (e.g.example.org).:warning: WARNING This step requires the DNS Preparation steps to be executed!
-
Install the SIMPLE MAIL TRANSFER PROTOCOL (SMTP) server :
-
Start the (interactive) installer:
apt install -y postfix postfix-mysql -
Choose
Internet Siteand click<OK>:
-
Fill in the FQDN of your registered domain per instruction and press
<OK>:
-
-
Install all remaining packages (non-interactively) :
# Install OPENSSL to enable communication without eavesdropping apt install -y openssl # Install the DATABASE server apt install -y mariadb-server # Install the mail delivery server with LOCAL MAIL TRANSFER PROTOCOL (LMTP), INTERNET MESSAGE ACCESS PROTOCOL (IMAP), MAIL FILTERING, and MySQL DATABASE back-end support apt install -y dovecot-core dovecot-lmtpd dovecot-imapd dovecot-sieve dovecot-managesieved dovecot-mysql:information_source: For POP3 support:
apt install -y dovecot-pop3d.