Sendmail SMTP 无法在 apache2 服务器上工作

Sendmail SMTP 无法在 apache2 服务器上工作

我最近为我的开发团队的网站 (ironfi.st) 完成了一项任务,其中我在 apache2 Web 服务器上设置了 SMTP 邮件服务器。我使用 sendmail 以及名为 WP-MAIL-SMTP 的 WordPress SMTP 插件来完成该任务,以实现我们网站上的联系页面功能。但是,我目前面临的问题是服务器不会发送任何邮件。

我选择 sendmail 的原因之一是它的设置步骤简单。所以我很难确定我可能做错了什么。我通过 Ubuntu 连接到服务器并在其上安装了 sendmail。之后我运行配置设置,然后编辑 /etc/hosts 中的主机文件。

以下是我放入主机文件中的内容的副本: 127.0.1.1ironfi.stironfi.st 127.0.0.1 localhost localhost.localdomainironfi.st

完成此操作后,我使用我正在使用的 WP 插件附带的“发送测试电子邮件”功能测试了 SMTP 服务器。如前所述,电子邮件未发送。我开始阅读插件输出的日志。然而,这个领域不一定是我的熟练领域,所以我可能错过了日志中的一些内容,这就是为什么我附加了直接从最新的 SMTP 服务器日志文件 mail.log 从 /var/log 获取的日志和以下插件的日志文件:

来自插件的日志:

测试消息已发送

结果是:

bool(false)

The full debugging output is shown below:

object(PHPMailer)#445 (75) {
  ["Version"]=>
  string(6) "5.2.14"
  ["Priority"]=>
  NULL
  ["CharSet"]=>
  string(10) "iso-8859-1"
  ["ContentType"]=>
  string(10) "text/plain"
  ["Encoding"]=>
  string(4) "8bit"
  ["ErrorInfo"]=>
  string(0) ""
  ["From"]=>
  string(14) "root@localhost"
  ["FromName"]=>
  string(9) "Root User"
  ["Sender"]=>
  string(0) ""
  ["ReturnPath"]=>
  string(0) ""
  ["Subject"]=>
  string(0) ""
  ["Body"]=>
  string(0) ""
  ["AltBody"]=>
  string(0) ""
  ["Ical"]=>
  string(0) ""
  ["MIMEBody":protected]=>
  string(0) ""
  ["MIMEHeader":protected]=>
  string(0) ""
  ["mailHeader":protected]=>
  string(0) ""
  ["WordWrap"]=>
  int(0)
  ["Mailer"]=>
  string(4) "mail"
  ["Sendmail"]=>
  string(18) "/usr/sbin/sendmail"
  ["UseSendmailOptions"]=>
  bool(true)
  ["PluginDir"]=>
  string(0) ""
  ["ConfirmReadingTo"]=>
  string(0) ""
  ["Hostname"]=>
  string(0) ""
  ["MessageID"]=>
  string(0) ""
  ["MessageDate"]=>
  string(0) ""
  ["Host"]=>
  string(9) "localhost"
  ["Port"]=>
  int(25)
  ["Helo"]=>
  string(0) ""
  ["SMTPSecure"]=>
  string(0) ""
  ["SMTPAutoTLS"]=>
  bool(true)
  ["SMTPAuth"]=>
  bool(false)
  ["SMTPOptions"]=>
  array(0) {
  }
  ["Username"]=>
  string(0) ""
  ["Password"]=>
  string(0) ""
  ["AuthType"]=>
  string(0) ""
  ["Realm"]=>
  string(0) ""
  ["Workstation"]=>
  string(0) ""
  ["Timeout"]=>
  int(300)
  ["SMTPDebug"]=>
  bool(true)
  ["Debugoutput"]=>
  string(4) "echo"
  ["SMTPKeepAlive"]=>
  bool(false)
  ["SingleTo"]=>
  bool(false)
  ["SingleToArray"]=>
  array(0) {
  }
  ["do_verp"]=>
  bool(false)
  ["AllowEmpty"]=>
  bool(false)
  ["LE"]=>
  string(1) "
