postfix 配置外部smtp郵箱發送郵件記錄

安裝環境.

Linux VM-0-13-debian 3.16.0-10-686-pae #1 SMP Debian 3.16.76-1 (2019-11-12) i686 GNU/Linux

1.安裝

apt-get install bsd-mailx postfix -y

2.編輯修改 /etc/postfix/main.cf

#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mydestination = root, localhost, localhost.localdomain, localhost
relayhost = smtp.189.cn:25
inet_interfaces = loopback-only

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_mechanism_filter =
sender_canonical_maps = regexp:/etc/postfix/sender_canonical

3.編輯修改/etc/postfix/sasl_passwd

vi /etc/postfix/sasl_passwd
smtp.189.cn:25 xxx@xxxx:pass
:w
:! sudo postmap /etc/postfix/sasl_passwd
:wq

4.編輯修改 /etc/postfix/sender_canonical

vi /etc/postfix/sender_canonical
/.+/ xxx@xxxx
:w
:! sudo postmap /etc/postfix/sender_canonical
:wq

5.測試

echo "你好啊,這是一封測試!"  |  mail  -s 'text' 郵箱地址

end…

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章