[vox-tech] procmail list marking - help needed

Samuel N. Merritt vox-tech@lists.lugod.org
Thu, 9 Oct 2003 11:37:57 -0700


--CE+1k2dSO48ffgeK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 09, 2003 at 11:07:43AM -0700, Bill Kendrick wrote:
>=20
> I have Procmail entries like this one:
>=20
> :0
> * ^To:(.*\<)?mysql@lists.mysql.com
> { TAG=3D[mysql] }
>=20
> (where "TAG" is a little function to shove a string at the beginning
> of the subject line, much like what's done on MOST lists I subscribe
> to, like vox-* do here at LUGOD)
>=20
>=20
> However, as you can see, it only checks the "To:" line.
> Sometimes people reply to a poster, and then Cc the list.
>=20
> I'm always afraid to play with my live .procmailrc file, and don't
> really have a 'test' environment (I'm sure someone'll explain an easy
> way to test stuff on the shell ;^) ), but would something like this
> work?
>=20
> :0
> * ^(To:|Cc:)(.*\<)?mysql@lists.mysql.com
> { TAG=3D[mysql] }

Look at procmail's built-in TO macro. It catches To:, Cc:, Bcc:, and a
few other common ones. Then, that would be
* ^TO(.*\<)?mysql@lists.mysql.com

A more reliable way to match list posts is to look for a list-specific
header. I know that Mailman-based lists put a List-Id: header in any
messages that are sent out to the list, and ezmlm may do the same. Using
this kind of a header will even catch people that BCC the list or
don't have the list address in their headers for some other reason.=20

For example, my procmailrc has the following recipe for vox:=20
:0:
* ^List-Id:.*vox\.lists\.lugod\.org
lugod


> Man, I need to brush up on regexp I think ;)
>=20
> Thx for helping a pitiful procmailer,
>=20
> -bill!
>=20
> --=20
> bill@newbreedsoftware.com                           Got kids?  Get Tux Pa=
int!=20
> http://newbreedsoftware.com/bill/       http://newbreedsoftware.com/tuxpa=
int/

--=20
Samuel Merritt
OpenPGP key is at http://meat.andcheese.org/~spam/spam_at_andcheese_dot_org=
.asc
Information about PGP can be found at http://www.mindspring.com/~aegreene/p=
gp/

--CE+1k2dSO48ffgeK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/hasFW3tuPJ1t7wURAgzJAJ9PG2eVn67qvYak0pyjvMeJAr8u4gCggwlu
+4hhLppK0q1HgPqZEVOO8Mw=
=KAQi
-----END PGP SIGNATURE-----

--CE+1k2dSO48ffgeK--