cyrus-imapd/batchreconstruct
John Dennis 38f2261a6f auto-import cyrus-imapd-2.2.12-1.2.fc4 on branch devel from
cyrus-imapd-2.2.12-1.2.fc4.src.rpm
2005-04-15 20:24:15 +00:00

33 lines
726 B
Perl

#!/usr/bin/perl
#
# Usage: batchreconstruct inputfile
#
# Purpose: Runs the Cyrus reconstruct command on each newly-created
# Cyrus mailbox created by folderxfer
#
# Input: List of usernames, one per line
#
#$Id: batchreconstruct,v 1.1 2005/04/15 20:24:15 jdennis Exp $
#$whoami = "/usr/ucb/whoami"; # Solaris
$whoami = "/usr/bin/whoami";
$reconstruct = "/usr/lib/cyrus-imapd/reconstruct";
$cmd = "$reconstruct -r";
chop ($iam = `$whoami`);
if ($iam ne "cyrus" ) {
die "You must be cyrus to run this script!\n";
}
$users = "$ARGV[0]";
if (!$users) { die "Usage: $0 input_file\n"; }
open(MB,"$users") || die "can't open $users";
while (<MB>) {
chop;
system("$cmd user.$_");
}
close MB;