procmail
[Top] [All Lists]

Re: filter number(_at_)foobar(_dot_)com

1999-08-07 20:54:38
At 01:42 +0200 8/8/99, Christophe Zwecker wrote:
era eriksson <era(_at_)iki(_dot_)fi> wrote:
instance) although I haven't experimented. (Hint: Match each body part
with an unrecognized type, and pass that in as JA_MIME_TYPE; repeat as
necessary.)

I played with that, but there can always an new unknown type, I was
looking for something that works all the time, IF there is such a thing.

Why not just dump any parts that aren't text/* (or text/plain, if you want to be more restrictive, though you might lose messages from mailers that use text/enriched, like exmh or Eudora).

This seems to cry out for a Perl script of some type. If an incoming message has a Content-Type: miltipart/mixed header, process each of the parts, and discard any that aren't text. You could also nuke any messages that don't have text parts at all. I could probably write a lousy implementation of this quickly, but I'll bet someone has done something like this before.

So you have a recipe that looks something like this:

:0
* ^TO[0-9][0-9][0-9][0-9][0-9][0-9](_at_)good\(_dot_)domain
{
   :0 fw
      /path/to/your/perl/script
   (insert the rest of your delivering recipe here)
}

It'd be cool to do this in procmail alone, but it sounds like it's more suited to some sort of script. Barring that, you could just use something like the first procmailsc(5) example to ditch mail over 'n' lines long.

Scott
--
Scott Fabbri                                               
smf(_at_)pobox(_dot_)com
Procmail spam filters enabled. Don't even bother trying. Zero tolerance.
I'm a resident of Virginia. Spam's illegal around these parts.
PGP key on standard servers.