服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

后缀:如何根据发件人redirect一个电子邮件地址

我正在尝试向Postfix添加规则。 我的目标如下:当任何人([email protected])发送一封电子邮件到([email protected])转发到([email protected])。 如果[email protected]正在发送邮件,只需让它通过。 回顾一下,如果发件人不是[email protected],则将邮件redirect到[email protected]。 如果发件人是[email protected],则不要redirect。 仅供参考,[email protected]是在/ etc / postfix / virtual中定义的别名,它发送给多个收件人。 我正在使用pcre header_checks,但它根本不起作用 – 没有任何事情发生,所有的邮件像以前一样stream动,而不被redirect。 如果有一个更好/更简单的方法来做到这一点,我是所有的耳朵! 所以根据这篇文章和这篇文章中的说明,我将下面几行添加到了main.cf和headers_check: main.cf: header_checks = pcre:/etc/postfix/headers_check /等/后缀/ headers_check /To:[email protected]/ && /From:(?([email protected]).)*/ REDIRECT [email protected] 但是,没有任何反应。 所有邮件仍然被放入[email protected]。 我删除了“发件人”检查,看看是否可以抓取所有发送到[email protected]的邮件并redirect。 然而,这也没有工作。 我跑了 postmap -q "From:[email protected]\nTo:[email protected]" pcre:/etc/postfix/headers_check 并收到回复 && /(?([email protected]).)*/ REDIRECT [email protected] 我也重新启动后缀(后缀重新加载),以确保它已加载configuration。 另外请注意,这是一台拥有大量虚拟主机的机器,每个虚拟主机都有自己的电子邮件地址和别名。 所有的都在/ etc / postfix / virtual中合并。 感谢您有关如何完成此任务的任何build议!