[Mimedefang] tagging and redistributing selected messages

Fred Bacon fred.w.bacon at gmail.com
Sat Feb 4 12:59:27 EST 2012


I'm working on a small project at my company to help streamline some
of our internal processes, and I thought that I would seek some advice
about one of my plans.

We've been using mimedefang and spamassassin for years to tag and get
rid of spam, viruses, etc..  But the thought occurs to me that we
might use them for another purpose.  We're a small scientific R&D firm
and we subscribe to a lot of technical journals, and we monitor even
more. One of our librarian's tasks is to subscribe to table of
contents alerts for a hundred plus journals.  She then redistributes
them to all of the technical people in the company, regardless of
their area of expertise.  This is a painful process both for her and
for our employees.  She can't maintain separate mailing lists for each
journal, so everyone gets everything.  So here's my plan to solve this
problem.  If you have any suggestions about how to make this work (or
for a more sensible alternative) please let me know.

I'm setting up a GNU Mailman mailing list (internal to the company)
that uses "topics" to allow individuals to select which tables of
contents they want to receive.  To do this, we need to identify and
tag all incoming messages which are tables of content alerts.  To do
this, I'm writing a set of rules for SpamAssassin that will identify
the TOC alerts using a set of rules for each journal.  So the Journal
of Physical Chemistry will have a SpamAssassin rule with the name
JPhysChem and a score that is either neutral or negative.

When I call SA from within my MIMEDefang filter, I'll split the return
list of matched rules and check them against a hash table of known
journal tags.  If one of the tags on a message is in the table, then
mimedefang will add two new headers to the message: "X-TOC: true" and
"Keywords: JPhysChem" (for example).  The actual keyword will be the
SA rule name that was matched from the table.  The message will then
continue on to the librarian's mail account.

We run a cyrus imap system with server side filtering performed by
sieve.  The librarian's sieve script will detect messages with the
X-TOC header and redirect them to the GNU Mailman mailing list.
Mailman will then use the Keywords field to determine who wants that
TOC alert based on its topics list.

Now, does this sound reasonable, or is it too complex?  What is the
best way to import the necessary hash tables into my
mimedefang-filter?  Is there a simpler way to achieve the same effect?
 It occurs to me that each of these messages will pass through the
system twice with my current technique.  I could bypass the analysis
with previously tagged message, or perhaps I should have mimedefang
change the recipient of the tagged messages?

Thanks in advance for any suggestions!

Fred Bacon
Senior Scientist
Aerodyne Research, Inc.



More information about the MIMEDefang mailing list