You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Matt Kettler <mk...@comcast.net> on 2005/07/11 15:51:04 UTC

Re: (repost) bayes_ignore_from with wildcard ?

At 04:43 AM 7/11/2005, lists@zeta.net wrote:
>Hello,
>
>Does anyone know if this will work:
>
>bayes_ignore_from  MAILER-DAEMON@*
>
>The docs don't say specifically if this kind of directive is allowed.
>They do say that this kind of thing will work for whitelist_from.

We all got your message the first time. No, I don't know. But from a casual 
glance at the code, it should work.

conf.pm builds a list named bayes_ignore_from.

bayes.pm calls:
----
$ignore = $PMS->check_from_in_list('bayes_ignore_from')
         || $PMS->check_to_in_list('bayes_ignore_to');
----

check_from_in_list is actually implemented in EvalTests.pm:

----
sub check_from_in_list {
   my ($self,$list) = @_;
   my $list_ref = $self->{conf}{$list};
   warn "Could not find list $list" unless defined $list_ref;

   foreach my $addr (all_from_addrs $self) {
     return 1 if _check_whitelist $self $list_ref, $addr;
   }

   return 0;
}
----

_check_whitelist is the same comparison function the black and whitelists 
use, so it should work the same.

Although by looking at _check_whitelist, I wonder if it works the way the 
docs say. The docs claim it's file glob and not regex, but _check_whitelist 
looks a lot like it does a regex.






Re: (repost) bayes_ignore_from with wildcard ?

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
Matt Kettler wrote:
> Although by looking at _check_whitelist, I wonder if it works the way 
> the docs say. The docs claim it's file glob and not regex, but 
> _check_whitelist looks a lot like it does a regex.

_check_whitelist does use a regexp to do the matching but the config 
parser (add_to_addrlist() and add_to_addrlist_rcvd()) only passes file 
glob style expressions.  Any other regexp style metacharacters are escaped.

Daryl