I have a tricky one here!
I have a dinamic list of some... 3000 email addresses that I need to filter on Postfix.
I need that if any of these addresses sends an email to (support@mydomain.com or priority@mydomain.com) the email gets redirected to low-prio@mydomain.com and put it into a folder named inbox/lowprio
I cant use just header checks, because, all mail from this users would be treated. So I am guessing that I need a header check that forwards the process to a milter that finishes it.
The concept in my mind goes like this:
Header Checks:
TO:^(.*)support@mydomain.com FILTER relay:[127.0.0.1]:10027
TO:^(.*)priority@mydomain.com FILTER relay:[127.0.0.1]:10027
In Master.cf create the filter that will catch the flow:
[127.0.0.1]:10027 inet n n n - 0 spawn
user=nobody argv=/usr/local/mail_filter.pl
In the Perl file, get the {mail_addr} and if it is in the list, exit with a REDIRECT command. Maybe also APPEND a Header like: X-final-folder : Inbox/lowprio
This Header, would allow a Sieve to catch it and move the mail into the specified folder...
I am really struggling with this, so any help is welcome, thanks!