What is the best way to do complex mail filtering / redirection / re-writing in a typical virtualmin setup?
I vaguely understand that dovcot can use some sieve extension (the same thing that exim uses), I also understand that the typical virtualmin bundle of postfix+dovcot+procmail+roundcube includes procmail.
The tasks we want to do are a conditional bcc's and message mangling and forwarding.
Conditional bcc's. I know a little about sender_bcc_maps and recipient_bcc_maps, but we want something almost like this but subtly different. Say for example we want:
*govt.us
to be bcc'ed to mailing list tenders@example.com
*com.au
to be bcc'ed to mailing list australia-clients@example.com
@example.com
to be bcc'ed to clients@example.com
Even a bit more complicated for the emails we forward to clients@example.com
, our crm hub spot needs the forwards to be sent as if we did a "forward" in our email client, thus the email needs to be changed to something like:
Header:
From: jason@example.com
Body:
From: {{original-from}}
{{original-body}}
So basically complex filtering. What would be a good starting point within virtualmin to tackle this?
Watching topic. I spent the last couple of days being foiled by spamassassin, trying to simply strip html/mime out of emails ending in nextdoor.com, leaving the txt half, and deliver them normally. Spamassassin allows for per-user config files but ignores the particular commands which would help me, in favor of the global settings. Procmail also seems to just want global settings.
Anybody?