PDA

View Full Version : clamav quarantine folder


Martin Hauptmann
02-10-2006, 05:37 AM
Hi there,

I just set up my first real working QMR-Mailserver. Before I forget and run into trouble: What will happen to the mails in the quarantine-folder of clamav? Will they be cleared after a while? I did not find where to tell what will happen with them. Do I need to delete them manually from time to time to avoid filling up my disk?

Regards

Martin

EinsteinTaylor
02-13-2006, 03:18 PM
The quarantine file is basically just a maildir so you will need to make a cron script to do it

this should be a good start here:


#!/bin/bash

rm -Rf /path/to/quarantine/cur/*

rm -Rf /path/to/quarantine/new/*

rm -Rf /path/to/quarantine/tmp/*


put that in shell script...chmod it to: 755 and make it a cron for whatever interval is appropriate for your server

Martin Hauptmann
02-16-2006, 08:44 AM
I'd prefer a regular clearing of mails older than x days. In case I want to check if a certain virus was quarantined and I need to use it for testing purposes I would prefer a routine that deletes all quarantined mails older than, let's say, 28 days.
Your solution helps against filling up infinite diskspace but can lead to other difficulties.
I cannot imagine that I am the only one who wants to do it that way.

Thx
Martin Hauptmann

kurtr4
02-19-2006, 01:23 PM
you can control the age of the files that are deleted with something like:

find /some/dir -cmin +40320 | xargs rm -f





I'd prefer a regular clearing of mails older than x days. In case I want to check if a certain virus was quarantined and I need to use it for testing purposes I would prefer a routine that deletes all quarantined mails older than, let's say, 28 days.
Your solution helps against filling up infinite diskspace but can lead to other difficulties.
I cannot imagine that I am the only one who wants to do it that way.

Thx
Martin Hauptmann

Martin Hauptmann
02-21-2006, 09:47 AM
kurtr4, Thank you, that is exactly what I was looking for.

Regards

Martin

JMC
02-23-2006, 01:05 PM
I'm running this little script every night to clean up the quarantine and tell me how much space it still uses:


#!/bin/bash
DAYS=30
find /var/spool/qmailscan/quarantine -ctime $DAYS -type f -exec rm {} \;
echo ""
echo "Deleting mails older than $DAYS days"
echo ""
echo "In use: "
du -sh /var/spool/qmailscan/quarantine
echo ""


Greets

JMC