http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5817





------- Additional Comments From [EMAIL PROTECTED]  2008-02-14 19:39 -------
(In reply to comment #10)
> > Damn, you are quite efficient in demotivating me... :/
> 
> That's not my intention at all.

Thanks -- I know.

> It's just not clear to me why you're mixing
> substr with regexes and then testing if $helo has a value after you've already
> tried to take a substr of it.  I wasn't sure of what you were trying to do or
> if you were sure that you had achieved what you were trying to do.

That much is easy -- at least to explain after you hacked it, I guess. ;)

The reason is, that IPs in $pms->{relays_untrusted}->[]->{helo} are identified
by a leading and trailing exclamation mark. And M::SA::Constants::IP_PRIVATE is
bound to the beginning of the string. That's why I had to get rid of the leading
exclamation mark, and by that way got rid of the trailing one, too.

The RE then actually does the intended action of testing for private IPs
(especially 127.0.0.1, which I have found in my ham corpus) and the return 0
exonerates them.

The [^!]+$ ensures there is no other exclamation mark in the string, because I
also have seen helo values of 'hostname!!ip!'. However, that test is supposed to
*only* trigger on private IPs.

In retrospect, I do see an issue with this, as it might in some pathological
cases match, where it should not. 210.example.net would be one such case. I'll
re-think that part and will rewrite it.


> Either way works (plugin or header rule) for this criteria.  Header rules are
> just more likely to get tested by us than eval rules, especially when it is
> possible to do something via a rule.  Eval rules (especially when implemented
> in their own plugins) are expensive in both use and life-cycle management.

I do understand that.

I do not insist on a separate plugin, which actually would not make any sense at
all, if it eventually and by chance make it upstream. In that case, RelayEval.pm
probably would be the only sane choice for it to live in.

During testing, however, and for the sake of not harming my SA installation, I
did not feel like messing with that module, and instead settled for an isolated
sandbox to play in. Note that I did not care to provide info on how to use the
eval in bugzilla, just like I even pondered dropping the totally unnecessary
boiler plate stuff. I know all this is trivial for you guys, and at this point
the code is not meant as a patch or standalone addition, but a proof of concept.
I'll be most happy to provide a patch against RelayEval.pm, if desired.


Again, I'm sorry for the lack of documentation. I figured the discussion in here
would have explained the reasoning. I now see it doesn't. ;)  And apart from the
above mentioned private IP issue, the code should do exactly what I intended it
to do. :)




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to