![sendmail 智能主机在服务器上不起作用](https://linux22.com/image/804733/sendmail%20%E6%99%BA%E8%83%BD%E4%B8%BB%E6%9C%BA%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在尝试在服务器上设置邮件中继以使用relay.jangosmtp.net。
我之前在许多其他服务器上也这样做过,但从未遇到过此问题。我用以下内容更新了我的 sendmail.mc:
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `relay.jangosmtp.net')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
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
dnl MAILER(cyrusv2)dnl
然后我跑了make -C /etc/mail
由于某种原因,在我重新启动 sendmail 并尝试发送电子邮件后,它不使用智能主机中继。这是我在日志中得到的内容:
Oct 14 17:54:17 ip-10-191-148-198 sendmail[17476]: starting daemon (8.14.4): SMTP+queueing@01:00:00
Oct 14 17:54:17 ip-10-191-148-198 sm-msp-queue[17484]: starting daemon (8.14.4): queueing@01:00:00
Oct 14 17:54:39 ip-10-191-148-198 sendmail[17487]: r9EHsdc3017487: from=apache, size=332, class=0, nrcpts=0, msgid=<201310141754.r9EHsdc3017487@ip-10-191-148-198>, relay=apache@localhost
答案1
查找两对sendmail 日志from=
条目to=
。第二条to=
日志条目应显示通过智能主机进行的中继。
第一对应该由 sendmail 生成submit.cf
,第二对应该由sendmail.cf
sendmail 生成。
您可以使用队列 ID (例如) 连接from=
并记录条目。to=
r9EH0clP016385