大网数据广告活动
服务器运维问答

Why does sendmail changes the FROM domain and how to configure the proper one?

· 52CE 我爱测

I installed Jenkins and configured it to send emails as being sent from "[email omitted]" but the address is always changed when email is being sent and I receive the mail as being sent from "[email omitted]". I've installed Send…

问题原文

原帖链接 · daniels · CC BY-SA 3.0

I installed Jenkins and configured it to send emails as being sent from "[email omitted]" but the address is always changed when email is being sent and I receive the mail as being sent from "[email omitted]".

I've installed Sendmail and Jenkins is configured to use 127.0.0.1 as mail server.

Any idea why Sendmail replaces the FROM domain when email is being sent?

The hostname of the server is properly set (when I run hostname I do get "jenkins.example.com").

Same way if I send an email from command line echo "This is the body" | mail -s "Subject" [email omitted]

From where does it take this default.vps.example.com domain? Where is this default domain configurable?

LE: in my sendmail.mc I have define(confDOMAIN_NAME', jenkins.domain.com')dnl and I generated the sendmail.cf file m4 sendmail.mc > sendmail.cf and restarted sendmail. Still doesn't work.

LE2:

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> canonify           input: jenkins @ jenkins . example . com
Canonify2          input: jenkins < @ jenkins . example . com >
dns_getcanonname(jenkins.example.com, trymx=1)
dns_getcanonname: trying jenkins.example.com. (AAAA)
    YES
dns_getcanonname: trying default.vps.example.com. (AAAA)
    NO: errno=0, h_errno=4
dns_getcanonname: trying default.vps.example.com. (A)
    YES
dns_getcanonname: default.vps.example.com
Canonify2        returns: jenkins < @ default . vps . example . com . >
canonify         returns: jenkins < @ default . vps . example . com . >
>

已采纳解答

原帖链接 · AnFi onet.eu · CC BY-SA 4.0

Quite likely your sendmail replaces names with DNS CNAME record (DNS alias) with "true names".

As root execute echo '3 [email omitted]' | sendmail -d8.20 -bt
It should show you DNS queries during email address preprocessing (by rule set 3).

http://cr.yp.to/im/cname.html

D. J. Bernstein
CNAME records in mail
RFC 821 prohibited all use of ``nicknames or aliases'' in domain names in SMTP requests. RFC 1123 specifically prohibited DNS aliases (domains with CNAME records) in MAIL and RCPT requests.
sendmail accepts a domain with a CNAME record. It replaces the domain with the CNAME value before using it in RCPT, unless it is acting as a dumb client. Similar comments apply to qmail and other mailers.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-10-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。