At 04:26 2001-11-14 -0500, Paul Chvostek wrote:
Is it a bad idea to filter mail being sent to majordomo?
You want to put a filter in front of majordomo? No problem.
If you check your aliases definitions (which may not be in
/etc/mail/aliases, but in a majordomo-specific aliases file, also included
into your procmail configuration), you should note that majordomo is
invoked as as a program which the message is piped to. Thus having Mlocal
set to procmail doesn't give you the ability to do a global procmailrc --
you need to explicitly invoke procmail in front of the majordomo program
somelistalias: "|/usr/local/bin/procmail -m /path/somefilter.rc
\"original majordomo filter command, sans the leading pipe\""
(you need to make a similar tweak to each and every list - just the inbound
list, though you can set up procmail filters on owner-list as well, those
should, by merit, be a different filter set.
In somefilter.rc, the default rule (at the bottom), you have:
Now, everything above that default rule, you can do whatever you want with
the message. I do pre-list checks for attachments, lack of reply trimmage,
etc, and bounce descriptive messages to the senders. Just like you would
if procmail were used anywhere else.
One caveat is that sendmail rewrites the sender if it finds an
owner-listname alias. This occurs BEFORE the message is passed on to
Mprog, so if you want the REAL envelope information (useful for generating
bounces), you should set sendmail up to add an X-Envelope-From: header (see
archives) so your procmail rules can use _THAT_ header instead of From_
when sending bounces.
I get *tonnes* (metric of course) of spam to majordomo, and most of it
generates majordomo responses that generate MAILER-DAEMON
bounces. Anybody have a nice set of recipes that'll stop the nasties
before procmail has a
chance to reply to them?
Ditch spam before it gets into majordomo. That's not the purpose of the
filter set I just implemented for an associate (running several large
international mailing lists), but pretty much the same principles which
apply to filtering your own mailbox would apply there - just keep in mind
that when you throw out a message, it in't your own inbox you're cleaning -
it's a mailing list, and you could be ditching a specific user's email...
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
procmail mailing list