Am Mittwoch, den 19.03.2008, 12:27 +1100 schrieb Jeremy Laidman:
> On 3/19/08, Harald ARNOLD <[EMAIL PROTECTED]> wrote:
> >
> > But *all* not correct mail are now in spamall - OK
> > And both correct and incorrect mail are in spamadmin :-(
> >
> Sorry, I don't know why that is.

I think that your quite better in perl.

The source changes have to be done in calling sub
"lookup(0, $rec, @$quarantine_to_maps_ref)". It is
an HASH, therefore the next called sub is 
"lookup_hash($addr,$t,$get_all)" this are only
25 lines of code.

My idea whould be:

1) Inserting a special character in the variable
   "spam_quarantine_to" like the character "!"
   "[EMAIL PROTECTED]
2) Changinging code so that only this one 
   statement whould be filtered out. Because
   there is no other logical change to source
3) Change the sub lookup_hash

Could you help me to change this sub ?
I am to bad in perl - I made a source
check only by a book - I now know many
more, but too less to make it work!

Source, Version amavisd-new-2.4.3 (20060930)

[BEGIN]
sub lookup_hash($$;$) {
  my($addr, $hash_ref,$get_all) = @_;
  (ref($hash_ref) eq 'HASH')
    or die "lookup_hash: arg2 must be a hash ref: $hash_ref";
  local($1,$2,$3,$4); my(@matchingkey,@result);
  my($keys_ref,$rhs_ref) = make_query_keys($addr,1,1);
  for my $key (@$keys_ref) {   # do the search
    if (exists $$hash_ref{$key}) {  # got it
      push(@result,$$hash_ref{$key}); push(@matchingkey,$key);
      last  if !$get_all;
    }
  }
  # do the right-hand side replacements if any $n, ${n} or $(n) is
specified
  for my $r (@result) {  # remember that $r is just an alias to array
elements
    if (!ref($r) && $r=~/\$/) {  # is a plain string containing a '$'
      my($any) = $r =~ s{ \$ ( (\d+) | \{ (\d+) \} | \( (\d+) \) ) }
                        { my($j)=$2+$3+$4; $j<1 ? '' :
$rhs_ref->[$j-1] }gxse;
      # bring taintedness of input to the result
      $r .= substr($addr,0,0)  if $any;
    }
  }
  if (!ll(5)) {
    # only bother with logging when needed
  } elsif ([EMAIL PROTECTED]) {
    do_log(5,"lookup_hash(%s), no matches", $addr);
  } elsif (!$get_all) {  # first match wins
    do_log(5,'lookup_hash(%s) matches key "%s", result=%s',
              $addr, $matchingkey[0], !defined($result[0])?'undef':
$result[0]);
  } else {  # want all matches
    do_log(5,"lookup_hash(%s) matches keys: %s", $addr,
              join(', ', map {sprintf('"%s"=>%s',$matchingkey[$_],
$result[$_])}
                             (0..$#result)) );
  }
  if (!$get_all) { !wantarray ? $result[0] : ($result[0],
$matchingkey[0]) }
  else           { !wantarray ? [EMAIL PROTECTED]   : ([EMAIL PROTECTED],
[EMAIL PROTECTED])   }
}
[END]

Thanks Harald


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to