procmail
[Top] [All Lists]

regular expression syntax

2003-08-27 15:52:05
Just curious, if the "{" open curly bracket symbol indicates the
beginning of a sub block of rules, how does one apply a specific
number of characters to a rule?

For example, does this syntax work?

:0:
* ^From: root
* ^To: root@([^.]\{3-10}\.)?(sonny|liston)\.
* ^Subject: .*[0-9]\{2}/[0-9]\{2}/[0-9]\{2}:[0-9]\{2}\.[0-9]\{2} system check
systemcheck

The ^To containing \{3-10} of any character not a dot is an optional
hostname.  All hosts in the sonny or liston domain have names that
are between 3 and 10 characters long.

This question applies for the ^Subject too.  I am looking for 2 numbers,
slash, 2 numbers, slash, 2 numbers, colon, 2 numbers, dot, 2 numbers.
(Mo/Day/Yr:hr.min)

I could write these out with exact hostnames using | separators, and
the numbers could be specified to each character, but then I would have
to modify the script every time a hostname was changed or added to the
domain, and I want to be strict enough that someone doesn't try to
spoof an address ouside the boundries of the rule.  We may even be
considering renaming hosts to have exactly 6, 7, or 8 character names.

As always, thanks for any input.

Dan Liston


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>