"reconstruct -r" usage

Craig Ringer craig at postnewspapers.com.au
Fri Apr 16 10:58:50 EDT 2004


On Fri, 2004-04-16 at 22:20, John Conant wrote:
> Hi,
> 
>          Sort of a side note - we started having trouble like that.  Turned 
> out that our overnight antivirus scan of the mail store would find a virus, 
> and quarantine (move!) the infected file, thus messing up the Cyrus 
> indexing.  Now we schedule a system-wide reconstruct after the virus scan, 
> which seems to work.

I'm also doing nightly mail spool scans, but I've found another method
to be quite effective when it comes to reconstructing the mailboxes.

Our virus scanner writes a log to stdout, so I simply grep that for the
string that indicates a detected virus. I then strip off the filenames
and the rest of the log data, sort the output, pipe it through uniq, and
use that output to reconstruct each mailbox that's been altered.

Note that I do _not_ let the virus scanner quarantine the files; I do
that myself. This approach can easily be adapted for a situation where
the virus scanner quarantines the files, though. This script will only
work out of the box for people using ClamAV and the same mail spool
structure as me, but the general idea should work for most.

I've attached the script. It's pretty primitive (I prefer Python, but
tasks like this are quicker in the shell). Nonetheless, I think this is
a cleaner way of doing things than reconstructing all the mailboxes.

I'll be moving to using python's imaplib to do all this soon.

As for the 'reconstruct -r' issue - I /think/ that only reconstructs
mailboxes listed in the mailboxes db. Perhaps you want '-f -r' to look
for mailboxes in subdirectories, too?

Craig Ringer

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list