X-Git-Url: https://git.donarmstrong.com/?p=remote_mail.git;a=blobdiff_plain;f=.procmailrc;h=48dbd1d02237ed7717436f3421a5ebc38c8bd534;hp=3492f4551fa3bc25c9b04b45231068332e659c7a;hb=a46d2cce24916584bc88175c6712387d2d6ef697;hpb=93eded7fb02715796d41a446b22ae381e560607f diff --git a/.procmailrc b/.procmailrc index 3492f45..48dbd1d 100644 --- a/.procmailrc +++ b/.procmailrc @@ -13,8 +13,8 @@ LOGFILE=$HOME/.procmail_log # TODO -:0 c: -$HOME/Mail/temp/ +#:0 c: +#$HOME/Mail/temp/ # Add filter for "your message to foo awaits moderator approval" # filter out owner mails @@ -23,6 +23,8 @@ $HOME/Mail/temp/ # where to send spam HIGHSPAM=spam/HIGHSPAM/ SPAM=spam/SPAM/ +JOEJOB=spam/JOEJOB/ +POSTMASTER=spam/POSTMASTER/ # A list (one per line) of people I KNOW are spammers :-) # can match any part of name so you can use fred, fred@aol.com or aol.com to @@ -51,6 +53,11 @@ FRIENDS=$HOME/.procmail/friends #:0 a: #/dev/null +:0 HB +* ^From:.*mailer-daemon@beta.sndservers.com +* ^Sender:.*Carpenters (Apprenticeship|Training) +/dev/null + :0 H * ^Subject:.*Rnm-devel moderator request /dev/null @@ -60,9 +67,10 @@ FRIENDS=$HOME/.procmail/friends /dev/null +# Handle delay messages :0 Hc * !Message-Id: .*delay[0-9]+@ -* ^TO \/don\+de[^@]+ +* ^TO \/don\+delay\+[^@]+ $HOME/Mail/delay :0 Hhbw @@ -70,38 +78,6 @@ $HOME/Mail/delay * ^TO \/don\+delay\+[^@]+ |/home/don/bin/delay_mail --mailto don@donarmstrong.com --enqueue --email --delay $MATCH - -# ========================================================================== -# Correct crap or broken mails using sed -# ========================================================================== -# Correct wrong sig-dashes, ie add a space for lines with only "--" in them: -# from: ^--$ -# to: ^-- $ -#:0 fBw -#* ^--$ -#| sed -e 's/^--$/-- /' - -# preconverts all plain-text mail arriving in certain encoded -# MIME formats into a more compact 8-bit format which can be -# used and displayed more easily by most programs. -#:0 -#* ^Content-Type: *text/plain -#{ -#:0 fbw -#* ^Content-Transfer-Encoding: *quoted-printable -#| mimencode -u -q - -#:0 Afhw -#| formail -I "Content-Transfer-Encoding: 8bit" - -#:0 fbw -#* ^Content-Transfer-Encoding: *base64 -#| mimencode -u -b - -#:0 Afhw -#| formail -I "Content-Transfer-Encoding: 8bit" -#} - # Convert old-style PGP messages to MIME :0 * !^Content-Type: multipart/ @@ -121,23 +97,11 @@ $HOME/Mail/delay -i "Content-Type: application/pgp; format=text; x-action=sign" } -###################################################################### -# Here we search the list of people we always want to get mail from, # -# and deliver the mail if it's from one of them, no matter what. # -# The FRIENDS file is set and described above. # -###################################################################### :0: * ! ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS) { -# $DEFAULT -# deliver to default mailbox - -#spamassasin is being run sitewide. - -# Mails with a score of 15 or higher are almost certainly spam (with 0.05% -# false positives according to rules/STATISTICS.txt). Let's put them in a -# different mbox. (This one is optional.) +# Mails with a score of 15 or higher are almost certainly spam :0: * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* #definetly_spam @@ -155,6 +119,26 @@ $HIGHSPAM $SPAM +# I get joe-jobbed a lot; if a message is from a mailer, but not from +# one of mine, discard it. +:0: +* (^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mailer|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|(s(erver)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$)) +* !^From:.+(ucr|debian|donarmstrong|sndservers|ccin|schedulesdirect|promtheuslabor.com) +* !^From:.+(schedulesdirect|paypal.com) +* !^To:.+ (don\+.+\@donarmstrong\.com) +* !^List-.+ +* !^X-Diagnostic: +$JOEJOB + +# stuff for postmaster at my machines +:0: +* ^To: postmaster@ +$POSTMASTER + +# mail from people I don't want to see, because they annoy me +:0: +* ^From:.*rgm@gnu.org +$HOME/Mail/idiots # Work around procmail bug: any output on stderr will cause the "F" in "From" # to be dropped. This will re-add it. @@ -168,68 +152,7 @@ $SPAM | sed -e 's/^rom /From /' } - - - -################################################################## -# SPAM filter. I don't like spam. I just don't # -################################################################## - -# Here we search a file with a list of people we _never_ want to -# get anything from, tossing the mail if it's from one of them. -# SPAMMERS is set and described above. -# Note, you can use the following line instead to be even more -# strict, they can't have even relayed it via an adress in the -# spammers file: -# * ? (formail -x From: -x Sender: -x Reply-To: -x Received: | fgrep -iqf $SPAMMERS) -:0: -* ? (formail -x From: -x Sender: -x Reply-To: | fgrep -iqf $SPAMMERS) -| formail -A "X-SPAM-RULE: address found in spammers file" >> $SPAM - -# look for X-Advertisement header or 'advertisement' in the subject, -# accounting for possible sp. error. "Nice" spammers use this header. -:0: -* ^X-Adverti[sz]ement: -| formail -A "X-SPAM-RULE: X-Advertisement header" >> $SPAM - -:0: -* ^Subject:.*adverti[sz]ement -| formail -A "X-SPAM-RULE: Advertisement in subject" >> $SPAM - -# snag the To: and From: headers -TO=`formail -zx To:` -CC=`formail -zx Cc:` -FROM=`formail -zX From: | formail -zrx To:` - -# no To: line AND no Cc: line. You could filter out anything with no To:, -# but there are lots of mailinglist idiots who Cc the list and don't To: -# anyone ;-) -:0: -* TO??^$ -* CC??^$ -| formail -A "X-SPAM-RULE: no To: or Cc: header" >> $SPAM - -# bogus pegasus header, very common with spammers, and I've never -# seen it used by anyone else. -:0: -* ^Comment: Authenticated sender is -* ! ^X-Mailer: Pegasus -| formail -A "X-SPAM-RULE: bogus pegasus header" >> $SPAM - -#large number of spaces then number in subject -:0: -* ^Subject:.*\ \ \ \ \ \ \ \ \ [0-9][0-9]+ -| formail -A "X-SPAM-RULE: too many spaces followed by number in subject" >> $SPAM - -#laser toner cartridges. (I mean, come, on!) -:0: -* ^Subject: laser cartridges -| formail -A "X-SPAM-RULE: laser cartridges suck" >> $SPAM - -} - # Debian role accounts - :0: * ^Delivered-To: (owner@bugs.debian.org) bugs.debian.org/ @@ -238,6 +161,10 @@ bugs.debian.org/ * ^Delivered-To: (listmaster@lists.debian.org) lists.debian.org/ +# Buildds +:0: +* ^Return-Path:.*buildd@.*.donarmstrong.com +buildd.donarmstrong.com/ # OFTC stuff :0: @@ -258,9 +185,25 @@ chili_alarm/ * ^From:\ noreply@dragongoserver.net lists/dragongo/ +# discard all yahoogroups mail +# except for those to rsult (riverside ultimate) +:0: +* !^To:.*rsult@yahoogroups.com +* ^To:.*@yahoogroups.com +/dev/null + + ################### # Mailing lists # -5B5B################### +################### + +:0: +* ^From:.*announcements@student.ucr.edu +lists/ucr-announcements + +:0: +* ^List-Id: +lists/ucr-announcements :0: * X-Mailing-List: <\/[^@]+ @@ -275,12 +218,12 @@ lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/ lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/ :0: -* ^Sender: \/[^@]+-bounces? -lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/[\/]/_/g'`/ +* ^Sender: +> $SPAM - - ##################################### # Last rule: Put mail into mailbox # #####################################