我为我的域名设置了一个内部邮件服务器,用于发送和接收电子邮件。
我选了坚固的邮件服务器为了这。
我部署并配置了系统,以便能够在我的域电子邮件地址上接收电子邮件,但我无法让系统正确发送电子邮件。
它可以将电子邮件发送到我的域名电子邮件地址,但如果我尝试将电子邮件发送到 gmail 或 yahoo 帐户,我会收到以下错误:
550 5.1.2 不允许中继。
知道可能出什么问题了吗?谢谢
发生此错误时我的邮件服务器生成的日志是:
[2m2023-08-15T14:33:08.731705Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::ehlo[0m[2m:[0m[3mcontext[0m[2m=[0m"dnsbl"[3mevent[0m[2m=[0m"invalid-reply"[3mquery[0m[2m=[0m"7.e.0.1.5.e.a.8.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.zen.spamhaus.org."[3mreply[0m[2m=[0m[127.255.255.254]
[2m2023-08-15T14:33:10.481369Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"220 mail.queeq.com Stalwart SMTP at your service\r\n"[3msize[0m[2m=[0m50
[2m2023-08-15T14:33:10.484529Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m"EHLO [192.168.1.95]\r\n"[3msize[0m[2m=[0m21
[2m2023-08-15T14:33:10.484624Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::ehlo[0m[2m:[0m[3mcontext[0m[2m=[0m"dnsbl"[3mevent[0m[2m=[0m"dnserror"[3mquery[0m[2m=[0m"[192.168.1.95].dbl.spamhaus.org."[3mreson[0m[2m=[0mDNS resolution error: proto error: Label contains invalid characters: Err(Errors { invalid_mapping, disallowed_by_std3_ascii_rules })
[2m2023-08-15T14:33:10.484697Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::ehlo[0m[2m:[0m[3mcontext[0m[2m=[0m"spf"[3mevent[0m[2m=[0m"lookup"[3midentity[0m[2m=[0m"ehlo"[3mdomain[0m[2m=[0m"[192.168.1.95]"[3mresult[0m[2m=[0mTempError
[2m2023-08-15T14:33:10.484750Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::ehlo[0m[2m:[0m[3mcontext[0m[2m=[0m"ehlo"[3mevent[0m[2m=[0m"ehlo"[3mdomain[0m[2m=[0m"[192.168.1.95]"
[2m2023-08-15T14:33:10.484844Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"250-mail.queeq.com says hello\r\n250-STARTTLS\r\n250-SMTPUTF8\r\n250-SIZE 104857600\r\n250-REQUIRETLS\r\n250-PIPELINING\r\n250-ENHANCEDSTATUSCODES\r\n250-CHUNKING\r\n250-BINARYMIME\r\n250 8BITMIME\r\n"[3msize[0m[2m=[0m180
[2m2023-08-15T14:33:10.489642Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m"STARTTLS\r\n"[3msize[0m[2m=[0m10
[2m2023-08-15T14:33:10.489746Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"220 2.0.0 Ready to start TLS.\r\n"[3msize[0m[2m=[0m31
[2m2023-08-15T14:33:10.498472Z[0m[32m INFO[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2mutils::listener::listen[0m[2m:[0m[3mcontext[0m[2m=[0m"tls"[3mevent[0m[2m=[0m"handshake"[3mversion[0m[2m=[0mTLSv1_3[3mcipher[0m[2m=[0mTLS13_AES_256_GCM_SHA384
[2m2023-08-15T14:33:10.498565Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m"EHLO [192.168.1.95]\r\n"[3msize[0m[2m=[0m21
[2m2023-08-15T14:33:10.498634Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"250-mail.queeq.com says hello\r\n250-SMTPUTF8\r\n250-SIZE 104857600\r\n250-REQUIRETLS\r\n250-PIPELINING\r\n250-ENHANCEDSTATUSCODES\r\n250-CHUNKING\r\n250-BINARYMIME\r\n250 8BITMIME\r\n"[3msize[0m[2m=[0m166
[2m2023-08-15T14:33:10.546754Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m"MAIL FROM:<[email protected]> BODY=8BITMIME SIZE=410\r\n"[3msize[0m[2m=[0m51
[2m2023-08-15T14:33:10.792869Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::mail[0m[2m:[0m[3mcontext[0m[2m=[0m"iprev"[3mevent[0m[2m=[0m"lookup"[3mresult[0m[2m=[0mperm error; DNS record not found: Non-Existent Domain[3mptr[0m[2m=[0m""
[2m2023-08-15T14:33:10.836554Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::ehlo[0m[2m:[0m[3mcontext[0m[2m=[0m"dnsbl"[3mevent[0m[2m=[0m"invalid-reply"[3mquery[0m[2m=[0m"queeq.com.dbl.spamhaus.org."[3mreply[0m[2m=[0m[127.255.255.254]
[2m2023-08-15T14:33:10.886759Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::mail[0m[2m:[0m[3mcontext[0m[2m=[0m"spf"[3mevent[0m[2m=[0m"lookup"[3midentity[0m[2m=[0m"mail-from"[3mdomain[0m[2m=[0m"[192.168.1.95]"[3msender[0m[2m=[0m"[email protected]"[3mresult[0m[2m=[0mPass
[2m2023-08-15T14:33:10.886800Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::mail[0m[2m:[0m[3mcontext[0m[2m=[0m"mail-from"[3mevent[0m[2m=[0m"success"[3maddress[0m[2m=[0m"[email protected]"
[2m2023-08-15T14:33:10.886870Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"250 2.1.0 OK\r\n"[3msize[0m[2m=[0m14
[2m2023-08-15T14:33:10.891118Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m"RCPT TO:<[email protected]>\r\n"[3msize[0m[2m=[0m28
[2m2023-08-15T14:33:10.891707Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::rcpt[0m[2m:[0m Relay not allowed.[3mcontext[0m[2m=[0m"rcpt"[3mevent[0m[2m=[0m"error"[3maddress[0m[2m=[0m"[email protected]"
[2m2023-08-15T14:33:15.893716Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"write"[3mdata[0m[2m=[0m"550 5.1.2 Relay not allowed.\r\n"[3msize[0m[2m=[0m30
[2m2023-08-15T14:33:15.908812Z[0m[35mTRACE[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::session[0m[2m:[0m[3mevent[0m[2m=[0m"read"[3mdata[0m[2m=[0m""[3msize[0m[2m=[0m0
[2m2023-08-15T14:33:15.908834Z[0m[34mDEBUG[0m[1msession[0m[1m{[0m[3minstance[0m[2m=[0m"smtp"[3mprotocol[0m[2m=[0mSmtp[3mremote.ip[0m[2m=[0m"::ffff:138.229.16.231"[3mremote.port[0m[2m=[0m40426[1m}[0m[2m:[0m[2msmtp::inbound::spawn[0m[2m:[0m Connection closed by peer.[3mevent[0m[2m=[0m"disconnect"[3mreason[0m[2m=[0m"peer"
答案1
似乎存在 DNS 问题。您是否尝试解析安装 Stalwart 的服务器上的任何域名?
例如:
nslookup -q=mx gmail.com