I think I found why the scoring logging isn't working consistently. It's
not that it always shows the first reason - it's that some reasons don't set
$this->{messagereason} in their subs and the pbAdd function uses that
variable with a higher priority than the reason parameter of pbAdd.
Not knowing this section of the code at all, I looked where I could and
found that $this->{messagereason} isn't set in the sub LocalSenderOK and
probably others.
The in the pbAdd function, $reason2 is set as follows
my $reason2=$reason; (reason2 being the parameter of the sub)
$reason2=$this->{messagereason} if $this->{messagereason};
It's $reason2 that's used in the log where I'm seeing the inconsistency.
If an IP in the Helo is found first then $this->{messagereason} is set.
Then if an invalid sender is found, LocalSenderOK only sends the reason to
pbAdd as a parameter, but messagereason isn't set.
So when we get to setting $reason2, it is first set to what we've sent over,
but the line
$reason2=$this->{messagereason} if $this->{messagereason};
overrides this, since messagereason was previously set by the suspicious
helo.
Two possible solution:
a) set the messagereason in the named subs (and any that I missed
). I do not know what other ramifications this might have though for other
parts of the code that use messagereason
b) (probably a better solution) It looks like reason2 is only used for
logging within pbadd. So changing the $reason2=$this->{messagereason} if
$this->{messagereason}; line to:
$reason2=$this->{messagereason} if $this->{messagereason} && !$reason2;
should be ok. This would only set reason2 to messagereason if we didn't
send in a reason as a parameter of pbAdd.
On Sun, Oct 18, 2009 at 4:32 PM, K Post <[email protected]> wrote:
> Scoring logging is not working correctly. It appears that as the scoring
> is logged in the maillog, the first reason for a score is listed for each
> line. Take this for example:
>
> ## helo had an ip in it, so we gave it a score of 5
> Oct-18-09 16:23:45 msg97425-14632 123.194.130.146 <
> [email protected]> Message-Score:
> added 5 for Suspicious HELO - contains IP: '
> 123-194-130-146.dynamic.kbronet.com.tw',
> total score for this message is now 5
> ## it's an unknown local sender, add 20, but the reason in the 2nd line
> shows the reason being ip in the helo
> Oct-18-09 16:23:45 msg97425-14632 [UnknownLocalSender] 123.194.130.146 <
> [email protected]>
> [scoring] (Invalid Local Sender
> '[email protected]')
> Oct-18-09 16:23:45 msg97425-14632 123.194.130.146 <
> [email protected]> Message-Score:
> added 20 for Suspicious HELO - contains IP: '
> 123-194-130-146.dynamic.kbronet.com.tw',
> total score for this message is now 25
> ## penalty trap address, add 50, but again ip in helo is listed as the
> reason
> Oct-18-09 16:23:46 msg97425-14632 [Trap] 123.194.130.146 <
> [email protected]> penalty
> trap address: [email protected]
> Oct-18-09 16:23:46 msg97425-14632 123.194.130.146 <
> [email protected]> Message-Score:
> added 50 for Suspicious HELO - contains IP: '
> 123-194-130-146.dynamic.kbronet.com.tw',
> total score for this message is now 75
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test