在一般被配置为直接发送邮件的postfix (internet-site)上,我希望为一些接收域实现一个条件头检查(在本例中,为了保持简单,只使用gmail.com),让postfix使用最聪明的。但是,它没有使用智能smtp.google.com进行身份验证,而是一直将邮件发送到:*@gmail* (如果我故意设置了错误的密码,它不会抱怨)。
我在/etc/后缀/中创建了以下文件:
relay_passwd:
smtp.google.com mygmailaccount@gmail.com:mypasswordheader_checks:
^To: <*@gmail*>/ FILTER relay:smtp.gmail.com:25并在main.cf中引用它们并提供其他选项:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
header_checks = regexp:/etc/postfix/header_checks现在,我对文件进行了映射(自从多次重新启动postfix以来):
# postmap relay_passwd
# postmap header_checks它发出了一个警告:
postmap: warning: header_checks, line 1: record is in "key: value" format; is this an alias file?但我想这不是问题所在吧?不管怎样,我肯定做错什么了。
我找到了以下线程,但它们不是我想要的:
main.cf中的订单相关吗?header_checks中的regexp可以吗?
发布于 2015-10-20 11:43:12
这应该可以做到,您的中继配置看起来很好。
/^To: (.*?)@gmail.com$/ FILTER smtp:smtp.gmail.com另外,您不需要对regexp文件进行后期映射。
来源:马塞洛格
https://serverfault.com/questions/730083
复制相似问题