我inheritance了一个显然使用Exim作为其MTA的网站。 假设我们可以访问该网站:
http://example.com/
在Example Corp.工作的用户注意到,当PHP Web应用程序尝试将邮件发送到如下地址时,他们没有收到电子邮件 :
[email protected] [email protected]等
问题
当服务器从example.com的主机名发送邮件时, SPFlogging似乎工作得最好。 但是,我们无法通过电子邮件向任何人发送电子邮件,当我们有这样的主机名。
我更改了服务器上的主机名,但是现在它不适用于现有的SPFlogging(详情如下)。
我想我需要build议configuration主机名或Exim。
背景
在Gmail,雅虎,Mailinator等发送到外部地址的电子邮件经历了很好。 我使用Mailinatortesting电子邮件,因为您可以通过电子邮件发送任何地址而无需创build完整帐户。 我用这样的语法来运行testing。
这个testing会成功。
echo "This is message body." | mail -s "SMTP Test 1" -r "[email protected]" [email protected]
这个testing会失败。
echo "This is message body." | mail -s "SMTP Test 1" -r "[email protected]" [email protected]
一些简单的路由testing可以通过使用地址testing选项来完成。 这个testing会成功。
exim -bt [email protected] [email protected] router = dnslookup, transport = remote_smtp host mail.mailinator.com [2600:3c03::f03c:91ff:fe50:caa7] MX=10 host mail.mailinator.com [23.239.11.30] MX=10
这个testing会失败。
exim -bt [email protected] [email protected] is undeliverable
这篇文章很有帮助,并指出我在主机名设置的方向。 http://jblevins.org/log/hostname
我意识到公有DNS有一个名为“store.example.com”的条目,指向正确的IP地址。 我作为主机名input。
sudo主机名store.example.com
确保store.example.com位于networking文件中。 这应该确保重新启动后主机名称保持不变。
sudo nano /etc/sysconfig/network sudo service exim restart
问题是,现在Google抱怨缺lessSPFlogging。
Received-Spf:none(google.com:[email protected]不指定允许的发件人主机)client-ip = xxx.xxx.xxx.xxx;
我意识到我可以创build一个SPFlogging,但使用现有的example.com会更简单。 当这是主机名时,GMail中的标题说:
Received-Spf:pass(google.com:domain of [email protected]将xxx.xxx.xxx.xxx指定为允许的发件人)client-ip = xxx.xxx.xxx.xxx;
服务器环境
CentOS版本6.6
ls /etc/alternatives/ -l | grep mta lrwxrwxrwx. 1 root root 23 Feb 23 09:28 mta -> /usr/sbin/sendmail.exim lrwxrwxrwx. 1 root root 19 Feb 23 09:28 mta-mailq -> /usr/bin/mailq.exim lrwxrwxrwx. 1 root root 29 Feb 23 09:28 mta-mailqman -> /usr/share/man/man8/exim.8.gz lrwxrwxrwx. 1 root root 24 Feb 23 09:28 mta-newaliases -> /usr/bin/newaliases.exim lrwxrwxrwx. 1 root root 15 Feb 23 09:28 mta-pam -> /etc/pam.d/exim lrwxrwxrwx. 1 root root 19 Feb 23 09:28 mta-rmail -> /usr/bin/rmail.exim lrwxrwxrwx. 1 root root 19 Feb 23 09:28 mta-rsmtp -> /usr/bin/rsmtp.exim lrwxrwxrwx. 1 root root 18 Feb 23 09:28 mta-runq -> /usr/bin/runq.exim lrwxrwxrwx. 1 root root 22 Feb 23 09:28 mta-sendmail -> /usr/lib/sendmail.exim exim -bV Exim version 4.72 #1 built 10-Oct-2014 09:23:33 Copyright (c) University of Cambridge, 1995 - 2007 Berkeley DB: Berkeley DB 4.7.25: (September 9, 2013) Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc TCPwrappers OpenSSL Content_Scanning DKIM Old_Demime Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch ldap ldapdn ldapm nis nis0 nisplus passwd sqlite Authenticators: cram_md5 cyrus_sasl dovecot plaintext spa Routers: accept dnslookup ipliteral manualroute queryprogram redirect Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp Fixed never_users: 0 Size of off_t: 8 OpenSSL compile-time version: OpenSSL 1.0.1e-fips 11 Feb 2013 OpenSSL runtime version: OpenSSL 1.0.1e-fips 11 Feb 2013 Configuration file is /etc/exim/exim.conf
我猜测,example.com的邮件需要被转发到该域的“真实”邮件服务器,或者所有的邮件都应该被转发到“智能主机”。
我不知道如何configurationCentOS默认的exim软件包(如果有这样的事情)…你应该使configuration可用的地方,所以我可以说什么需要改变。 基本上:
确保example.com未在local_domains中列出(请检查dnslookup路由器,或者至lessconfiguration第一个路由器之一(路由器按顺序处理,第一个匹配wins)。
searchsmarthost ,看看是否有一个configuration; 你需要把真正的邮件服务器的地址放在那里。
你也可以把这个作为第一个路由器:
smarthost:driver = manualroute domains = * transport = remote_smtp route_data = real.mailserver.example.com
请参阅exim.org以了解默认configuration文件的描述。
SPF的devise方式要求您添加另一个SPFlogging:
域和主机标识授权代表他们发送电子邮件的计算机。 他们通过向现有的DNS信息添加额外的logging来做到这一点:每个具有Alogging或MXlogging的域名或主机都应该有一个指定策略的SPFlogging,如果在电子邮件地址或HELO / EHLO参数中使用该策略。
它说:“每个域名或主机…用于电子邮件地址或作为HELO / EHLO参数”。 由于您将从[email protected]发送的电子邮件地址更改为[email protected],因此您必须为store.example.com添加相应的SPFlogging。