Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 24bcb7d2542c5134fe971d44f2de5c04 > files > 97

cyrus-imapd-2.3.7-12.el5_7.2.x86_64.rpm

#!/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.2 2006/06/27 08:58:54 prockai 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;