我有一个postfix服务器与以下main.cf文件(我只会显示相关的信息):
smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
现在每次我想通过中继服务器从一个域中继消息,我需要将数据添加到/etc/postfix/sasl_passwd和/etc/postfix/sender_relay文件中:
/等/后缀/ sasl_passwd
@example.com myuser:mypass1234
/等/后缀/ sender_relay
@example.com [relay.example.com]:587
而这对我来说似乎非常多余。
我的问题
我想知道是否有一种方法只使用/etc/postfix/sasl_passwd文件,并定义一个全局的relayhost = [cluster.securitybox.cl]:587并告诉Postfix,如果这个域被列在/etc/postfix/sasl_passwd文件使用该全局中继,如果不是,则不使用任何中继。 或者任何其他选项,我不必将数据写入单独的文件。
根据Postfix文档,这似乎是可能的
如果您有创意,那么您可以尝试将这两个表组合成一个MySQL数据库,并configuration不同的Postfix查询来提取相应的信息。