Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

Why the use of basic regexes instead of extended?

Why the use of basic regexes instead of extended?

2005-03-11 by Matt Kettler

Question, is there a reason the regcomp calls in acl.c do not use the 
REG_EXTENDED flag?

I'm kind of used to modern extended regex syntax including things like ? 
and + that are not supported in basic posix regexes. I'm also not used to 
the "backwards" behavior of \( and \{ in basic regex, something which 
caused one of my rules to not match correctly.

I've since patched my copy of acl.c and recompiled, but I'm wondering if 
there was a reason to specifically use basic regex, a standard which even 
according to posix is obsolete and only exists for backward compatibility, 
instead of the more modern extended syntax.

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-11 by manu@netbsd.org

Matt Kettler <mkettler@...> wrote:

> Question, is there a reason the regcomp calls in acl.c do not use the
> REG_EXTENDED flag?

No real reason. Would you like to contribute a patch for a reg_extended
flag in the config file? That's an easy one.

-- 
Emmanuel Dreyfus
Publicité subliminale: achetez ce livre!
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu@...

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-11 by Matt Kettler

At 04:51 PM 3/11/2005, manu@... wrote:

>Matt Kettler <mkettler@...> wrote:
>
> > Question, is there a reason the regcomp calls in acl.c do not use the
> > REG_EXTENDED flag?
>
>No real reason. Would you like to contribute a patch for a reg_extended
>flag in the config file? That's an easy one.

Sure.. it's quite trivial anyway.. See attached diff -u patch.

By the way, if you've got the patch, the following ACL will greylist hosts 
which are unresolvable and get sent down by sendmail as a bracketed IP 
instead of a hostname.

#greylist unresolvable hosts
acl greylist domain /\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\]/

The same could be done with the non-extended regexes, but the syntax is a 
bit different. To start with you'd need \{1,3\} instead of {1,3}.

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-11 by manu@netbsd.org

Matt Kettler <mkettler@...> wrote:

> >No real reason. Would you like to contribute a patch for a reg_extended
> >flag in the config file? That's an easy one.
> 
> Sure.. it's quite trivial anyway.. See attached diff -u patch.

Well I meant a patch adding a config file option...

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-11 by Matt Kettler

At 05:51 PM 3/11/2005, manu@... wrote:
>Matt Kettler <mkettler@...> wrote:
>
> > >No real reason. Would you like to contribute a patch for a reg_extended
> > >flag in the config file? That's an easy one.
> >
> > Sure.. it's quite trivial anyway.. See attached diff -u patch.
>
>Well I meant a patch adding a config file option...

Ahh, I can do that too. I'll look at writing it this weekend, spare time 
permitting.

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-19 by Matt Kettler

Matt Kettler wrote:

>
> At 05:51 PM 3/11/2005, manu@... wrote:
>
>> Well I meant a patch adding a config file option...
>
>
> Ahh, I can do that too. I'll look at writing it this weekend, spare
> time permitting.


I didn't have time to do it over the weekend, as I had trouble getting
sendmail set up on my home machine, but I did get it done a few nights
ago. This is a patch against 2.0b2, and it implements a config file
option "extendedregex" to enable extended regular expression syntax. It
defaults to being disabled (basic syntax mode).

The way I did it, you could add a "basicregex" option, and switch back
and forth in the middle of the config file.  I'm sure that would be a
good feature to have as it may be an invitation for trouble.

Re: [milter-greylist] Why the use of basic regexes instead of extended?

2005-03-19 by manu@netbsd.org

Matt Kettler <mkettler@...> wrote:

> The way I did it, you could add a "basicregex" option, and switch back
> and forth in the middle of the config file.  I'm sure that would be a
> good feature to have as it may be an invitation for trouble.

Yes, that's a call for problems. :-)

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.