Andrew, Brian,

> On 2/15/06, Andrew A. Neuschwander <[EMAIL PROTECTED]> wrote:
> > 2) The filename prefix used by amavis, i.e. "banned-", is configurable
> > in the amavis config and NOT supplied in the SQL tables. The SQL
> > reporting tables (msgrcpt & msgs) only contain the mail_id for the
> > quarantined message. For MailZu to pass a correct "mail_file=" statement
> > to amavis, it would have to read the amavisd.conf file to learn the
> > correct configured prefix from the "*_quarantine_method" options. I
> > think this is unreasonable. It seems to me that it should be amavis' job
> > to know a messages filename based on the mail_id and the
> > *_quarantine_method options.
>
> That was the same assumption I made. I thought that amavisd-new
> derived the filename by what was listed in the amavisd.conf. The only
> limitation of this setup is that if you decide to change the
> prefix/suffix in the configuration, this would break releasing for
> filenames saved before the configuration change.

You are both quite right. At the time I introduced the SQL log file,
I tried to minimize the amount of stored information, and cut some
corners by later resurrecting missing information such as a full
quarantine file name, assuming that people using SQL log would also
choose a SQL quarantine and would thus not need this extra data.

The SQL log tables are write-only in current amavisd code, the program
does not access them later. For releasing from quarantine it depends
on the supplied information from the requestor. I'd like to avoid
depending on reading from SQL log tables unless absolutely necessary.

For reconstructing the quarantine file name the static information
from amavisd.conf may not be sufficient, because quarantine_to
setting may be per-recipient and per-policy-bank. Also the settings may
change, and the correct setting is the one used at the time when a message
was processes, which may be different from when release request is done.

So this gives me the only reasonable choice: to store this information
to table msgs, to be later available to a quarantine release requestor
program such as MailZu. Since inserting one additional field (time_num)
in tables msgrcpt and quarantine is already scheduled for 2.4.0,
this is a good opporunity to insert one field in table msgs as well:

  quar_loc varchar(255) DEFAULT '',  -- quarantine location (e.g. file)

It will require the following manual SQL command at the time of
upgrade to 2.4.0:
  ALTER TABLE msgs ADD quar_loc varchar(255) DEFAULT '';

The field will store the same string as reported in the log by a macro %q,
i.e. in case of quarantining to files that would be a file name relative
to $QUARANTINEDIR. This also happens to be the same string that a release 
requestor needs to supply in the AM.PDP protocol attribute 'mail_file':

With settings like:
  $quarantine_subdir_levels = 1;
  $spam_quarantine_method  = 'local:spam/%m.gz';
  $virus_quarantine_method = 'local:virus/%m';

this would be the string stored in msgs.quar_loc
as well as reported by macro %q:

  spam/i/iArVjL7NEZOA.gz
  virus/h/h-z1a-A0zTEg

Mark



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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