我有在CentOS 6.3上运行的postfix v2.6.6,主机名为priest.ocsl.local(私有,内部域),有一些别名
supportpeople: [email protected], [email protected], [email protected] requests: "|/opt/rt4/bin/rt-mailgate --queue 'general' --action correspond --url http://localhost/", supportpeople help: "|/opt/rt4/bin/rt-mailgate --queue 'help' --action correspond --url http://localhost/", supportpeople
如果我使用默认的configuration离开postfix,那么别名会被正确parsing/正如我所期望的那样,所以传入[email protected]的邮件将通过rt-mailgate mailgate命令传送,并且被传递(通过ocsl.co.uk(一个可公开parsing的域名)的邮件服务器)发送到[email protected],user2等。
当我在/etc/postfix/main.cf定义mydomain = ocsl.co.uk时( mydomain = ocsl.co.uk传出邮件的目的,例如[email protected]),问题就出现了。 当我这样做,后缀继续正确运行pipe道命令,但它不再扩展嵌套的别名,我期望:而不是试图传递给[email protected],user2等,它试图发送到supportpeople @ ocsl.co.uk,上游邮件服务器上不存在,并生成NDR。 postconf -n用于非工作configuration(工作configuration只有“mydomain”这一行才有区别。
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost mydomain = ocsl.co.uk newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550
我们确实有事情,因为我们以前在运行Sendmail的旧系统上预期/想要的。
supportpeople值在$alias_maps没有域名部分,因此Postfix将追加$mydomain (因为$append_dot_mydomain )。 使用mydomain = ocsl.co.uk Postfix将supportpeople扩展为[email protected]并尝试将邮件路由到该域的MX。 为了避免这种情况,请将右侧的supportpeople值更改为您的Postfix是最终目标的完整地址,例如supportpeople@localhost 。
此外,要更改发件人地址,您将使用$myorigin ,而不是$mydomain 。