procmail
[Top] [All Lists]

Re: Moving large messages to spam folder

2017-02-15 21:57:15
On 2017-02-12 (19:19 MST), Chris <cpollock(_at_)embarqmail(_dot_)com> wrote:

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

I would do the following:

:0 fh w
* > 100000
{
  :0fw # Need to wait for filter to complete
  * ^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
}

(This assumes the formail works as you expect)

This way the only messages that are checked for badips are ones that are larger 
than 100,000 bytes.

Personally, Yahoo is dead to me now. All messages are rejected with a message 
about pathological lack of security. It forced two of my family members to stop 
using Yahoo as they could no longer email the rest of the family that is on my 
mail server. :)

I wouldn’t trust any email from yahoo, but that’s just me.

-- 
Apple broke AppleScripting signatures in Mail.app, so no random signatures.



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