DevHeads.net

how to filter all mails by rule

I want to filter all the mails send to <a href="mailto: ... at example dot com"> ... at example dot com</a>. so I
create configuration at main.cf like below:

smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/filter_access,
reject_unknown_sender_domain,
permit

and create filter_access like below
filter_me@ FILTER fiilter_script:dummy

however bad mail from (like abc@abc) will be rejected before filter.
so I need to use additional configuration like:

smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/filter_access,
check_recipient_access hash:/etc/postfix/recipient_access,
reject_unknown_sender_domain,
permit

and create recipient_access like below:
filter_me@ OK

it seems a little complicated to use two config files to finish the
job. can I both "FILTER" and "OK" for all the mails send to
<a href="mailto: ... at example dot com"> ... at example dot com</a>?

thanks a lot for help!

Comments

Re: how to filter all mails by rule

By Wietse Venema at 06/08/2019 - 12:27

d tbsky:
Use a per-recipient table:

/etc/postfix/main.cf
check_recipient_access hash:/etc/postfix/recipient_access.pcre

/etc/postfix/recipient_access.pcre
/^me@/ FILTER blah:blah-
/./ reject_unknown_sender_domain

Wietse

Re: how to filter all mails by rule

By d tbsky at 06/09/2019 - 08:26

Wietse Venema < ... at porcupine dot org>
thanks a lot for the hint!!
I need to study it.