我已经使用 MYSQL 在 postfix 中定义了全局白名单,其选项如下:
smtpd_recipient_restrictions =
reject_invalid_hostname,
check_client_access mysql:/etc/postfix/client_whitelist
check_sender_access mysql:/etc/postfix/sender_whitelist
check_recipient_access mysql:/etc/postfix/recipient_whitelist
permit_mynetworks,reject
内容/etc/postfix/client_whitelist
host = localhost:3306
user = root
password = password
dbname = postfix
query = SELECT restriction FROM client_whitelist WHERE client = "%s" AND status = "1";
mysql 表
+---------------+-------------+--------+
| client | restriction | status |
+---------------+-------------+--------+
| 192.168.66.18 | OK | 1 |
| 192.168.66.92 | OK | 1 |
| 192.168.66.93 | REJECT | 1 |
+---------------+-------------+--------+
我有相同的发送者和接收者表格。我的主要问题是我在 Postfix 后面有多个域,我想过滤客户端/发送者,同时考虑哪个是接收者。例如:
Mail from 192.168.66.92 and sender "[email protected]" IS ALLOW to "[email protected]"
Mail from 192.168.66.92 and sender "[email protected]" IS NOT ALLOW to "[email protected]"
Mail from 192.168.66.18 IS ALLOW for recipient or domain "domain1.com"
Mail from 192.168.66.18 IS NOT ALLOW for recipient or domain "domain2.com"
有什么方法可以在 postfix 中实现这一点吗?我一直在 Google 上搜索,但没有找到。
另一方面,我考虑放置一个“后缀代理”来重定向到另一个后缀实例,每个实例过滤每个域。但我不确定这个环境的性能,即使这是可能的。