cPanel - WHM - The SMTP restriction - 限制用户使用外部smtp发信
问题:cPanel用户无法通过php使用外部smtp服务器发信。
尝试:执行如 openssl s_client -connect smtp.gmail.com:465
的命令,显示cPanel/WHM本机的ssl证书,并不是gmail的。
解决:登录到WHM,禁用 The SMTP restriction 功能即可。
This feature prevents users from bypassing the mail server to send mail, a common practice used by spammers.
It will allow only the MTA, mailman, and root to connect to remote SMTP servers.
This control is also adjustable in Tweak Settings.
The SMTP restriction is enabled.
参考:https://docs.cpanel.net/whm/security-center/smtp-restrictions/