Re: Moving large messages to spam folder

Chris <[email protected]> Thu, 16 Feb 2017 13:50:47 -0600
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
--===============1981305821==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-XN5hnG1LQ+CmFiM7hA2F"


--=-XN5hnG1LQ+CmFiM7hA2F
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, 2017-02-15 at 20:53 -0700, @lbutlr wrote:
> On 2017-02-12 (19:19 MST), Chris <[email protected]> wrote:
> >=20
> >=20
> > 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?
> >=20
> > :0 fh w
> > * > 100000
> > * ^Subject:\/.*
> > >=20
> > > formail -I "Subject: {* -BIG- *} $MATCH"
> >=20
> > :0
> > * ? formail -x"From:" -x"Sender:" \
> > =C2=A0=C2=A0=C2=A0=C2=A0-x"Reply-To:" -x"Return-Path:" \
> > =C2=A0=C2=A0=C2=A0=C2=A0| egrep -is -f /home/chris/badips
> > $JUNKMAIL
>=20
> I would do the following:
>=20
> :0 fh w
> * > 100000
> {
> =C2=A0 :0fw # Need to wait for filter to complete
> =C2=A0 * ^Subject:\/.*
> =C2=A0 | formail -I "Subject: {* -BIG- *} $MATCH"
>=20
> =C2=A0 :0
> =C2=A0 * ? formail -x"From:" -x"Sender:" \
> =C2=A0=C2=A0=C2=A0=C2=A0-x"Reply-To:" -x"Return-Path:" \
> =C2=A0=C2=A0=C2=A0=C2=A0| egrep -is -f /home/chris/badips
> =C2=A0=C2=A0=C2=A0=C2=A0$JUNKMAIL
> }
>=20
> (This assumes the formail works as you expect)
>=20
> This way the only messages that are checked for badips are ones that
> are larger than 100,000 bytes.
>=20
> 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. :)
>=20
> I wouldn=E2=80=99t trust any email from yahoo, but that=E2=80=99s just me=
.
>=20
Actually I thought of a better way:

:0 fh w
* > 625000
* ^From:.*@yahoo.com
$JUNKMAIL

and as I leave any yahoo lists I'm on I can remove the size modifier
from the recipe and just leave it as from yahoo.

--=20
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
13:46:09 up 13 days, 5:44, 2 users, load average: 0.88, 1.51, 1.29
Description:	Ubuntu 16.04.2 LTS, kernel 4.4.0-62-generic
--=-XN5hnG1LQ+CmFiM7hA2F
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEABECAAYFAlimApcACgkQ43Kn2pjmcFwm4wCfcLcWnE1E+6rUaf4C+te0OGE4
zOoAnRONzZgT4E+VN0ejaHEhttWp9kpO
=6dan
-----END PGP SIGNATURE-----

--=-XN5hnG1LQ+CmFiM7hA2F--


--===============1981305821==
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
https://mailman.rwth-aachen.de/mailman/listinfo/procmail
--===============1981305821==--