dnl
和dnl #
在/etc/mail/sendmail.mc
文件中有什么区别?如果我想启用某些东西需要在前面吗?同样,如果我想“注释掉”某些东西,我需要什么前缀?
例如:
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(foo.com)dnl
dnl MASQUERADE_DOMAIN(foo2.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
Run Code Online (Sandbox Code Playgroud) 我尝试使用 phpmail()
函数发送电子邮件,但不知何故失败,抱怨需要真实域名。在邮件日志中观察到以下内容:
sendmail 4984 r25984:from=apache,size=273,class=0,nrcpts=1,msgid=<201.r25@localhost.localdomain>,relay=apache@localhost
sendmail 4985 r25985:规则集=check_mail,arg1=,relay= mydomain.com [127.0.0.1], reject=553 5.5.4 ... 发件人地址需要真实域名
sendmail 4984 r25984: to=external@server.com, ctladdr=apache (48/48), delay=00: 00:01,xdelay=00:00:00,mailer=relay,pri=30273,relay=[127.0.0.1] [127.0.0.1],dsn=5.6.0,stat=数据格式错误
sendmail 4984 r25984:r259 DSN:数据格式错误
每当 logrotate 出现问题时,cron 都能够向 external@server.com 发送电子邮件。我不确定为什么 php 无法这样做。我尝试使用以下内容更改 `sendmail.mc 中的默认配置:
MASQUERADE_AS(`mydomain.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(mycom)dnl
Run Code Online (Sandbox Code Playgroud)
但是,它似乎没有任何影响。php 邮件功能中的地址标题已经设置好了。我还确保httpd_can_sendmail
启用了 SELinux 。我还需要做什么才能使邮件送达?