Lähettäjä: Eli Päiväys: Vastaanottaja: exim-users Aihe: [Exim] Slightly OT: email rules/filters based on info stored in sql?
I know this is slightly off topic of Exim, but I know quite a few of you out
there have some very nifty setups, so hopefully you can help stirr my mind
with some ideas...
I'm trying to implement domain and user level rules/filters that would
hopefully take place at ACL time and would be constructed from data
retrieved from (My)SQL.
For now I was going to keep the rules implementation somewhat simple by not
having conditionals like AND & OR to join multiple rules, but I'm still
having a heck of a time trying to figure out just how this could all be done
in a simple and hopefully elegant way.
The basis of the rules I was going to implement would be filtering off of
the following items:
All (all messages match)
Headers (any specified header)
Message size
Message body (text matching)
Attachment type (handled by exiscan)
Attachment name (again, exiscan)
The tests "is" (equal to), "not" (not equal to) and "like" (contains -
wildcard match) would be available for comparing any of those listed items
against any specified text. The following resulting actions would be
available if a rule matched:
Accept (continue message processing - not a guarantee that the message is
finally accepted and stored)
Discard (message is denied - no bounceback, rather if used in ACLs it will
deny the message, if not in an ACL, simply drops the message)
Reply (an autoreply sort of thing - I may yet choose not to allow this)
Forward (simply rewrite the recipient address to a new destination)
End (stop all further processing of rules)
End All (for domain level only - stop all rule processing and don't process
any user specific rules after)
Now I'm sure that's more info that you care to know, but I'm just mentioning
it incase anyone has any similar type rules in any of their setups that
they'd be willing to share with me. I have toyed with the idea of possibly
making wrapper scripts that would dynamically create filter files and such,
but at the moment I really don't know which avenue I may pick in the end, so
all suggestions are more than welcome.
If anyone wants this to continue off-list, just say so and I can simply CC
to anyone who wishes to remain in the discussion.
So, to sum up - I'm just looking for some working implementations or even
just concept ideas right now - I will fiddle with them myself and see if I
can get something working (I'm not looking to have others do all the work
for me!) and then I'd be happy to share what I accomplish with everyone.