You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Noel Butler <no...@ausics.net> on 2014/07/25 03:42:30 UTC

URIDNSBL check return code

Hi,

Is there a way to get the return code in the generated reports?

eg:

uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11
body      ALT_URI eval:check_uridnsbl('ALT_URI')
describe  ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE)
score     ALT_URI 3.0
tflags    ALT_URI net a


so if the check matched on 127.0.0.6, desc would be
describe  ALT_URI URL's domain A record listed in bl.foo (127.0.0.6)


Thanks for any pointers


Re: URIDNSBL check return code

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Sat, 2014-07-26 at 11:12 +1000, Noel Butler wrote:
> On 26/07/2014 03:32, Axb wrote:

> > what's the advantage of such a response method?
> > 
> > The idea of separate return codes is to use different rules/scores and
> > different rule descriptions which describe the type of listing
> 
> As you see, we use .2-.11 for this rule, the RC is only for internal
> use here so support can identtify which list, (we have two others that
> use singular codes that are rule specific) so are you suggesting that
> rather than that one rule, we have ten rules doing exactly the same
> thing?
> 
> That's not very efficient :)

They don't do the same thing. They distinguish different listings. Which
is exactly why you have different return codes, as you just explained.

There is one DNS query (or eval() code run). There are multiple light-
weight response based rules. See e.g. stock Bayes and URIBL rules.

Using a set of FOO_* rules, advantages are  (a) supporting different
scores, even if you don't need them right now, and  (b) knowing exactly
which one of the set fired. Always. Because the rule names differ.

In the case of a "return code" injected into the description, as you
described, you will only know the actual listing with the Report header
added. Which is spam only be default. The Status header with the terse
list of tests hit will NOT tell you, which of your internal listings
fired. So with ham, there's no hint which of your lists badly fired...

If your support needs to identify different RBL lists, enable them to do
that for FP hits on ham, too. Use rule names, that identify the list.


The describe option offers an additional, verbose, human readable text
for a given rule.

The describe option does not differentiate flavors of a given rule.


And, well, you really don't want your support to depend on the verbose
description, given for users to understand the rule, but being unable to
tell or explain the FP rule hit with only the rule name available, do
you?


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: URIDNSBL check return code

Posted by Noel Butler <no...@ausics.net>.
 

On 26/07/2014 03:32, Axb wrote: 

> On 07/25/2014 07:26 PM, Kevin A. McGrail wrote:
> On 7/24/2014 9:42 PM, Noel Butler wrote: Hi, Is there a way to get the return code in the generated reports? eg: uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11 body ALT_URI eval:check_uridnsbl('ALT_URI') describe ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE) score ALT_URI 3.0 tflags ALT_URI net a so if the check matched on 127.0.0.6, desc would be describe ALT_URI URL's domain A record listed in bl.foo (127.0.0.6) Thanks for any pointers Nothing currently in the code Looks like you would have to modify URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the test_log data From looking, $str contains the return data so likely need to look through $uris and add $str to this line: $pms->test_log ("URIs: $uris"); Let us know if it works and perhaps it's worth adding to the codebase.

what's the advantage of such a response method?

The idea of separate return codes is to use different rules/scores and
different rule descriptions which describe the type of listing

As you see, we use .2-.11 for this rule, the RC is only for internal use
here so support can identtify which list, (we have two others that use
singular codes that are rule specific) so are you suggesting that rather
than that one rule, we have ten rules doing exactly the same thing? 

That's not very efficient :) 

 

Re: URIDNSBL check return code

Posted by Axb <ax...@gmail.com>.
On 07/25/2014 07:26 PM, Kevin A. McGrail wrote:
> On 7/24/2014 9:42 PM, Noel Butler wrote:
>> Hi,
>>
>> Is there a way to get the return code in the generated reports?
>>
>> eg:
>>
>> uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11
>> body      ALT_URI eval:check_uridnsbl('ALT_URI')
>> describe  ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE)
>> score     ALT_URI 3.0
>> tflags    ALT_URI net a
>>
>>
>> so if the check matched on 127.0.0.6, desc would be
>> describe  ALT_URI URL's domain A record listed in bl.foo (127.0.0.6)
>>
>>
>> Thanks for any pointers
>
> Nothing currently in the code Looks like you would have to modify
> URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the
> test_log data
>
>  From looking, $str contains the return data so likely need to look
> through $uris and add $str to this line:
>
>      $pms->test_log ("URIs: $uris");
>
> Let us know if it works and perhaps it's worth adding to the codebase.

what's the advantage of such a response method?

The idea of separate return codes is to use different rules/scores and 
different rule descriptions which describe the type of listing





Re: URIDNSBL check return code

Posted by Noel Butler <no...@ausics.net>.
 

Hi Kevin, 

Thanks, will try this out after lunch and get back to you. 

Cheers 

Noel 

On 26/07/2014 03:26, Kevin A. McGrail wrote: 

