【问题标题】:PHP - 553 Relaying disallowed with Zoho mail and MyBBPHP - 553 Zoho mail 和 MyBB 不允许中继
【发布时间】:2014-05-14 21:28:49
【问题描述】:

我正在尝试使用 Zoho 的 SMTP 服务器从 MyBB 安装发送注册电子邮件。但是,电子邮件永远不会发送,当我检查日志时,我发现错误是。

Month Day Year:Hour:Minute host=smtp.zoho.com tls=on auth=on user=user[at]mydomain.com from=user[at]mydomain.com recipients=some.user[at]gmail.com smtpstatus=553 smtpmsg='553 Relaying disallowed' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

为了隐藏私人信息,某些部分被遮盖了!

这是在php.ini中设置的sendmail路径

sendmail_path = "/usr/bin/msmtp -C /etc/msmtp/myserver --logfile /var/log/msmtp/myserver.log -a default -t"

为了隐藏私人信息,某些部分被遮盖了!

这是 MSMTP 的 myserver 配置

# Define here some setting that can be useful for every account
defaults
    logfile /var/log/msmtp/general.log

# Settings for default account
account default
    protocol smtp
    host smtp.zoho.com
    tls on
    tls_starttls off
    tls_certcheck off
    port 465
    auth plain
    user user[at]mydomain.com
    password **********
    from user[at]mydomain.com
    logfile /var/log/msmtp/myserver.log

# If you don't use any "-a" parameter in your command line,
# the default account "default" will be used.
# account default: default # (disabled because this gives a "redefined" error)

为了隐藏私人信息,某些部分被遮盖了!

问题是我知道它正在工作并且没有端口被阻塞,因为当我在命令行中使用相同的命令时。电子邮件已成功发送和接收。

sudo echo -e "Subject: Test Mail\r\n\r\nThis is a test mail" | msmtp --debug -a default --from=user[at]mydomain.com -t some.user[at]gmail.com --file=/etc/msmtp/myserver

为了隐藏私人信息,某些部分被遮盖了!

这意味着要么是 MyBB 发送电子邮件的方式有问题,要么是我在 php.ini 文件中设置的 PHP 配置或命令行有问题。

我已经搜索了一整天,但我得到的每个结果要么与 PHP 无关,要么从一开始就没有工作。而我的工作是从命令行而不是 PHP。

我在服务器上使用 UFW,每个端口都是完全打开的,所以我猜它与阻塞的端口无关。

它适用于 Gmail,但每封电子邮件都被发送到垃圾邮件文件夹,并且并非每次都适用于每封电子邮件。

编辑: 我尝试使用 PHP5-CLI 发送电子邮件,并且成功了。所以我猜这可能是 PHP5-FPM 或 MyBB 有问题。

【问题讨论】:

    标签: php sendmail mybb zoho msmtp


    【解决方案1】:

    如果没有安装 MyBB,我无法对此进行测试,但如果它使用原生 PHP 邮件功能,您可能需要在 mail() 函数调用中添加 -f 选项,因为您使用的是 sendmail。注意它是第 5 个参数(我一度认为它是第 4 个参数,我浪费了一天时间)

    mail('nobody@example.com', 'the subject', 'the message', null,
    '-flocaluserr@thisdomain.com'); 
    

    【讨论】:

      猜你喜欢
      • 2015-10-08
      • 2017-07-22
      • 1970-01-01
      • 2017-10-28
      • 1970-01-01
      • 1970-01-01
      • 2019-05-25
      • 2012-03-14
      • 1970-01-01
      相关资源
      最近更新 更多