# yum install -y postfix cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5
/etc/postfix/main.cf (抜粋)
myhostname = mail.<ドメイン>
mydomain = <ドメイン>
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
local_recipient_maps =
home_mailbox = Maildir/
luser_relay = unknown_user@localhost
smtpd_banner = $myhostname ESMTP unknown
smtpd_tls_cert_file = /etc/letsencrypt/live/<ドメイン>/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/<ドメイン>/privkey.pem
smtp_tls_CApath = /etc/letsencrypt/live/<ドメイン>/cert.pem
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
message_size_limit = 10485760
/etc/postfix/master.cf (抜粋)
submission inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
/etc/aliases (追加)
unknown_user: /dev/null
# firewall-cmd --permanent --add-service=smtp --add-service=smtp-submission --add-service=smtps
# firewall-cmd --reload
# firewall-cmd --list-services
# newaliases
# postalias hash:/etc/aliases
# alternatives --config mta
(MTAがリストアップされる)
(`+`が現在有効になっているMTA)
(postfixの番号を入力して有効なMTAを変更)
# systemctl enable postfix saslauthd
# systemctl restart postfix saslauthd
# systemctl status postfix saslauthd
# yum install -y dovecot
/etc/dovecot/conf.d/10-mail.conf (抜粋)
mail_location = maildir:~/Maildir
/etc/dovecot/conf.d/10-ssl.conf (証明書は Let's Encrypt で取得)
ssl = required
ssl_cert = </etc/letsencrypt/live/<ドメイン>/fullchain.pem
ssl_key = </etc/letsencrypt/live/<ドメイン>/privkey.pem
ssl_protocols = !SSLv2 !SSLv3
ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
/etc/dovecot/conf.d/10-logging.conf (抜粋, デバッグ用)
auth_verbose = yes
auth_debug = yes
# firewall-cmd --permanent --add-service=pop3s
# firewall-cmd --reload
# firewall-cmd --list-services
# systemctl enable dovecot
# systemctl restart dovecot
# systemctl status dovecot
# tail -f /var/log/maillog
This version of the page was edited by TakeAsh at 2020-08-15 21:28:11. View the most recent version.