[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Getting Mail Bombed!



There must be one assumption here and that is that the mail server is Linux
(or some Unix variant) so therefore this can be handled with *relative*
ease.

Try this little number in your global /etc/procmailrc accompanied by a small
shell script (at the foot of this email) to clean up the mess in
/home/crapper every so often


####################cut below this line###################
# purpose
# recipe mangles attachments of filename type defined, converts them into
# files called "1.txt" and moves the email into the crapper (/home/crapper)
# It's easy to add an autoresponder to this if you want to automagically
tell
# someone they sent you a nastygram and they should clean their system PDQ
# customization
# This recipe can be extended almost limitlessly if you wish to define new
# filenames. For example, if you wish to add ".bat" (and that might
# be a "Good Thing" ©) add the filename into the filename line, preceded
# by a pipe "|" so in this case:
#  *filename=".*\.(vbs|wsf|eml|shs|exe|nws|chm|pif|vbe|hta|scr)"
# becomes:
# *filename=".*\.(vbs|wsf|eml|shs|exe|nws|chm|pif|vbe|hta|scr|bat)"
#Then build your regexp:
#'s/\([nN][aA][mM][eE]=".*\.[bB][aA] [tT]\)"/\1.txt"/' \
#                     -e \
#and you're good to go with a new filetype!

:0
*^Content-type: (multipart/mixed|application/octet-stream)
{
    :0 HB
    *^Content-Disposition: (attachment|inline);
    *filename=".*\.(vbs|wsf|eml|shs|exe|nws|chm|pif|vbe|hta|scr)"
    {
       SHELL=/bin/bash
       :0 fhbw
       |/bin/sed -e \
's/\([nN][aA][mM][eE]=".*\.[vV][bB][sS]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[wW][sS][fF]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mN][eE]=".*\.[eE][mM][lL]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mN][eE]=".*\.[nN][wW][sS]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[sS][hH][sS]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[eE][xX][eE]\)"/\1.not"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[cC][hH][mM]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[pP][iI][fF]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[hH][tT][aA]\)"/\1.txt"/' \
                     -e \
's/\([nN][aA][mM][eE]=".*\.[vV][bB][eE]\)"/\1.txt"/' \
                     -e \
v's/\([nN][aA][mM][eE]=".*\.[sS][cC][rR]\)"/\1.txt"/' \
                     -e \
       {
        :0:crapper.lock
        /home/crapper
         }
        }

Next, add a cron job to "flush the crapper"  I flush mine every 4 days or so
(I know...I know it's not terribly hygenic but WTF) :-) :-) this is best
accomplished with a quick homebrewed shell script unimaginatively named
"flush.sh" and consisting of the following:

#!/bin/sh
# Periodically flush files older than x days (one day in this example)

find /home/crapper -type f -ctime +1 | xargs rm

[HTH] Hope This Helps (someone)
Regards to all,
-Colin
--
Colin J. Raven