幸福飞过海 - postfix https://fengqi.me/tag/postfix/ zh-CN Sat, 15 May 2021 12:54:00 +0000 Sat, 15 May 2021 12:54:00 +0000 [记录]Proxmox VE 通过外部 SMTP 服务器发邮件,同样适用其他调用Postfix的服务 https://fengqi.me/unix/541.html https://fengqi.me/unix/541.html Sat, 15 May 2021 12:54:00 +0000 风起 PVE默认发送的邮件会被丢垃圾箱,所以想改为自己的SMTP

安装SASL依赖

SSH登录或在Web控制面板点击>_Shell输入:

apt-get install -y libsasl2-modules

配置Postfix信息

修改 /etc/postfix/main.cf 尾部添加:

relayhost = smtp.exmail.qq.com:465
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sender_dependent_authentication = yes
smtp_generic_maps = hash:/etc/postfix/generic
smtp_use_tls = yes
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

relayhost 需要改为自己的SMTP服务和SSL端口号
注意 /etc/postfix/main.cf 文件应该还有一个内容为空的 relayhost 默认配置请删掉或者注释

[...]

]]>
0 https://fengqi.me/unix/541.html#comments https://fengqi.me/feed/tag/postfix/