https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6645

--- Comment #30 from [email protected] 2011-08-16 21:04:13 
UTC ---
(In reply to comments #29 and #28)
Thanks for constructive ideas and not discussing about which mail system is the
best and which shouldn't be supported.

> > (In reply to comment #21)
> > > if (/^\S+ (\(.{0,100}\) ){0,1}by \S+ \(.{0,100}\) with qmail-scanner/)
> > 
> > FWIW, rather than the {0,1} range quantifier, the equivalent "optional"
> > quantifier should be used. It's widely used and immediately obvious what it
> > does.
> > 
> >   (\(.{0,100}\) )?

(In reply to comment #28)
The regex can be surely improved. The code was rather focused on "it works"
than on "the code looks pretty/is performant".

The comment was rather meant to make clear that the added expression is needed
for catching authenticated headers, which had no example (and which I also
forgot in the current patch :-(

> 
> Also: While I see a \0 in the code following that RE, I don't see a \1 or $1
> anywhere. Is a capturing subgroup really needed there?
> 
>   /^\S+ (?:\(.{0,100}\) )?by \S+ \(.{0,100}\) with qmail-scanner/

(In reply to comment #29)
--> don't understand the "?:" in your expression, it looks much like
my $val2= $value>5?1:0;
which is
if ($value>5) {$val2=1;}
else {$val2=0;}
what is not wanted here

shouldn't the changed expression rather look like:
/^\S+ (\(.{0,100}\) )?by \S+ \(.{0,100}\) with qmail-scanner/

so that it matches expressions that match either
/^\S+ by \S+ \(.{0,100}\) with qmail-scanner/
or
/^\S+ \(.{0,100}\) by \S+ \(.{0,100}\) with qmail-scanner/

But I haven't tested your regex, so it might be my lack of regex knowledge.

Regarding the code following the RE this was code already included in
spamassassin-sources, so somebody will have had reasons for that before it was
included in the sources tree (it's in the current release)? (sounds much like I
wouldn't change working code, at least when I don't understand what it does ;-)
)

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to