Stefan,

> I couldn't find anything in this topic in the readme's and I didn't find
> out myself - so here is my question:
>
> Is it possible in any way to override values like
> $spam_quarantine_method
> $virus_quarantine_method
> $banned_files_quarantine_method
>
> in a Policy that is stored in SQL?

Currently only the *_quarantine_to field is looked up in SQL table,
not the *_method, which is considered rather a statical/global setting.

> (eg. overriding the standard value of quarantining locally to quarantine
> spam to the database and viruses to an administrator mailadress for some
> users or domains)

Switching between quarantining locally, and sending to a mailbox,
is achievable through a value in *_quarantine_to (contains an '@' or not),
as long as *_method is 'local:', according to:

  http://www.ijs.si/software/amavisd/amavisd-new-docs.html#quarantine

Unfortunately switching between file-based local quarantine and an
SQL quarantine requires changing *_method, as you have observed,
so that choice is currently not dynamically available.

> Overriding those values in Policybanks that are in the configuration
> file works, but I do have some Policies in the Database

Similarity in terms is unfortunate, but policy banks are quite different
kind of breed than an SQL policy table.

Policy banks can be loaded on some property of a message as a
whole, like a client's IP address (local or not), or sender, and similar.
Loading a policy bank can not depend on some property of a recipient,
because a message can have multiple recipients, but policy banks
affect processing of the whole message.

An SQL policy table is just another type of a lookup table, and almost all
lookup tables work correctly on a per-recipient basis and take a recipient
address as its lookup key (with few obvious exceptions) - splitting a message
forwarding into multiple deliveries if necessary.

This also partly explains why a quarantining *_method is not a
by-recipient lookup table - its value affects a message as a whole.

> and the values I 
> add there are not being loaded (lookup_sql does not even happen for
> those values). I added the fields to the table - and the log does show,
> that the fields with values are there on the select that gets the
> policy, but not being used.

I'm not sure I understand this.

> Is there a possibility (any - I'd also change the code if necessary) to
> make amavisd-new check the added database fields?

sub do_notify_and_quarantine is the one deciding where to quarantine
a message. It has been reworked in 2.6.2(-rc*) and there is some hope
it can now be more easily lured into taking into account per-recipient
settings of %quarantine_method_by_ccat. I'd have to consider implications.
One obvious problem is that deciding to load SQL code or not is done at
startup time by examining all *_method settings - dynamic values from
some lookup table (SQL or statical) would not be considered.

  Mark

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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/ 

Reply via email to