![postfix:針對特定接收者封鎖特定傳送者](https://rvso.com/image/617838/postfix%EF%BC%9A%E9%87%9D%E5%B0%8D%E7%89%B9%E5%AE%9A%E6%8E%A5%E6%94%B6%E8%80%85%E5%B0%81%E9%8E%96%E7%89%B9%E5%AE%9A%E5%82%B3%E9%80%81%E8%80%85.png)
我用 amavis 和 postfwd 安裝了 postfix。我想僅為單一接收者阻止單一發送者。我嘗試使用 header_checks 但多行檢查我在想類似的事情
id=BLOCKIT
[email protected]; [email protected]; action=REJECT no sender
在 postfwd 上,但我找不到正確的語法...有人有什麼建議嗎?
答案1
我不知道如何在 中執行此操作postfwd
,但在 Postfix 中,您可以使用限制類別為了這。例如,如果您想阻止[email protected]
向您的用戶發送郵件[email protected]
:
smtpd_restriction_Classes = mail_for_alice
mail_for_alice = check_sender_access hash:/etc/postfix/mail_for_alice
smtpd_recipient_restrictions =
...
check_recipient_access hash:/etc/postfix/special_recipients
該文件special_recipients
將包含類似以下的行
[email protected] mail_for_alice
並且mail_for_alice
將包含:
也就是說,你是大概最好在postfwd
;-)中完成所有這些工作
答案2
我已經使用完成了類似的任務後灰。您可以安裝 postgrey 並停用灰名單功能,但保留白名單和黑名單功能。許多人認為 Postgrey 具有侵入性,但我發現它是一個近乎完美的垃圾郵件過濾器。