使用後綴拒絕傳送到特定電子郵件地址的電子郵件

使用後綴拒絕傳送到特定電子郵件地址的電子郵件

我想拒絕任何發送到以下地址的入站電子郵件[電子郵件受保護],更多人想要的例子是內部通訊群組/別名。

我嘗試過 header_checks 但沒有成功:

zmlocalconfig -e postfix_header_checks="pcre:/opt/zimbra/conf/custom_header_checks"

/opt/zimbra/conf/custom_header_checks 的內容

/^To:[email protected]/ REJECT Mailbox no longer valid

但是我仍然沒有收到拒絕。

我還嘗試了一些配置使用 Postfix 拒絕向特定收件者發送電子郵件因為他的配置是相反的,這正是我正在尋找的。

zmlocalconfig -e smtpd_recipient_restrictions=check_recipient_access hash:/opt/zimbra/conf/custom_recipient_blocklist

/opt/zimbra/conf/custom_recipient_blocklist

[email protected]/ REJECT

這也沒有如預期工作。

答案1

該問題未hash列出在postconf -m

最終配置來自每個地址的存取控制

postconf -e smtpd_recipient_restrictions='reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unlisted_recipient, reject_invalid_helo_hostname, reject_non_fqdn_sender, check_recipient_access lmdb:/opt/zimbra/conf/postfix_recipient_access, permit'

/opt/zimbra/conf/postfix_recipient_access 的內容

[email protected] REJECT

接收至:[電子郵件受保護]

554 5.7.1:收件人地址被拒絕:訪問被拒絕

為了做出改變,

echo [email protected] reject >> /opt/zimbra/conf/postfix_recipient_access
postmap /opt/zimbra/conf/postfix_recipient_access

相關內容