Best way to do complex mail filtering and rewriting

3 posts / 0 new
Last post
#1 Tue, 04/26/2016 - 01:26
jasonut

Best way to do complex mail filtering and rewriting

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:

  • all emails ending in *govt.us to be bcc'ed to mailing list tenders@example.com
  • all emails ending in *com.au to be bcc'ed to mailing list australia-clients@example.com
  • all other external emails (both incoming and outgoing) (i.e. not ending with @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?

Tue, 04/26/2016 - 02:14
AustinTX

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.

Fri, 04/29/2016 - 05:23
jasonut

Anybody?

Topic locked