我有一个运行Postfix的登台服务器,我只想设置邮件到example.org。 如果我们正在testing一个发送电子邮件的函数,我们希望能够知道我们不会意外地将任何testing消息发送给我们testing域之外的任何人。
所有的邮件都从这个服务器发送到智能主机进行传送。
我已经成立了
relay_domains = example.org smtpd_recipient_restrictions = reject_unauth_destination
这意味着服务器只能通过SMTP中继example.org。 但是,使用邮件(1)在服务器上,它将传递所有地址。 我怎样才能限制这只relay_domains?
没有人比尊敬的Postfix作者Wietse Venema 给了我们答案 :
也许用一个运输表,利用其特殊的语法:
/etc/postfix/main.cf transport_maps = hash:/etc/postfix/transport /etc/postfix/transport: example.org : * error:we do not deliver this domain以上将拒绝SMTP邮件,并反弹本地提交,除example.org以外的域名。