> On 7/24/2014 9:42 PM, Noel Butler wrote:
> 
>> Hi, Is there a way to get the return code in the generated reports? eg: uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11 body ALT_URI eval:check_uridnsbl('ALT_URI') describe ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE) score ALT_URI 3.0 tflags ALT_URI net a so if the check matched on 127.0.0.6, desc would be describe ALT_URI URL's domain A record listed in bl.foo (127.0.0.6) Thanks for any pointers
> 
> Nothing currently in the code Looks like you would have to modify URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the test_log data
> 
> From looking, $str contains the return data so likely need to look through $uris and add $str to this line:
> 
> $pms->test_log ("URIs: $uris");
> 
> Let us know if it works and perhaps it's worth adding to the codebase.
> 
> Regards,
> KAM

 

Re: URIDNSBL check return code

Posted by Noel Butler <no...@ausics.net>.
 

IOn 30/07/2014 00:30, Kevin A. McGrail wrote: 

> Nothing currently in the code Looks like you would have to modify URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the test_log data
> 
>> From looking, $str contains the return data so likely need to look through $uris and add $str to this line:
> 
> $pms->test_log ("URIs: $uris");
> 
> Let us know if it works and perhaps it's worth adding to the codebase.
> 
> Regards,
> KAM
> 
> Works a treat! 
> 
> Thanks, does exactly what we need.
 OK, I'm assuming this is not necessary / suitable for the public at
large and 

That's for the community at large to decide, not me :) 

But given it has not been brought up before that I can see, the need for
it en mass seems doubtful at present, so unless you suddenly get a large
number of feature requests for it, I would say not necessary to make
change to the master code base. 

> you'll patch your own installs as needed.

Yep, sure can as required. 

Thanks again. 

 

Re: URIDNSBL check return code

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 7/26/2014 11:54 AM, Noel Butler wrote:
>
> On 26/07/2014 03:26, Kevin A. McGrail wrote:
>
>> On 7/24/2014 9:42 PM, Noel Butler wrote:
>>> Hi, Is there a way to get the return code in the generated reports? 
>>> eg: uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11 body ALT_URI 
>>> eval:check_uridnsbl('ALT_URI') describe ALT_URI URL's domain A 
>>> record listed in bl.foo ($RETRUN_CODE) score ALT_URI 3.0 tflags 
>>> ALT_URI net a so if the check matched on 127.0.0.6, desc would be 
>>> describe ALT_URI URL's domain A record listed in bl.foo (127.0.0.6) 
>>> Thanks for any pointers
>> Nothing currently in the code Looks like you would have to modify URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the test_log data
>>
>> >From looking, $str contains the return data so likely need to look through $uris and add $str to this line:
>>
>>      $pms->test_log ("URIs: $uris");
>>
>> Let us know if it works and perhaps it's worth adding to the codebase.
>>
>> Regards,
>> KAM
>>
>>
> Works a treat!
>
> Thanks, does exactly what we need.
>
OK, I'm assuming this is not necessary / suitable for the public at 
large and you'll patch your own installs as needed.

Regards,
KAM

Re: URIDNSBL check return code

Posted by Noel Butler <no...@ausics.net>.
 

On 26/07/2014 03:26, Kevin A. McGrail wrote: 

> On 7/24/2014 9:42 PM, Noel Butler wrote:
> 
>> Hi, Is there a way to get the return code in the generated reports? eg: uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11 body ALT_URI eval:check_uridnsbl('ALT_URI') describe ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE) score ALT_URI 3.0 tflags ALT_URI net a so if the check matched on 127.0.0.6, desc would be describe ALT_URI URL's domain A record listed in bl.foo (127.0.0.6) Thanks for any pointers
> 
> Nothing currently in the code Looks like you would have to modify URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the test_log data
> 
> From looking, $str contains the return data so likely need to look through $uris and add $str to this line:
> 
> $pms->test_log ("URIs: $uris");
> 
> Let us know if it works and perhaps it's worth adding to the codebase.
> 
> Regards,
> KAM

Works a treat! 

Thanks, does exactly what we need. 

Re: URIDNSBL check return code

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 7/24/2014 9:42 PM, Noel Butler wrote:
> Hi,
>
> Is there a way to get the return code in the generated reports?
>
> eg:
>
> uridnssub ALT_URI bl.foo A 127.0.0.2-127.0.0.11
> body      ALT_URI eval:check_uridnsbl('ALT_URI')
> describe  ALT_URI URL's domain A record listed in bl.foo ($RETRUN_CODE)
> score     ALT_URI 3.0
> tflags    ALT_URI net a
>
>
> so if the check matched on 127.0.0.6, desc would be
> describe  ALT_URI URL's domain A record listed in bl.foo (127.0.0.6)
>
>
> Thanks for any pointers

Nothing currently in the code Looks like you would have to modify 
URIDNSBL.pm to add that info in the sub got_dnsbl_hit to add to the 
test_log data

 From looking, $str contains the return data so likely need to look 
through $uris and add $str to this line:

     $pms->test_log ("URIs: $uris");

Let us know if it works and perhaps it's worth adding to the codebase.

Regards,
KAM