Discussion:
regex testing for postfix
pw
2007-07-31 15:45:45 UTC
Permalink
Hello,

I am messing with regular expressions in
my postfix header_checks file. I am using
posix regular expressions.

Is there a utility to test expressions
so I don't need to keep restarting and
futzing with postfix?

Also I keep running into dissimilarities
between regex used by various applications
and posix regex ie: gawk,sed,others.
Does posix regex only happen in the shell
or is there one application that uses the
limited standard?


Lastly, with respect to postfix, I am
wondering if regex is truely the way to go
for filtering headers. Is there a way to
pipe email through a script *BEFORE* it
gets to postfix?


Thanks on any or all counts,

Peter
Ronald Schouten
2007-07-31 15:52:23 UTC
Permalink
I can't answer all your questions, but this is an awesome site for
information on Regex's in general. They even have reference material on
Posix:

http://www.regular-expressions.info/posix.html

Ron
Post by pw
Hello,
I am messing with regular expressions in
my postfix header_checks file. I am using
posix regular expressions.
Is there a utility to test expressions
so I don't need to keep restarting and
futzing with postfix?
Also I keep running into dissimilarities
between regex used by various applications
and posix regex ie: gawk,sed,others.
Does posix regex only happen in the shell
or is there one application that uses the
limited standard?
Lastly, with respect to postfix, I am
wondering if regex is truely the way to go
for filtering headers. Is there a way to
pipe email through a script *BEFORE* it
gets to postfix?
Thanks on any or all counts,
Peter
_______________________________________________
Discuss mailing list
http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
pw
2007-07-31 16:45:51 UTC
Permalink
Thanks Ron,

I also found a bit of info regarding redirecting
checks from postfix to amavisd via the header_checks
file. This may be a way to work in some perl scripting.

I just want to get rid of any non-local email addresses
from the 'To:' field in the headers, leaving any local addresses.
Since they are comma delimited it may be nice to use perl to
handle the stripping and reformatting.

Peter
Post by Ronald Schouten
I can't answer all your questions, but this is an awesome site for
information on Regex's in general. They even have reference material on
http://www.regular-expressions.info/posix.html
Ron
Ken
2007-07-31 22:15:31 UTC
Permalink
Post by pw
Since they are comma delimited it may be nice to use perl to
handle the stripping and reformatting.
http://www.postfix.org/PCRE_README.html
--
Ken

echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlb xq |dc
pw
2007-07-31 22:51:44 UTC
Permalink
Post by Ken
Post by pw
Since they are comma delimited it may be nice to use perl to
handle the stripping and reformatting.
http://www.postfix.org/PCRE_README.html
Thanks Ken,

I've actually delved deep into the bowels of
this monster already. pcre only relates to the
style of regular expression you use via
main.cf. You have the choice of 'regex'
which is the system posix regular expression
parsing or 'pcre', the perl regular expressions.

ie: in main.cf

header_checks = regex:/etc/postfix/header_checks

OR

header_checks = pcre:/etc/postfix/header_checks


Neither technique allows much leeway for doing much
other than search and replace for known values.
PCRE doesn't, as far as I can tell, allow for a
fully implemented perl script, just perl-regex.

Peter

Gary Gauthier
2007-07-31 16:40:53 UTC
Permalink
Hey Peter,

I used to use this site to do my testing a while back.

http://www.rexv.org/

it also tests syntax in other regex versions and languages.

Ttyl, Gary
Post by pw
Hello,
I am messing with regular expressions in
my postfix header_checks file. I am using
posix regular expressions.
Is there a utility to test expressions
so I don't need to keep restarting and
futzing with postfix?
Also I keep running into dissimilarities
between regex used by various applications
and posix regex ie: gawk,sed,others.
Does posix regex only happen in the shell
or is there one application that uses the
limited standard?
Lastly, with respect to postfix, I am
wondering if regex is truely the way to go
for filtering headers. Is there a way to
pipe email through a script *BEFORE* it
gets to postfix?
Thanks on any or all counts,
Peter
_______________________________________________
Discuss mailing list
http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
--
There is no theory of evolution, just a list of animals Chuck Norris has
allowed to live....
pw
2007-07-31 16:55:03 UTC
Permalink
Thanks Gary,

That's a pretty good site.

Peter
Post by Gary Gauthier
Hey Peter,
I used to use this site to do my testing a while back.
http://www.rexv.org/
it also tests syntax in other regex versions and languages.
Ttyl, Gary
Ronald Schouten
2007-07-31 17:19:33 UTC
Permalink
Gary, that _is_ a great site. Definitely bookmarking for future. Thanks for
sharing.

R
Post by pw
Thanks Gary,
That's a pretty good site.
Peter
Post by Gary Gauthier
Hey Peter,
I used to use this site to do my testing a while back.
http://www.rexv.org/
it also tests syntax in other regex versions and languages.
Ttyl, Gary
_______________________________________________
Discuss mailing list
http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
Loading...