Postfix – 根据源服务器IP地址redirect邮件

我有一个testing后缀(2.6.6)服务器configuration为拦截所有出站电子邮件并将其存储在本地,以便开发人员可以testing客户端应用程序的电子邮件function,而不会垃圾世界。

服务器接受@ local.test的邮件,并接受来自cidr映射表中定义的服务器的邮件:

127.0.0.0/8 OK 10.0.0.0/24 OK 

testing服务器有5个虚拟用户([email protected][email protected]等),后缀被configuration为MTA和LDA,如VIRTUAL_README中所述。

我可以configuration服务器将所有中继邮件redirect到使用收件人规范类/地图的本地帐户之一,如本博客文章中所述 。

 recipient_canonical_classes = envelope_recipient recipient_canonical_maps = regexp:/etc/postfix/recipient_map /./ [email protected] 

但是现在我想要做的是根据源服务器的IP地址redirect邮件发送邮件,例如:

 10.0.0.1 -> [email protected] 10.0.0.2 -> [email protected] 10.0.0.3 -> [email protected] 

这些只有less数,所以我不需要任何dynamic映射,只需要一个简单的configuration文件就可以了。

任何人有任何线索我怎么能做到这一点?

谢谢,

将解决scheme从评论转换为CW

Postfix SMTP服务器访问表[手册页]支持REDIRECTfunction

 REDIRECT user@domain After the message is queued, send the message to the specified address instead of the intended recipient(s). Note: this action overrides the FILTER action, and currently affects all recipients of the message. 

结合这个functioncheck_client_access将是解决您的问题,即

 10.0.0.1 REDIRECT [email protected]