procmail
[Top] [All Lists]

RE: rule to catch a certain number of characters

2007-05-26 05:26:39
wolfgang wrote on Saturday, May 26, 2007 12:26 PM:

Lately, I have received various similar mails with one line containg 
about 100,000 non-space characters.

To match those, I have tried a B rule with something like
[^ ]{10000}
but apparently that is not the correct syntax. How should it be done?

That "extended-egrep" syntax is not supported in procmail.
You will have to count.  You can do it in various ways.
One way might be to use scoring.  But see below for an
easy alternative.

There are problems with your algorithm otherwise, in any case.
The biggest one is, an encoded message such as MIME or uuencode
will also be caught by your condition.  Also, are you sure there
are no line-ends in these messages?

Do these messages have any spaces in them at all?  If not,
then I would look for them that way: "If there is a space,
this is not one of those messages."

  :0 B
  * $ $SPACE
  { } # do nothing

  :0 E:   # else
  $TRASH

This will probably catch single-part encoded files, though.
You could except them by having a condition excepting them
in the second recipe.  You would want to experiment a bit
with this.

If there are spaces otherwise, then you might simply be
reacting to multipart encoded messages.  If you don't want
any of those, just look for "Content-Type:.*multipart" and
trash them.  You don't need body greps for that.

Dallman


____________________________________________________________
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