"
  ["DKIM_selector"]=>
  string(0) ""
  ["DKIM_identity"]=>
  string(0) ""
  ["DKIM_passphrase"]=>
  string(0) ""
  ["DKIM_domain"]=>
  string(0) ""
  ["DKIM_private"]=>
  string(0) ""
  ["action_function"]=>
  string(0) ""
  ["XMailer"]=>
  string(0) ""
  ["smtp":protected]=>
  NULL
  ["to":protected]=>
  array(0) {
  }
  ["cc":protected]=>
  array(0) {
  }
  ["bcc":protected]=>
  array(0) {
  }
  ["ReplyTo":protected]=>
  array(0) {
  }
  ["all_recipients":protected]=>
  array(0) {
  }
  ["RecipientsQueue":protected]=>
  array(0) {
  }
  ["ReplyToQueue":protected]=>
  array(0) {
  }
  ["attachment":protected]=>
  array(0) {
  }
  ["CustomHeader":protected]=>
  array(0) {
  }
  ["lastMessageID":protected]=>
  string(0) ""
  ["message_type":protected]=>
  string(0) ""
  ["boundary":protected]=>
  array(0) {
  }
  ["language":protected]=>
  array(0) {
  }
  ["error_count":protected]=>
  int(0)
  ["sign_cert_file":protected]=>
  string(0) ""
  ["sign_key_file":protected]=>
  string(0) ""
  ["sign_extracerts_file":protected]=>
  string(0) ""
  ["sign_key_pass":protected]=>
  string(0) ""
  ["exceptions":protected]=>
  bool(true)
  ["uniqueid":protected]=>
  string(0) ""
}

邮件日志:

