Centos sendmail配置失败-用户未知

时间:2019-02-22 22:24:23

标签: php linux centos centos7 sendmail

我尝试在Centos 7操作系统上安装和配置sendmail。

下面的命令来测试sendmail是否正常工作会提供以下我的/ var / log / maillog的输出:

echo 'test' | sendmail office@alexander-pabinger.at


Feb 22 22:53:18 alexander-pabinger sendmail[4901]: starting daemon (8.14.7): SMTP+queueing@01:00:00
Feb 22 22:53:18 alexander-pabinger sm-msp-queue[4912]: starting daemon (8.14.7): queueing@01:00:00
Feb 22 22:53:30 alexander-pabinger sendmail[4918]: x1MLrUAC004918: from=k004403, size=5, class=0, nrcpts=1, msgid=<201902222153.x1MLrUAC004918@alexander-pabinger.at>, relay=root@localhost
Feb 22 22:53:30 alexander-pabinger sendmail[4919]: x1MLrUd9004919: <office@alexander-pabinger.at>... User unknown
Feb 22 22:53:30 alexander-pabinger sendmail[4918]: x1MLrUAC004918: to=office@alexander-pabinger.at, ctladdr=k004403 (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Feb 22 22:53:30 alexander-pabinger sendmail[4919]: x1MLrUd9004919: from=<k004403@alexander-pabinger.at>, size=5, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 22 22:53:30 alexander-pabinger sendmail[4918]: x1MLrUAC004918: x1MLrUAD004918: DSN: User unknown
Feb 22 22:53:30 alexander-pabinger sendmail[4919]: x1MLrUdB004919: from=<>, size=2090, class=0, nrcpts=1, msgid=<201902222153.x1MLrUAD004918@alexander-pabinger.at>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 22 22:53:30 alexander-pabinger sendmail[4918]: x1MLrUAD004918: to=k004403, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31029, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x1MLrUdB004919 Message accepted for delivery)
Feb 22 22:53:30 alexander-pabinger sendmail[4920]: x1MLrUdB004919: to=<k004403@alexander-pabinger.at>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32311, dsn=2.0.0, stat=Sent

很抱歉,我已经在寻找解决方案3天了,所有提供的建议都不能解决我的问题!

起初我无法使用“服务”,但现在将其更改为“未知用户”。

我的/etc/mail/sendmail.mc看起来像这样:

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/1und1-auth.db')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

预先感谢

1 个答案:

答案 0 :(得分:0)

您sendmail将alexander-pabinger.at视为本地电子邮件域(将传递到本地邮箱)。
很有可能它不会像您期望的那样“自动配置”。

  1. 检查域是否在/etc/mail/local-host-names文件中列出
    [这是“手动”列出本地电子邮件域的默认文件]
  2. 检查已配置和自动配置的本地电子邮件域
    以root身份执行echo '$=w' | sendmail -bt
  3. 关闭本地域自动配置 在sendmail.mc文件中,添加以下行,重新生成sendmail.cf并重新启动/重新加载sendmail守护程序
    [您做到了,但我写给不认真的读者]
  

define(`confDONT_PROBE_INTERFACES',`True')dnl

  1. 如果它不起作用,则报告由12收集的数据并检查并报告“此主机电子邮件名称”
    以root身份执行echo '$j' | sendmail -bt
    [解释有一些丑陋的特殊情况]