amavisd-release does not work with SQL quarantine (missing quar_type = "Q")

Dino Edwards dino.edwards at mydirectmail.net
Tue Feb 21 11:47:29 CET 2017


Fair enough. I'm a little confused still. What type of message are you trying to release? A spam, virus or banned when you do amavis-release? So the following lines exist in your amavis config file?

$virus_quarantine_method = 'sql:';
$banned_files_quarantine_method = 'sql:';
$final_virus_destiny = D_DISCARD;
$final_banned_destiny = D_DISCARD;



-----Original Message-----
From: amavis-users [mailto:amavis-users-bounces+dino.edwards=mydirectmail.net at amavis.org] On Behalf Of postmaster at wf-partner.com
Sent: Tuesday, February 21, 2017 2:25 AM
To: Amavis Users <amavis-users at amavis.org>
Subject: Re: amavisd-release does not work with SQL quarantine (missing quar_type = "Q")

We only quarantine mails containing viruses or banned files. I would not recommend quarantining clean mails.

What I was looking for is a solution for people who use sql quarantine only for viruses and banned files and who want to release a quarantined mail.

This doesn't work because in amavisd-release the default value of $quar_type = ''. And in amavisd-new $quar_type defaults to 'F' if $spam_quarantine_method does not contain "sql:" see:

>      # choose some reasonable default (simpleminded)
>      $quar_type = c('spam_quarantine_method') =~ /^sql:/i ? 'Q' : 'F';

My solution is to change default value of $quar_type to 'Q' in amamvisd-release.
But this does not fix the bug.

> Just out of curiosity, any particular reason you are using sql instead 
> of local to quarantine?

No there is no particular reason to use sql quarantine. But we have not so many quarantined mails in a week, so we can live with it.

Thomas

-----Original Message-----
 From: amavis-users
[mailto:amavis-users-bounces+dino.edwards=mydirectmail.net at amavis.org] On Behalf Of Dino Edwards dino.edwards at mydirectmail.net

Here's how to do it. In your amavis config file  set the following to get everything quarantined. :

$virus_quarantine_method = 'sql:';
$spam_quarantine_method = 'sql:';
$banned_files_quarantine_method = 'sql:'; $bad_header_quarantine_method = 'sql:'; $clean_quarantine_method = 'sql:';

Just out of curiosity, any particular reason you are using sql instead of local to quarantine? I used to use sql and the database became unmanageable because of the sheer amount of email that was stored in it. 
So, I don't recommend storing your email in the database. If you want to go local storage, set it like below. Ensure you set your $QUARANtINEDIR path below to a mount point with plenty of space and ensure that it's owned by amavis:

$QUARANTINEDIR = "/some/mountpoint/with/plenty/of/space";
$virus_quarantine_method = 'local:virus/%m'; $spam_quarantine_method = 'local:spam/%m'; $banned_files_quarantine_method = 'local:banned/%m'; $bad_header_quarantine_method = 'local:bad_header/%m'; $clean_quarantine_method = 'local:clean/%m';




----------------
Dino Edwards
----------------

Hermes Secure Email Gateway
Hermes Secure Email Gateway combines Open Source technologies such as Postfix, Apache SpamAssassin, ClamAV, Amavisd-new, MySQL and CipherMail under one unified web based Web GUI for easy administration and management of your incoming and ougoing email for your organization. 
Anti-spam, anti-virus and anti-malware protection, encrypted S/MIME, encrypted PDF and SMTP TLS support, built-in email archiving, end-user self-service web gui.

Learn More & Download the free open-source appliance at:
https://www.deeztek.com/hermes-secure-email-gateway/





-----Original Message-----
 From: amavis-users
[mailto:amavis-users-bounces+dino.edwards=mydirectmail.net at amavis.org] On Behalf Of postmaster at wf-partner.com
Sent: Monday, February 20, 2017 7:44 AM
To: Amavis Users <amavis-users at amavis.org>
Subject: Re: amavisd-release does not work with SQL quarantine (missing quar_type = "Q")

Am 2017-02-16 14:03, schrieb postmaster at wf-partner.com:
> Dominic Raferd <dominic at timedicer.co.uk> wrote
>> We use file-based quarantine. I tried this change and then 
>> amavisd-release does not work, I am sorry to report; there is no 
>> error message - just the mail is not released and the file remains in 
>> quarantine.
> 
> Thanks for your answer.
> 
> Could you try and write the whole filename including full path when 
> using amavisd-release.
> I think you should get the mail resent by amavisd-release like this.
> 
> If $fn_path is emtpy $quar_type = 'Q' is used with my change.
> 
> I don't know another way to get mails resent from SQL.

I found the underlying reason of this issue. We use the sql-based quarantine only for banned-files and virus, but not for spam. Therefore

$spam_quarantine_method = undefined;

In amavisd-new $quar_type defaults to 'F' if $spam_quarantine_method does not contain "sql:" see:

>      # choose some reasonable default (simpleminded)
>      $quar_type = c('spam_quarantine_method') =~ /^sql:/i ? 'Q' : 'F';

What do you recommend to solve this issue?

Thomas Sattler


More information about the amavis-users mailing list