....
 

Guardian Digital Inc. > InfoCenter > Mailing List Archives > Amavis

Amavis Mailing List Archive

From: Mark Martinec (Mark.Martinec+amavis@ijs.si)
Date: Thu Dec 23 2004 - 09:43:39 EST


> im not a perl coder
> can i override %local_delivery_aliases in amavisd.conf so in case of
> upgrade amavisd it will not mess up everything?

Well, the %local_delivery_aliases was supposed to be configurable from
the amavisd.conf file, but when I was moving some of the built-in
initializations to a routine that is invoked after chrooting,
I inadvertently caused any values assigned to %local_delivery_aliases
from the config file to be overruled by the later default assignment.
I noticed it just before the 2.2.1 release, but I didn't want to make
a last minute change, so it will have to wait for the next release.
Meanwhile, you will have to modify the amavisd unfortunately.

> i`ve got fields id_domain,id_email in users table - the same where are
> amavisd policies so can i use sub lookup_sql_field to get those cached
> values

Yes, but you need to make a Lookup::SQLfield object to access that field,
see below.

> in %local_delivery_aliases instead of QUARANTINE?
> system path must be /opt/spool/$id_domain/$id_email so f.e.
> '/opt/spool/'.lookup_sql_field('id_domain').'/'.lookup_sql_field('id_email'
>) will work??

Here is a quick draft:

    'spam-quarantine' => sub {
       my(@fnames);
       my($myfield) =
          Amavis::Lookup::SQLfield->new($sql_policy,'id_domain','S');
        for my $r (@{$MSGINFO->recips}) {
          my($field_value) = lookup(0,$r,$myfield);
        # my($fname) = $r;
          my($fname) = $field_value;
          local($1); $fname =~ s/[^a-zA-Z0-9._@]/=/g; $fname =~ s/\@/%/g;
          $fname = untaint($fname) if $fname =~ /^([a-zA-Z0-9._=%]+)\z/;
          $fname =~ s/%/%%/g; # protect %
          do_log(0, "Recipient: $r, field: $field_value, fname: $fname");
          push(@fnames, $fname);
        }
        # ???what file name to choose if there is more than one recipient???
        ( $QUARANTINEDIR, "sender-$fnames[0]-%i-%n.gz" ); # suggested file name
      },

Note there is one fundamental flaw with this approach, as there is supposed
to be only one quarantine file, yet each recipient may prefer his own
file name.

The approach described in
  http://www.ijs.si/software/amavisd/amavisd-new-docs.html#addrext
is cleaner and is preferable.

> same conclusion - so far - it is working for me exactly as you said :)
> but that generates extra emails to MDA

Yes, the mail to be quarantined gets handled by MTA, which means
one more task for its delivery agent. This operation is handled
quite efficiently my MTA/LDA, so I think it can hardly have any
impact on the the performance.

  Mark

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/



[ About Guardian Digital ] - [ Press Center ] - [ Contact Us ] - [ System Activation ] - [ Reseller Info ] - [ Online Store ] - [ Site Map ]
Copyright (c) 2000 - 2004 Guardian Digital, Inc. Linux Lockbox and EnGarde are Trademarks of Guardian Digital, Inc.