您好,我正在尝试在 Centos 7 服务器上设置 sendmail,以便将邮件从本地程序转发到我们的主要邮件服务器。我已使用以下内容配置了 sendmail.mc,mail.[domain].com 是我们的 SMTP 服务器:
定义('SMART_HOST','mail.[domain].com')dnl
和
功能(
nullclient',
mail.[domain].com')dnl
这是尝试发送此邮件的 sendmail 日志:
Aug 24 11:52:18 centos7 sendmail[21975]: w7O8qIUJ021975: Authentication-Warning: centos7.[domain]: openproject set sender to info@[domain].com using -f
Aug 24 11:52:18 centos7 sendmail[21975]: w7O8qIUJ021975: from=info@[domain].com, size=2587, class=-60, nrcpts=1, msgid=<5b7fc7423c037_218b2acdfb6fcf7c2088c@centos7.[domain].mail>, relay=openproject@localhost
Aug 24 11:52:18 centos7 sendmail[21976]: w7O8qIMw021976: from=<info@[domain].com>, size=2854, class=-60, nrcpts=1, msgid=<5b7fc7423c037_218b2acdfb6fcf7c2088c@centos7.[domain].mail>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 24 11:52:18 centos7 sendmail[21975]: w7O8qIUJ021975: to=dennis@[domain].com, ctladdr=info@[domain].com (988/982), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=140587, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (w7O8qIMw021976 Message accepted for delivery)
Aug 24 11:52:18 centos7 sendmail[21978]: STARTTLS=client, relay=mail.[domain].com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-SHA384, bits=256/256
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021976: to=<dennis@[domain].com>, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=230854, relay=mail.[domain].com. [192.168.111.10], dsn=5.1.1, stat=User unknown
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021976: w7O8qIMw021978: DSN: User unknown
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021978: to=<info@[domain].com>, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30000, relay=mail.[domain].com. [192.168.111.10], dsn=5.1.1, stat=User unknown
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021978: w7O8qIMx021978: return to sender: User unknown
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMx021978: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30000, relay=mail.[domain].com. [192.168.111.10], dsn=5.1.1, stat=User unknown
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021978: Losing ./qfw7O8qIMw021978: savemail panic
Aug 24 11:52:18 centos7 sendmail[21978]: w7O8qIMw021978: SYSERR(root): savemail: cannot save rejected email anywhere
现在根据 sendmail 日志显示的内容,似乎我的电子邮件 dennis@[domain].com 不存在,这很奇怪,因为它确实存在。但如果我查看邮件服务器中的日志,它显示的内容略有不同:
Fri 2018-08-24 11:52:18.667: Session 471387; child 0001
Fri 2018-08-24 11:52:18.667: Accepting SMTP connection from 192.168.111.15:42300 to 192.168.111.10:25
Fri 2018-08-24 11:52:18.670: --> 220 xxxx ESMTP MDaemon 18.0.2; Fri, 24 Aug 2018 11:52:18 +0300
Fri 2018-08-24 11:52:18.672: <-- EHLO centos7.[domain]
Fri 2018-08-24 11:52:18.673: --> 250-xxxxx Hello centos7.[domain] [192.168.111.15], pleased to meet you
Fri 2018-08-24 11:52:18.673: --> 250-ETRN
Fri 2018-08-24 11:52:18.673: --> 250-AUTH LOGIN CRAM-MD5 PLAIN
Fri 2018-08-24 11:52:18.673: --> 250-8BITMIME
Fri 2018-08-24 11:52:18.674: --> 250-ENHANCEDSTATUSCODES
Fri 2018-08-24 11:52:18.674: --> 250-STARTTLS
Fri 2018-08-24 11:52:18.674: --> 250 SIZE
Fri 2018-08-24 11:52:18.683: <-- STARTTLS
Fri 2018-08-24 11:52:18.683: --> 220 2.7.0 Ready to start TLS
Fri 2018-08-24 11:52:18.705: SSL negotiation successful (TLS 1.2, 256 bit key exchange, 256 bit AES encryption)
Fri 2018-08-24 11:52:18.716: <-- EHLO centos7.[domain]
Fri 2018-08-24 11:52:18.716: --> 250-xxxxx Hello centos7.[domain] [192.168.111.15], pleased to meet you
Fri 2018-08-24 11:52:18.716: --> 250-ETRN
Fri 2018-08-24 11:52:18.716: --> 250-AUTH LOGIN CRAM-MD5 PLAIN
Fri 2018-08-24 11:52:18.716: --> 250-8BITMIME
Fri 2018-08-24 11:52:18.716: --> 250-ENHANCEDSTATUSCODES
Fri 2018-08-24 11:52:18.716: --> 250 SIZE
Fri 2018-08-24 11:52:18.724: <-- MAIL From:<info@mail.[domain].com> SIZE=3046
Fri 2018-08-24 11:52:18.726: --> 250 2.1.0 Sender OK
Fri 2018-08-24 11:52:18.754: <-- RCPT To:<dennis@mail.[domain].com>
Fri 2018-08-24 11:52:18.755: Sender attempted to deliver message to unknown address
因此,出于某种原因,发件人和收件人电子邮件地址中的域部分已损坏。邮件服务器认为有人试图向 dennis@mail.[domain].com 发送邮件,而实际上我想向 dennis@[domain].com 发送邮件。
我不知道它为什么会这样。
答案1
嗯,几乎令人尴尬,但是我继续浏览 sendmail.mc 文件并找到我之前激活的以下位,我重新推荐了 LOCAL_DOMAIN 行并且一切开始正常工作。
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`[domain].com')dnl