procmail
[Top] [All Lists]

Moving large messages to spam folder

2017-02-12 20:22:35
Anything bigger than 100k has the subject appended as below. Lately
I've been getting messages from yahoo accounts that run about 630k give
or take that I know are spam and I'd like to have them moved with
procmail to my spam folder automatically. I found the 2nd formail
recipe below by doing some googling and put it into my .procmailrc.
Instead of using the sender IP I've been putting the CIDR into the
badips file - 98.136.192.0/18 for example. I don't want to filter out
all of yahoo because I have a few yahoo mailing lists I'm on. Does this
make sense or is there a much easier way to do this?

:0 fh w
* > 100000
* ^Subject:\/.*
| formail -I "Subject: {* -BIG- *} $MATCH"

:0
* ? formail -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" \
    | egrep -is -f /home/chris/badips
$JUNKMAIL

Thanks for any assistance
Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
20:06:05 up 9 days, 12:04, 2 users, load average: 0.07, 0.16, 0.17
Description:    Ubuntu 16.04.2 LTS, kernel 4.4.0-62-generic

Attachment: signature.asc
Description: This is a digitally signed message part

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail