「 example.com 」の部分を独自ドメインに変更してください。
コピーしたファイルを変更していきます。
sudo vi /etc/postfix/main.cf
「 myhostname 」を次のように変更します。
myhostname = mail.example.com
「 mydomain 」を次のように変更します。
mydomain = example.com
masquerade_domains = example.com
「 myorigin 」を次のように変更します。
「 inet_interfaces 」を次のように変更します。
「 mydestination 」を次のように変更します。
この設定で「 $mydomain 」を設定しておかないと、メールが送信できず、「 mail loops back to myself 」といったエラーメッセージが出る可能性が高いです。
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
「 local_recipient_maps 」を次のように変更します。
local_recipient_maps = unix:passwd.byname $alias_maps # コメントを外す
「 home_mailbox 」を次のように変更します。
home_mailbox = Maildir/ # コメントを外す
「 smtpd_banner 」を次のように変更します。
smtpd_banner = $myhostname ESMTP # 追記
SMTP-AUTH 用の設定パラメータは、main.cf の最後に追記します。
### SMTP-AUTH
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination