如何正确pipe理多个虚拟主机与后缀?

我打算在几天内为我们的产品正确设置一个后缀服务器。 服务器运行正常,但发送到Gmail的一些电子邮件被发送到垃圾邮件框。 服务器configuration如下:

/etc/postfix/main.cf中

mydomain = example.com myhostname = example.com mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, example.com, example.org, example.net virtual_alias_domains = example.org, example.net virtual_alias_maps = hash:/etc/postfix/virtual 

/etc/postfix/master.cf

 587 inet n - n - - smtpd -v smtp inet n - n - - smtpd -v 

/等/后缀/虚拟

 [email protected] user1 [email protected] user2 [email protected] user3 [email protected] user1 [email protected] user2 [email protected] user3 [email protected] user4 [email protected] user2 

我的工作SPF规则是10.0.0.1是example.com的假IP,它适用于example.com,example.net和example.org:v = spf1 mx ip4:10.0.0.1〜all


我已经configuration了MX DNS,rDNS,SPF,一切正常,工作。 只有经过身份validation的用户才能通过此服务器发送电子邮件。

所以,这里的问题是,如果从[email protected](与mydomain和myhostname相同)发送电子邮件,则电子邮件将被传递到收件箱。 如果我从[email protected]发送电子邮件,则电子邮件将被发送到垃圾邮件框。

看看电子邮件的标题不同之处在于:

到达垃圾邮件箱的那个

 Received: from example.com (mail.example.com. [10.0.0.1]) by mx.google.com with ESMTP id e69si1483476yhm.50.2013.03.07.06.42.23; Thu, 07 Mar 2013 06:42:23 -0800 (PST) Received-SPF: pass (google.com: domain of [email protected] designates 10.0.0.1 as permitted sender) client-ip=10.0.0.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 10.0.0.1 as permitted sender) [email protected] Received: from new-host-5.home (177.205.99.64.dynamic.adsl.gvt.net.br [177.205.99.64]) by example.com (Postfix) with ESMTP id 7EAB2D186F for <[email protected]>; Thu, 7 Mar 2013 09:42:22 -0500 (EST) From: User3 <[email protected]> 

在箱子到达的那个

 Received: from example.com (mail.example.com. [10.0.0.1]) by mx.google.com with ESMTP id a30si1434990yhm.294.2013.03.07.06.45.39; Thu, 07 Mar 2013 06:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of [email protected] designates 10.0.0.1 as permitted sender) client-ip=10.0.0.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 10.0.0.1 as permitted sender) [email protected] Received: from new-host-5.home (177.205.99.64.dynamic.adsl.gvt.net.br [177.205.99.64]) by example.com (Postfix) with ESMTP id A55BCD186F for <[email protected]>; Thu, 7 Mar 2013 09:45:38 -0500 (EST) From: User3 <[email protected]> 

我尝试用交通工具来改变电子邮件,通过它的IP发送每个人,但没有运气。 这是我的传输设置(尝试与名称和IP也):

 example.com smtp:10.0.0.1:25 example.net smtp:10.0.0.2:25 example.org smtp:10.0.0.3:25 

有人对如何解决这个问题有任何想法? 我认为,如果我可以通过mail.example.net设置[email protected]的出站而不是mail.example.com,则此问题将得到解决。 谢谢。


3个IP的DNSconfiguration非常相似,如下图所示:

 example.com A 10.0.0.2 example.com MX 10 mail.example.com example.com TXT v=spf1 mx ip4:10.0.0.1 ~all mail.example.com A 10.0.0.1 mail.example.com MX 1 mail.example.com mail.example.com TXT v=spf1 mx ip4:10.0.0.1 ~all example.net A 10.0.0.1 example.net MX 10 mail.example.net example.net TXT v=spf1 mx ip4:10.0.0.1 ~all mail.example.net A 10.0.0.2 mail.example.net MX 1 mail.example.net mail.example.net TXT v=spf1 mx ip4:10.0.0.1 ~all example.org A 10.0.0.3 example.org MX 10 mail.example.org example.org TXT v=spf1 mx ip4:10.0.0.1 ~all mail.example.org A 10.0.0.3 mail.example.org MX 1 mail.example.org mail.example.org TXT v=spf1 mx ip4:10.0.0.1 ~all 

另外,我有这些接口

 10.0.0.1: eth0 10.0.0.2: eth0.1 10.0.0.3: eth0.2 

这是我的ISP创build的rDNS设置:

 10.0.0.1 - example.com 10.0.0.2 - example.net 10.0.0.3 - example.org 

我曾要求:

 10.0.0.1 - example.com, example.net, example.org 

但他说这可能会导致识别我的电子邮件服务器的问题。 它想要像负载均衡一样,在一次提供不同的负载。


我已经更新了我的/etc/postfix/master.cf,如下所示:

 example.com:smtp inet n - n - - smtpd -o myhostname=example.com example.com:587 inet n - n - - smtpd -o myhostname=example.com example.net:smtp inet n - n - - smtpd -o myhostname=example.net -o smtp_bind_address=10.0.0.2 example.net:587 inet n - n - - smtpd -o myhostname=example.net -o smtp_bind_address=10.0.0.2 example.org:smtp inet n - n - - smtpd -o myhostname=example.org -o smtp_bind_address=10.0.0.3 example.org:587 inet n - n - - smtpd -o myhostname=example.org -o smtp_bind_address=10.0.0.3 

Postfix似乎忽略了-o smtp_bind_address = 10.0.0.2,因为它通过10.0.0.1来传递邮件。

问题是,后缀正在使用10.0.0.1所有的邮件。 这本身不是问题,因为您可以轻松地添加多个指向相同IP的虚拟域。

基本上我会以这种方式更改example.org等的logging。

example.org A 10.0.0.3
example.org MX 10 mail.example.org
mail.example.org CNAME mail.example.com

这样你的SPFlogging将是有效的,MXlogging,邮件服务器的logging等将对应于正确的IP。

也就是说,除非你有其他的理由来使用多个IP地址。