SSH登录或在Web控制面板点击>_Shell
输入:
apt-get install -y libsasl2-modules
修改 /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
默认配置请删掉或者注释
Gmail 的 SMTP 和 IMAP 本来一直都是正常的,自从上次无故屏蔽后,虽然后来解封了,但是也变得断断续续了,不稳定。
这里简单分享下用 Linux 下的 Xinetd 代理 SMTP 和 IMAP 收发邮件的方法,原理是使用 Xinetd 进行端口转发,前提你你有一台能正常访问 Gmail 的服务器。
此法针对客户端,Web 端请自己想办法。
以 Ubuntu 14.04.2 为例:
sudo apt-get install -y xinetd
/etc/xinetd.d/gmail
,内容如下: