使用Postfix特定于和来自特定的黑名单

我有一个场景,我需要将电子邮件从一封电子邮件黑名单到我们的本地电子邮件之一。 阻止这个特定的情况下可能在后缀

例如,从[email protected][email protected]的电子邮件应该是黑名单,而不是来自[email protected]的其他电子邮件。

你可以使用限制类。 看到:

例如:

/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 ... 

现在,在“bad_senders1”限制类中包含信封发件人地址的电子邮件将被拒绝,但只有在发送到在右侧指定了“bad_senders1”限制类的“protected_destinations”列表中的地址时才会被拒绝。

请记住为新创build的文件运行postmap 。