#!/usr/bin/perl -w # mbox2cyrus is not a real mailbox file to cyrus mailbox converter. # Surprised? well don't be mad at me, you just fill up a list of # users you want to migrate and put in $user_file (please 1 user per # line) and then execute this script. It will read each message from # their old mailboxes and resend to them. Hopefully they will be # delivered using cyrus local mailer :-) # Written by Rocco Lucia (rlucia@iscanet.com, http://elisa.utopianet.net/~rlucia ) # Sat Feb 24 01:21:47 CET 2001 # This code is distributed under a BSD style license. You are free # to do with it as you please. Yes, I bet you won't live without it. use Mail::Util qw(read_mbox); $user_file = "GHOSTS_FILE"; $sendmail = "/usr/sbin/sendmail"; $mailspool_dir = "/var/mail/"; open( USERS, $user_file ) or die "Do you want to migrate ghosts?\n"; while( $user = ) { chomp $user; @msg = read_mbox( "$mailspool_dir$user" ); foreach $msg (@msg) { open(MSG,"| $sendmail $user"); print MSG @$msg; close(MSG); } }; close( USERS );