Feb  5 10:56:28 ironfist-droplet sendmail[27655]: v15FuS0k027655: from=root, size=196, class=0, nrcpts=1, msgid=<201702051556.v15FuS0k027655@ironfist-droplet>, relay=root@localhost
Feb  5 10:56:28 ironfist-droplet sm-mta[27657]: v15FuSaG027657: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 10:56:28 ironfist-droplet sendmail[27655]: v15FuS0k027655: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 10:56:28 ironfist-droplet sm-mta[27657]: v15FuSaG027657: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 10:56:28 ironfist-droplet sendmail[27655]: v15FuS0k027655: v15FuS0l027655: DSN: User unknown
Feb  5 10:56:28 ironfist-droplet sm-mta[27657]: v15FuSaI027657: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051556.v15FuS0l027655@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 10:56:28 ironfist-droplet sendmail[27655]: v15FuS0l027655: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15FuSaI027657 Message accepted for delivery)
Feb  5 10:56:28 ironfist-droplet sm-mta[27658]: v15FuSaI027657: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:03:40 ironfist-droplet sendmail[27694]: v15G3ehZ027694: from=root, size=196, class=0, nrcpts=1, msgid=<201702051603.v15G3ehZ027694@ironfist-droplet>, relay=root@localhost
Feb  5 11:03:40 ironfist-droplet sm-mta[27696]: v15G3e0P027696: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:03:40 ironfist-droplet sendmail[27694]: v15G3ehZ027694: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:03:40 ironfist-droplet sm-mta[27696]: v15G3e0P027696: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:03:40 ironfist-droplet sendmail[27694]: v15G3ehZ027694: v15G3eha027694: DSN: User unknown
Feb  5 11:03:40 ironfist-droplet sm-mta[27696]: v15G3e0R027696: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051603.v15G3eha027694@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:03:40 ironfist-droplet sendmail[27694]: v15G3eha027694: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G3e0R027696 Message accepted for delivery)
Feb  5 11:03:40 ironfist-droplet sm-mta[27697]: v15G3e0R027696: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:04:30 ironfist-droplet sendmail[27702]: v15G4Uxv027702: from=root, size=196, class=0, nrcpts=1, msgid=<201702051604.v15G4Uxv027702@ironfist-droplet>, relay=root@localhost
Feb  5 11:04:30 ironfist-droplet sm-mta[27704]: v15G4UL7027704: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:04:30 ironfist-droplet sendmail[27702]: v15G4Uxv027702: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:04:30 ironfist-droplet sm-mta[27704]: v15G4UL7027704: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:04:30 ironfist-droplet sendmail[27702]: v15G4Uxv027702: v15G4Uxw027702: DSN: User unknown
Feb  5 11:04:30 ironfist-droplet sm-mta[27704]: v15G4UL9027704: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051604.v15G4Uxw027702@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:04:30 ironfist-droplet sendmail[27702]: v15G4Uxw027702: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G4UL9027704 Message accepted for delivery)
Feb  5 11:04:30 ironfist-droplet sm-mta[27705]: v15G4UL9027704: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:04:43 ironfist-droplet sendmail[27710]: v15G4hPh027710: from=root, size=196, class=0, nrcpts=1, msgid=<201702051604.v15G4hPh027710@ironfist-droplet>, relay=root@localhost
Feb  5 11:04:43 ironfist-droplet sm-mta[27712]: v15G4hZC027712: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:04:43 ironfist-droplet sendmail[27710]: v15G4hPh027710: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:04:43 ironfist-droplet sm-mta[27712]: v15G4hZC027712: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:04:43 ironfist-droplet sendmail[27710]: v15G4hPh027710: v15G4hPi027710: DSN: User unknown
Feb  5 11:04:43 ironfist-droplet sm-mta[27712]: v15G4hZE027712: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051604.v15G4hPi027710@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:04:43 ironfist-droplet sendmail[27710]: v15G4hPi027710: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G4hZE027712 Message accepted for delivery)
Feb  5 11:04:43 ironfist-droplet sm-mta[27713]: v15G4hZE027712: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:06:52 ironfist-droplet sendmail[27722]: v15G6qmc027722: from=root, size=196, class=0, nrcpts=1, msgid=<201702051606.v15G6qmc027722@ironfist-droplet>, relay=root@localhost
Feb  5 11:06:52 ironfist-droplet sm-mta[27724]: v15G6qtl027724: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:06:52 ironfist-droplet sendmail[27722]: v15G6qmc027722: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:06:52 ironfist-droplet sm-mta[27724]: v15G6qtl027724: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:06:52 ironfist-droplet sendmail[27722]: v15G6qmc027722: v15G6qmd027722: DSN: User unknown
Feb  5 11:06:52 ironfist-droplet sm-mta[27724]: v15G6qtn027724: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051606.v15G6qmd027722@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:06:52 ironfist-droplet sendmail[27722]: v15G6qmd027722: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G6qtn027724 Message accepted for delivery)
Feb  5 11:06:52 ironfist-droplet sm-mta[27725]: v15G6qtn027724: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:06:57 ironfist-droplet sendmail[27730]: v15G6vDO027730: from=root, size=196, class=0, nrcpts=1, msgid=<201702051606.v15G6vDO027730@ironfist-droplet>, relay=root@localhost
Feb  5 11:06:57 ironfist-droplet sm-mta[27732]: v15G6vBt027732: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:06:57 ironfist-droplet sendmail[27730]: v15G6vDO027730: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:06:57 ironfist-droplet sm-mta[27732]: v15G6vBt027732: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:06:57 ironfist-droplet sendmail[27730]: v15G6vDO027730: v15G6vDP027730: DSN: User unknown
Feb  5 11:06:57 ironfist-droplet sm-mta[27732]: v15G6vBv027732: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051606.v15G6vDP027730@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:06:57 ironfist-droplet sendmail[27730]: v15G6vDP027730: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G6vBv027732 Message accepted for delivery)
Feb  5 11:06:57 ironfist-droplet sm-mta[27733]: v15G6vBv027732: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:08:43 ironfist-droplet sendmail[27745]: v15G8hA4027745: from=root, size=196, class=0, nrcpts=1, msgid=<201702051608.v15G8hA4027745@ironfist-droplet>, relay=root@localhost
Feb  5 11:08:43 ironfist-droplet sm-mta[27747]: v15G8hUp027747: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:08:43 ironfist-droplet sendmail[27745]: v15G8hA4027745: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:08:43 ironfist-droplet sm-mta[27747]: v15G8hUp027747: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:08:43 ironfist-droplet sendmail[27745]: v15G8hA4027745: v15G8hA5027745: DSN: User unknown
Feb  5 11:08:43 ironfist-droplet sm-mta[27747]: v15G8hUr027747: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051608.v15G8hA5027745@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:08:43 ironfist-droplet sendmail[27745]: v15G8hA5027745: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G8hUr027747 Message accepted for delivery)
Feb  5 11:08:43 ironfist-droplet sm-mta[27748]: v15G8hUr027747: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 11:09:30 ironfist-droplet sendmail[27772]: v15G9U0s027772: from=root, size=196, class=0, nrcpts=1, msgid=<201702051609.v15G9U0s027772@ironfist-droplet>, relay=root@localhost
Feb  5 11:09:30 ironfist-droplet sm-mta[27774]: v15G9UTw027774: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 11:09:30 ironfist-droplet sendmail[27772]: v15G9U0s027772: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 11:09:30 ironfist-droplet sm-mta[27774]: v15G9UTw027774: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:09:30 ironfist-droplet sendmail[27772]: v15G9U0s027772: v15G9U0t027772: DSN: User unknown
Feb  5 11:09:30 ironfist-droplet sm-mta[27774]: v15G9UU0027774: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702051609.v15G9U0t027772@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 11:09:30 ironfist-droplet sendmail[27772]: v15G9U0t027772: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15G9UU0027774 Message accepted for delivery)
Feb  5 11:09:30 ironfist-droplet sm-mta[27775]: v15G9UU0027774: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 15:34:09 ironfist-droplet sendmail[29166]: v15KY9ME029166: from=root, size=196, class=0, nrcpts=1, msgid=<201702052034.v15KY9ME029166@ironfist-droplet>, relay=root@localhost
Feb  5 15:34:09 ironfist-droplet sm-mta[29168]: v15KY9Bg029168: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 15:34:09 ironfist-droplet sendmail[29166]: v15KY9ME029166: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 15:34:09 ironfist-droplet sm-mta[29168]: v15KY9Bg029168: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:34:09 ironfist-droplet sendmail[29166]: v15KY9ME029166: v15KY9MF029166: DSN: User unknown
Feb  5 15:34:09 ironfist-droplet sm-mta[29168]: v15KY9Bi029168: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702052034.v15KY9MF029166@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:34:09 ironfist-droplet sendmail[29166]: v15KY9MF029166: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15KY9Bi029168 Message accepted for delivery)
Feb  5 15:34:09 ironfist-droplet sm-mta[29169]: v15KY9Bi029168: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 15:34:59 ironfist-droplet sendmail[29179]: v15KYxAq029179: from=root, size=196, class=0, nrcpts=1, msgid=<201702052034.v15KYxAq029179@ironfist-droplet>, relay=root@localhost
Feb  5 15:34:59 ironfist-droplet sm-mta[29181]: v15KYx21029181: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 15:34:59 ironfist-droplet sendmail[29179]: v15KYxAq029179: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 15:34:59 ironfist-droplet sm-mta[29181]: v15KYx21029181: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:34:59 ironfist-droplet sendmail[29179]: v15KYxAq029179: v15KYxAr029179: DSN: User unknown
Feb  5 15:34:59 ironfist-droplet sm-mta[29181]: v15KYx23029181: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702052034.v15KYxAr029179@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:34:59 ironfist-droplet sendmail[29179]: v15KYxAr029179: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15KYx23029181 Message accepted for delivery)
Feb  5 15:34:59 ironfist-droplet sm-mta[29182]: v15KYx23029181: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 15:35:24 ironfist-droplet sendmail[29189]: v15KZNKB029189: from=root, size=196, class=0, nrcpts=1, msgid=<201702052035.v15KZNKB029189@ironfist-droplet>, relay=root@localhost
Feb  5 15:35:24 ironfist-droplet sm-mta[29191]: v15KZOSx029191: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 15:35:24 ironfist-droplet sendmail[29189]: v15KZNKB029189: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 15:35:24 ironfist-droplet sm-mta[29191]: v15KZOSx029191: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:35:24 ironfist-droplet sendmail[29189]: v15KZNKB029189: v15KZNKC029189: DSN: User unknown
Feb  5 15:35:24 ironfist-droplet sm-mta[29191]: v15KZOT1029191: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702052035.v15KZNKC029189@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:35:24 ironfist-droplet sendmail[29189]: v15KZNKC029189: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15KZOT1029191 Message accepted for delivery)
Feb  5 15:35:24 ironfist-droplet sm-mta[29192]: v15KZOT1029191: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent
Feb  5 15:35:34 ironfist-droplet sendmail[29199]: v15KZYoU029199: from=root, size=196, class=0, nrcpts=1, msgid=<201702052035.v15KZYoU029199@ironfist-droplet>, relay=root@localhost
Feb  5 15:35:34 ironfist-droplet sm-mta[29201]: v15KZYQ4029201: ruleset=check_rcpt, arg1=<root@ironfist-droplet>, relay=localhost [127.0.0.1], reject=553 5.1.8 <root@ironfist-droplet>... Domain of sender address root@ironfist-droplet does not exist
Feb  5 15:35:34 ironfist-droplet sendmail[29199]: v15KZYoU029199: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown
Feb  5 15:35:34 ironfist-droplet sm-mta[29201]: v15KZYQ4029201: from=<root@ironfist-droplet>, size=196, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:35:34 ironfist-droplet sendmail[29199]: v15KZYoU029199: v15KZYoV029199: DSN: User unknown
Feb  5 15:35:34 ironfist-droplet sm-mta[29201]: v15KZYQ6029201: from=<>, size=2194, class=0, nrcpts=1, msgid=<201702052035.v15KZYoV029199@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 15:35:34 ironfist-droplet sendmail[29199]: v15KZYoV029199: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v15KZYQ6029201 Message accepted for delivery)
Feb  5 15:35:34 ironfist-droplet sm-mta[29202]: v15KZYQ6029201: to=<root@ironfist-droplet>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32407, dsn=2.0.0, stat=Sent

