[Mailman-Users] Attachment handling query and/or feature request

Paul Tomblin ptomblin at xcski.com
Tue Apr 4 21:35:11 CEST 2000

Quoting Michael Sweeney (sweeney at projectcool.com):
> A previous list server we've used had a capability of blocking attachments 
> to list mail and I've searched in vain for a way to do that with mailman. 
> Is it possible? If not, what would it take to add that as a feature in a 
> future rev? Another feature I would like to see is the option of 
> disallowing formatted mail, eg HTML or RTF since the lists I run have many 
> members who don't use MIME enabled readers to get their mail.
> Any strategies for handling those things?

Run the email through procmail before it gets to mailman.

These instructions probably only work for the procmail that comes with RedHat
Linux, but I have a procmail file in /etc/procmailrcs that belongs to "nobody"
(because that's the userid mailman expects to get email from).  That procmail
file does a lot of spam detection and rejection, and then at the end, if the
mail passes all the other tests, it does:
    |/usr/home/mailman/mail/wrapper post ${MAILMAN}

In my aliases file, for each mailing list, instead of invoking it with the
    lugor-announce: "|/usr/home/mailman/mail/wrapper post lugor-announce"
I instead do:
    lugor-announce: "|/usr/bin/procmail -m MAILMAN=lugor-announce /etc/procmailrcs/mailman"

Doing all these sorts of rejections can be easy with procmail and formail, or
you can get quite complicated.  For instance, you could use the following rule
to block anything with embedded scripts and send a nasty message back (I
haven't tested this, but it's based on a ruleset it I use):

:0 BHh
* !^Subject: .*\(fwd\)
* !--.*forwarded message --
* !^forwarded message:
* -1000^0
*  -200^1   ^[:;#>]
*  -600^1    ^Subject:.*spam
*  -200^1    UCE
*  1100^1    script language="JavaScript">
*  1100^1    script language="LiveScript">
*  1100^1    ^function TripodShowPopup\(\)$

 :0 c:

 :0 c: spamtemp.lock
 | (formail -rt -I"From: postmaster"; cat nasty_message; echo "----";\
      cat spamtemp; rm spamtemp) | sendmail -oi -t

Paul Tomblin <ptomblin at xcski.com>, not speaking for anybody
"Cause geeks like us, baby we can hack the Sun" - Joe Thompson

More information about the Mailman-Users mailing list