我在使用 Sendmail 时遇到问题(我在 RedHat Enterprise Linux 7 上安装了 8.14.7),因为服务器上的脚本本地提交的邮件的域名发生了更改。我有 domain1.com domain2.com 和 domain3.com。当通过本地脚本提交邮件时[电子邮件保护],现在正改为[电子邮件保护]。其他一切正常。从互联网收到的邮件[电子邮件保护]去[电子邮件保护]。我使用的是 virtusertable 定义,运行良好。我读到过,submit.mc 是指导本地邮件提交的,而不是 sendmail.mc。有人能看看下面的 submit.mc 并看看我是否有错误或遗漏了什么吗?
divert(-1)
#
# Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#
#
# This is the prototype file for a set-group-ID sm-msp sendmail that
# acts as a initial mail submission program.
#
divert(0)dnl
sinclude(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`linux setup')dnl
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confDONT_INIT_GROUPS', `True')dnl
dnl # If you're operating in a DSCP/RFC-4594 environment with QoS
dnl define(`confINET_QOS', `AF11')dnl
define(`confPID_FILE', `/run/sm-client.pid')dnl
dnl define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
FEATURE(`use_ct_file')dnl
dnl
dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
FEATURE(`msp', `[127.0.0.1]')dnl
我现在也在下面添加了此错误的邮件日志示例:
Oct 22 10:25:59 domain1 sendmail[3126]: x9MHPxwE003126: from=joe, size=220, class=0, nrcpts=1, msgid=<[email protected]>, relay=joe@localhost
Oct 22 10:25:59 domain1 sendmail[3129]: x9MHPx3O003129: from=<[email protected]>, size=457, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Oct 22 10:25:59 domain1 sendmail[3126]: x9MHPxwE003126: [email protected], ctladdr=joe (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x9MHPx3O003129 Message accepted for delivery)
Oct 22 10:26:00 domain1 sendmail[3130]: x9MHPx3O003129: to=<[email protected]>, ctladdr=<[email protected]> (1003/1003), delay=00:00:01, xdelay=00:00:01, mailer=local, pri=30659, dsn=2.0.0, stat=Sent
答案1
virtusertable
仅有的重定向传入的电子邮件。它会重写信封收件人地址。
您可以使用genericstable
来sendmail.cf
“完成”其他地址(信封发件人、标题发件人和收件人)的重写。