如果有人在日志中发现任何可能有帮助的内容,请随时告诉我。我仍在进行研究并试图找出可能出现的问题并查看日志,但是,由于我在这方面不太熟练,因此感谢任何形式的所有帮助。

Mail.err.1日志:

Jan 24 23:21:47 ironfist-droplet sendmail[2417]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:22:47 ironfist-droplet sendmail[2417]: unable to qualify my own domain name (ironfist-droplet) -- using short name
Jan 24 23:22:47 ironfist-droplet sm-mta[2486]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:22:50 ironfist-droplet sm-msp-queue[2491]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:23:47 ironfist-droplet sm-mta[2486]: unable to qualify my own domain name (ironfist-droplet) -- using short name
Jan 24 23:23:50 ironfist-droplet sm-msp-queue[2491]: unable to qualify my own domain name (ironfist-droplet) -- using short name

谢谢。

答案1

sendmail自从我与和合作以来已经很长时间了postfix,因此我无法为您的 MTA 配置提供合格的建议。

据我所知,您的互联网域名是ironfi.st(请参阅which ironfi.st),这也是从互联网访问时的 HTTP 服务器名称 ( host ironfi.st),(至少)有一个附加名称/别名为www.ironfi.st

还有一个 MX 记录ironfi.st,指向该mx-caprica.easydns.com地址,以便邮件可以投递到该地址[email protected]。这些信息都可以通过查询 DNS 公开获得。

