在Debian Minimal上配置邮件服务器,可使用Postfix和Dovecot,步骤如下:
sudo apt update
,sudo apt upgrade -y
。sudo apt install postfix -y
,安装时选“Internet Site”并输入邮件名称。再安装Dovecot,sudo apt install dovecot-core dovecot-imapd -y
。/etc/postfix/main.cf
,设置myhostname
、mydomain
等参数。启用SASL认证,配置相关参数如smtpd_sasl_auth_enable = yes
等。/etc/dovecot/dovecot.conf
,设置mail_location
和protocols
。编辑/etc/dovecot/conf.d/10-auth.conf
,启用认证机制。/etc/postfix/master.cf
,添加Dovecot的LMTP配置。sudo adduser --system --group --disabled-login --no-create-home vmail
。sudo systemctl start postfix
,sudo systemctl enable postfix
,sudo systemctl start dovecot
,sudo systemctl enable dovecot
。sudo ufw allow 25/tcp
,sudo ufw allow 143/tcp
,sudo ufw reload
。