我在我们的组织中有一个私人邮件服务器mail.domain1.com。
假设我的邮件 ID 是[电子邮件保护]。但是当我使用具有不同域的相同本地部分发送邮件时,如下所示:[电子邮件保护]然后邮件就被退回了。我收到的回信的邮件地址是[电子邮件保护],这就是为什么MX服务器找不到邮件id来发送邮件的原因。
我为什么会收到这个邮件 ID?
另外我没有该通配符 DNS 记录。
以下是 resolv.conf 的输出:
cat /etc/resolv.conf
search xxxxxxx-ca.com.bd
nameserver 202.84.32.22
nameserver 202.84.32.23
和挖掘命令:
[root@mail ~]# dig yahoo.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63348
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 7, ADDITIONAL: 7
;; QUESTION SECTION:
;yahoo.com. IN A
;; ANSWER SECTION:
yahoo.com. 518 IN A 206.190.36.45
yahoo.com. 518 IN A 98.138.253.109
yahoo.com. 518 IN A 98.139.183.24
;; AUTHORITY SECTION:
yahoo.com. 163160 IN NS ns6.yahoo.com.
yahoo.com. 163160 IN NS ns2.yahoo.com.
yahoo.com. 163160 IN NS ns8.yahoo.com.
yahoo.com. 163160 IN NS ns3.yahoo.com.
yahoo.com. 163160 IN NS ns4.yahoo.com.
yahoo.com. 163160 IN NS ns1.yahoo.com.
yahoo.com. 163160 IN NS ns5.yahoo.com.
;; ADDITIONAL SECTION:
ns1.yahoo.com. 163160 IN A 68.180.131.16
ns2.yahoo.com. 160291 IN A 68.142.255.16
ns3.yahoo.com. 160291 IN A 98.138.222.11
ns4.yahoo.com. 160291 IN A 68.142.196.63
ns5.yahoo.com. 160291 IN A 119.160.247.124
ns6.yahoo.com. 160423 IN A 202.43.223.170
ns8.yahoo.com. 160423 IN A 202.165.104.22
;; Query time: 397 msec
;; SERVER: 202.84.32.23#53(202.84.32.23)
;; WHEN: Sun Apr 7 19:13:01 2013
;; MSG SIZE rcvd: 313
出于安全原因,我隐藏了我的域名。
发送邮件
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
dnl define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl
dnl define(`confLOG_LEVEL', `9')dnl
dnl define(`SMART_HOST', `smtp.your.provider')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
dnl define(`confAUTO_REBUILD')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', `20000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
TRUST_AUTH_MECH('LOGIN PLAIN')dnl
define('confAUTH_MECHANISMS', 'LOGIN PLAIN')dnl
define('confSMTP_LOGIN_MSG', '$j')dnl
dnl define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
dnl define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl
dnl define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
dnl define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl
dnl define(`confDONT_BLAME_SENDMAIL', `groupreadablekeyfile')dnl
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)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
dnl define(`confMAX_DAEMON_CHILDREN', `20')dnl
dnl define(`confCONNECTION_RATE_THROTTLE', `3')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
dnl define(`confLOCAL_MAILER', `cyrusv2')dnl
dnl define(`CYRUSV2_MAILER_ARGS', `FILE /var/lib/imap/socket/lmtp')dnl
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
LOCAL_DOMAIN(`xxxxxxx-ca.com.bd')dnl
MASQUERADE_AS(`xxxxxxx-ca.com.bd')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
答案1
首先,如果你要运行邮件服务器并且选择了 sendmail,请出去购买一份蝙蝠书如果您还没有这样做,那就花一个周末阅读它 - 建立一个虚拟网络并完成示例。
这真的不是可选的:Sendmail 是一个复杂的野兽,如果您想让它运行良好,您将需要一个很好的参考。
对于您的实际问题:正如 Ladadadada 猜测的那样,您的 sendmail 配置中塞入了大量内容,可能会导致其与信封混在一起。
如果您不确定是否需要它们,请注释掉masquerade
功能和其他行,看看您的问题是否消失。如果您确定需要它们,请花一些时间阅读 bat 手册(或至少有关伪装的 Sendmail 文档充分理解它们并正确配置它们。
您的配置中还存在其他一些潜在问题(relay_based_on_MX
通常被认为是“不明智的”,因为它允许任何人通过在其终端进行简单的 DNS 更改将您用作中继服务器。我个人并不喜欢,always_add_domain
但这是个人选择。)