我不太确定的是你的本地网络/服务器的组织,因为我假设你的服务器位于使用 NAS 的路由器后面,其中一些端口传递到你的服务器(其他任何东西都会非常不安全)。因此,您的主机应该具有环回网络 (127.0.0.x) 和至少一个其他专用网络来连接到路由器。这里和下面我假设你的apache服务器是基于Linux操作系统的,我只参考配置IPV4。

乍一看奇怪的是你的/etc/hosts。它通常默认为类似的东西

127.0.0.1   localhost
<privateIP> <hostname> <hostname.domainname>

从你的情况来看mail.log,我想你的主机名是ironfist-droplet;我不知道你的 DNS 域名是否已设置。您可以使用hostname -f和检查这一点dnsdomainname。假设你的私有IP是192.168.1.10(只是一个假设!)并hostname -f返回ironfist-droplet.ironfi.st,第二行应该是

192.168.1.10 ironfist-droplet ironfist-droplet.ironfi.st

为了完整起见,你可能有

192.168.1.10 ironfist-droplet ironfist-droplet.ironfi.st ironfi.st

现在你可以测试

ping localhost
ping ironfist-droplet
ping ironfist-droplet.ironfi.st
ping ironfi.st

它应该返回正确的 IP 并且没有数据包丢失。

现在到您的条目mail.log

您正在通过中继从rootroot(不知道为什么)发送邮件root@localhost。然后,发件人将被编码为root@ironfist-droplet,这将被拒绝作为发件人地址的域does not exist。有一封中继返回from <>的邮件,投递了什么;我认为这是 MTA 向发件人发出的邮件无法发送的消息。使用或或类似的其他程序查看 root 的本地邮箱。root@ironfist-dropletlocalhostmailxs-nail

你应该彻底反映你的插件的配置WP-MAIL-SMTP(谁是发件人,谁是收件人)和你的sendmail(它负责什么域,允许哪些发件人发送邮件,将邮件转发到哪里)。正如我所说,我无法在这里提供建议。例如,如果您希望将邮件发送给[email protected]您,则应该使用有效的发件人进行配置;仅仅从 到root并不是root一个好主意。

看看/var/log/mail.err是否存在,也许还有更多提示。它通常只包含错误消息,但mail.log也包含成功消息。

相关内容