親手編織每一條訊息的通路。這條路雖然漫長,但能讓您完全掌控系統的每一個細節。
安裝核心組件 Postfix (MTA) 與 Dovecot (IMAP/POP3)。
hostnamectl set-hostname mail.your-domain.com
apt update
apt install -y postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d
myhostname = mail.your-domain.com
mydomain = your-domain.com
myorigin = $mydomain
inet_interfaces = all
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
protocols = imap pop3
listen = *
mail_location = maildir:~/Maildir
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}
獲取憑證並重啟服務。
apt install -y certbot
certbot certonly --standalone -d mail.your-domain.com
systemctl restart postfix dovecot