Anders,
> > $warnrecip_maps_by_ccat{+CC_SPAM} = 1;
>
> Looking at that, is the syntax similar to final_destiny_by_ccat so I
> would be able to set more options, like this?
>
> %warnrecip_maps_by_ccat = (
> CC_VIRUS, 1,
> CC_BANNED, 1,
> );
>
> Or how does it work? I'm definately not at all knowledgeble in Perl
> unfortunately.
Yes, more or less the same thing.
In Perl, variables starting with % are associative arrays (hashes),
while these starting with $ are scalars. One can reference also
a single element (key/value pair) within a hash, which is a scalar,
so a single element of a hash would start with a $.
%a ... the whole associative array. Assigning to it
would replace an entire array with another array.
$a{key} ... refers to a single element within %a,
assigning to it replaces just this key/value pair.
So, if one wants to replace all key/value pairs within an associative
array with another set of pairs, assignment to %a would do it in one go,
no need to deal with elements one at a time.
If one wants to just replace a single key/value, keeping the rest
as they are, assignment to $a{key} would do the job.
There is one syntactic catch with this '+' in the first example.
Namely, sometimes Perl tries to be so helpful that it hurts!
A key in an expression like $a{key}, i.e. within {} braces,
may be an expression, or just a plain string, and if it LOOKS LIKE
a plain string consisting of only letters, digits and underlines,
Perl quotes it implicitly, so $a{bla} is the same as $a{'bla'}.
This works as expected most of the time, except when a key
expression is a simple call to a subroutine without arguments
(which serves as a constant and may be inlined), such as CC_SPAM.
Silly Perl would treat $a{CC_SPAM} as $a{'CC_SPAM'} instead of $a{6}.
So we need to make it look like an expression.
Any syntactic sugar would do:
$a{&CC_SPAM}, $a{CC_SPAM()}, $a{CC_SPAM+0}, $a{+CC_SPAM}, $a{(CC_SPAM)}
(I'm avoiding a more obvious &CC_SPAM, because it prevents
inlining optimization)
> Talking of which, I'm curious about time limits for SQL, when I release
> mail from quarantine, they're still in the MySQL DB?
Yes, amavisd never deletes anything from a database.
Purging is a task of a maintenance (cron or manual) job,
executing few SQL clauses as suggested by the end of README.sql.
Don't know if MailZu automates this task.
> Also, how do I control for how long a quarantined message will stay in
> the DB before it gets purged? Even if it's never released.
Whatever figure you place instead of 14*24*60*60 in your purging job:
DELETE FROM msgs WHERE time_num < UNIX_TIMESTAMP() - 14*24*60*60;
DELETE FROM msgs WHERE time_num < UNIX_TIMESTAMP() - 60*60 AND content IS NULL;
DELETE FROM maddr
WHERE NOT EXISTS (SELECT 1 FROM msgs WHERE sid=id)
AND NOT EXISTS (SELECT 1 FROM msgrcpt WHERE rid=id);
Mark
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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/