Artificial intelligent assistant

postfix filter incoming mails based on 'mail from' and 'rcpt to' I want to reject emails to my postfix server based on more than one criteria, specifically I want to block emails from Russian email addresses (or that contain Cyrillic characters, but this I suspect is harder) that are addressed to two specific recipients (but not if addressed to others). I feel this should be straightforward especially since the 'mail from' and 'rcpt to' addresses are both supplied right at the start of the smtp negotiation. But I can't find a way to do this with postfix, and am not sure if I need some add-on package (milter?).

Add in a restriction class. For example:


/etc/postfix/main.cf:
smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/recipient_access

smtpd_restriction_classes = no_russians
no_russians = check_sender_access pcre:/etc/postfix/no_russians


/etc/postfix/recipient_access:
recipient1@mydomain.com no_russians
recipient2@mydomain.com no_russians

/etc/postfix/no_russians:
/\.ru$/ REJECT

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f19fc238f083a7eae27a7a8a27036e3b