Yahoo Groups archive

Milter-greylist

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

Thread

unexpected void backreference

unexpected void backreference

2008-06-05 by John Villalovos

I am seeing the following message in my log file:

Jun  3 08:39:47 john-desktop milter-greylist: unexpected void
backreference no 1 in regex /.*@\(.*\.\)*example\.com/ against
"<example@...>"

I recently updated to version 4.0 from 3.?.?.  I didn't have any
issues in 3.x with my list.

I think my regex looks right to me.  From looking at the code in acl.c
(around line 538 of the 4.0 code) I am guessing that it thinks that
every group must have a match, but I put things into a group because
they MAY match but don't have to, if that makes sense.

The purpose of the regex /.*@\(.*\.\)*example\.com/ is to whitelist a
sender if they are from the domain example.com.  So this includes
addresses like example@... along with
example@...

Is this a bug or am I doing something wrong?

Thanks,
John

Re: [milter-greylist] unexpected void backreference

2008-06-05 by Oliver Fromme

John Villalovos wrote:
 > Jun  3 08:39:47 john-desktop milter-greylist: unexpected void
 > backreference no 1 in regex /.*@\(.*\.\)*example\.com/ against
 > "<example@...>"

I'm afraid I can't explain the message.  But FWIW, I use
a slightly different regex for that kind of things:

/.*[@.]example\.com/

Its purpose is the same:  It matches someone@...
as well as someone@..., but it does not
match someone@....

This regex is more efficient, because grouping with \(\)
combined with "*", "+" or "?" is less efficient than using
character sets with "[]" like above (at least in the regex
library I'm familiar with).  It's also less dependent on
the regex implementation and dialect; it works with basic
REs as well as with extended REs.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Gesch\ufffdftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M\ufffdn-
chen, HRB 125758,  Gesch\ufffdftsf\ufffdhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"I invented Ctrl-Alt-Delete, but Bill Gates made it famous."
        -- David Bradley, original IBM PC design team

Re: [milter-greylist] unexpected void backreference

2008-06-05 by Benoit Branciard

Oliver Fromme a \ufffdcrit :
> I'm afraid I can't explain the message.  But FWIW, I use
> a slightly different regex for that kind of things:
> 
> /.*[@.]example\.com/
> 

I don't understand why many people (several examples were posted on this 
list) insist on using regexps with ".*" at the beginning or the end of 
the expression... Without begin and/or end delimiters (^ and $), this is 
totally unnecessary; you could as well write /[@.]example\.com/.

Or if you really care to match the domain suffix part and not any 
substring, you'd better write: /[@.]example\.com[> ]*$/


-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

Re: [milter-greylist] unexpected void backreference

2008-06-05 by Oliver Fromme

Benoit Branciard wrote:
 > Oliver Fromme wrote:
 > > I'm afraid I can't explain the message.  But FWIW, I use
 > > a slightly different regex for that kind of things:
 > > 
 > > /.*[@.]example\.com/
 > 
 > I don't understand why many people (several examples were posted on this 
 > list) insist on using regexps with ".*" at the beginning or the end of 
 > the expression...

For documentation purposes.  It explicitely expresses the
intent that anything can precede it.

Of course you are right, it doesn't change the meaning of
the expression.  It also doesn't change the performance,
so there is no reason not to write ".*" at the beginning.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Gesch\ufffdftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M\ufffdn-
chen, HRB 125758,  Gesch\ufffdftsf\ufffdhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"And believe me, as a C++ programmer, I don't hesitate to question
the decisions of language designers.  After a decent amount of C++
exposure, Python's flaws seem ridiculously small." -- Ville Vainio

Re: [milter-greylist] unexpected void backreference

2008-06-05 by John Villalovos

On Thu, Jun 5, 2008 at 8:27 AM, Oliver Fromme <olli@...> wrote:
>
> John Villalovos wrote:
>  > Jun  3 08:39:47 john-desktop milter-greylist: unexpected void
>  > backreference no 1 in regex /.*@\(.*\.\)*example\.com/ against
>  > "<example@...>"
>
> I'm afraid I can't explain the message.  But FWIW, I use
> a slightly different regex for that kind of things:
>
> /.*[@.]example\.com/
>
> Its purpose is the same:  It matches someone@...
> as well as someone@..., but it does not
> match someone@....
>
> This regex is more efficient, because grouping with \(\)
> combined with "*", "+" or "?" is less efficient than using
> character sets with "[]" like above (at least in the regex
> library I'm familiar with).  It's also less dependent on
> the regex implementation and dialect; it works with basic
> REs as well as with extended REs.

Thanks.  I will give that a try.

John

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.