我有一个数字海洋VPS,我安装了后缀 。 我想做邮件转发 。
当我安装了后缀我select了无configuration选项。 后来我设置了以下内容:
我在/etc/postfix创build了main.cf
virtual_alias_domains = gintegraconstruccion.com virtual_alias_maps = hash:/etc/postfix/virtual
创buildvirtual
[email protected] [email protected]
然后我重新启动postfix。
在我的DNSconfiguration(我得到了godaddy )我做了:
创造了一个logging :
Host Points to contacto 107.XX.XX.XX
创build了一个MXlogging :
Host Points to @ contacto.gintegraconstruccion.com
但是我试过了,在我的Gmail收件箱里收到了任何邮件。
dig gintegraconstruccion.com的输出是:
; <<>> DiG 9.8.1-P1 <<>> gintegraconstruccion.com mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34297 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;gintegraconstruccion.com. IN MX ;; ANSWER SECTION: gintegraconstruccion.com. 599 IN MX 0 contacto.gintegraconstruccion.com. ;; Query time: 93 msec ;; SERVER: 8.8.4.4#53(8.8.4.4) ;; WHEN: Wed May 14 13:01:53 2014 ;; MSG SIZE rcvd: 67
为了logging,我目前正在使用Openshift托pipe网站,因为我没有迁移它。
在/etc/log/mail.log查找我发现:
May 14 11:52:51 localhost postfix/postfix-script[24478]: fatal: the Postfix mail system is not running May 14 12:02:05 localhost postfix/postfix-script[24600]: fatal: the Postfix mail system is not running May 14 12:02:27 localhost postfix/master[24724]: daemon started -- version 2.9.6, configuration /etc/postfix May 14 12:02:31 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix May 14 13:06:07 localhost postfix/smtpd[24865]: error: open database /etc/aliases.db: No such file or directory May 14 13:06:07 localhost postfix/smtpd[24865]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled May 14 13:06:07 localhost postfix/smtpd[24865]: connect from f.qw.se[109.74.194.71] May 14 13:06:13 localhost postfix/smtpd[24865]: disconnect from f.qw.se[109.74.194.71] May 14 13:06:44 localhost postfix/smtpd[24865]: connect from f.qw.se[109.74.194.71] May 14 13:07:07 localhost postfix/smtpd[24865]: 5F052432EF: client=f.qw.se[109.74.194.71] May 14 13:07:15 localhost postfix/smtpd[24865]: disconnect from f.qw.se[109.74.194.71] May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max connection rate 2/60s for (smtp:109.74.194.71) at May 14 13:06:44 May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max connection count 1 for (smtp:109.74.194.71) at May 14 13:06:07 May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max cache size 1 at May 14 13:06:07 May 14 13:14:20 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix May 14 13:18:29 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix May 14 13:21:04 localhost postfix/smtpd[24982]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled May 14 13:21:04 localhost postfix/smtpd[24982]: connect from mail-wi0-f175.google.com[209.85.212.175] May 14 13:21:05 localhost postfix/smtpd[24982]: 1BC40432EF: client=mail-wi0-f175.google.com[209.85.212.175] May 14 13:21:05 localhost postfix/cleanup[24987]: 1BC40432EF: message-id=<[email protected]$ May 14 13:21:05 localhost postfix/qmgr[24976]: 1BC40432EF: from=<[email protected]>, size=2670, nrcpt=1 (queue active) May 14 13:21:05 localhost postfix/smtpd[24982]: disconnect from mail-wi0-f175.google.com[209.85.212.175] May 14 13:21:05 localhost postfix/smtp[24988]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c01::1a]:25: Network is unreachable May 14 13:21:06 localhost postfix/smtp[24988]: 1BC40432EF: to=<[email protected]>, orig_to=<[email protected]$ May 14 13:21:06 localhost postfix/qmgr[24976]: 1BC40432EF: removed
日志的最后一行(从hotmail发送邮件后):
May 14 13:52:19 localhost postfix/smtpd[25133]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled May 14 13:52:19 localhost postfix/smtpd[25133]: connect from col0-omc1-s18.col0.hotmail.com[65.55.34.28] May 14 13:52:20 localhost postfix/smtpd[25133]: 22ED0432EF: client=col0-omc1-s18.col0.hotmail.com[65.55.34.28] May 14 13:52:20 localhost postfix/cleanup[25137]: 22ED0432EF: message-id=<[email protected]> May 14 13:52:20 localhost postfix/qmgr[25091]: 22ED0432EF: from=<[email protected]>, size=1528, nrcpt=1 (queue active) May 14 13:52:20 localhost postfix/smtpd[25133]: disconnect from col0-omc1-s18.col0.hotmail.com[65.55.34.28] May 14 13:52:22 localhost postfix/smtp[25138]: 22ED0432EF: to=<[email protected]>, orig_to=<[email protected]>$ May 14 13:52:22 localhost postfix/qmgr[25091]: 22ED0432EF: removed
由于您的虚拟地图是创buildvirtual文件后的hashtypes(由hash:在configuration行中指定),您需要通过运行postmap /etc/postfix/virtual来创build地图。
根据日志中的错误,您还需要运行postalias /etc/aliases因为它抱怨没有aliases.db文件。
在你的virtual_alias_domainsconfiguration行中有一个错字。 域的第一个字母是Q而不是G.
virtual_alias_domains = qintegraconstruccion.com
如果这存在于你的实际configuration文件中,并不仅仅是这个问题中的一个错字,它也需要修复。
最后,在您提供的日志示例中似乎有一个成功转发的电子邮件。 消息1BC40432EF已成功发送给Google。 谷歌可能已经放弃了电子邮件接受后,但他们确实接受。
一般的可交付性对你很重要。 由于您没有运行Google Apps for Business,因此您无法在Google中将您的IP地址列入白名单。 所以你必须遵守所有正常的最佳实践。 如果你确定无误,Gmail不应拒绝你的邮件。
myhostname指令一样。 我build议使用contacto.gintegraconstruccion.com因为它已经指向正确的IP地址。 gmail.com那么任何支持SPF的主机都会拒绝你的邮件,因为你的IP地址不在Gmail的SPFlogging中。 envelope-from地址由postfixconfiguration中的smtp_helo_name行设置。