答案1
您可以使用限制类。请参阅:
- http://www.postfix.net/postconf.5.html#smtpd_restriction_classes
- http://www.postfix.net/RESTRICTION_CLASS_README.html。
例如:
/etc/postfix/main.cf:
smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/protected_destinations
...
smtpd_restriction_classes = bad_senders1
bad_senders1 = check_sender_access hash:/etc/postfix/bad_senders1
/etc/postfix/bad_senders1:
[email protected] REJECT You are not welcome here.
...
/etc/postfix/protected_destinations:
[email protected] bad_senders1
...
现在,只有当邮件发送到“protected_destinations”列表中右侧指定了“bad_senders1”限制类别的地址时,其信封发件人地址属于“bad_senders1”限制类别的电子邮件才会被拒绝。
记得跑后图对于新创建的文件。