Mailserver_Base install - SomethingWithHorizons/mailserver GitHub Wiki

Installing the mailserver packages

Debian

apt install -y mariadb-server
apt install -y dovecot-core dovecot-lmtpd dovecot-imapd dovecot-sieve dovecot-managesieved dovecot-mysql
DEBIAN_FRONTEND=noninteractive apt install -y postfix postfix-mysql

DEBIAN_FRONTEND=noninteractive to suppress interactive menu and accept defaults instead.

:information_source: For POP3 support: apt install -y dovecot-pop3d.

FreeBSD

To have backend support for MySQL we need to compile postfix and dovecot package from ports

# install the MySQL server
pkg install mariadb102-server
sysrc mysql_enable="YES"
service mysql-server start

# fetch, update and extract latest ports
portsnap auto

# select the MYSQL (or other backend you're planning to use) options during the make task
cd /usr/ports/mail/postfix
make config-recursive build install clean
sysrc postfix_enable=YES
service postfix start

cd /usr/ports/mail/dovecot
make config-recursive build install clean
sysrc dovecot_enable=YES
service dovecot start