Problem
By default, SCO office 4 automatically backup all users mail boxes into a gzipped cpio file.
The files are located in:/opt/insight/htdocs/is4web/tar.When using the restore feature from within the web admin tool, it will restore all users mail.
If you only want to restore a single users mail box, follow the directions below.
This is documented below as "RESTORE FROM GZIPPED CPIO FILE".
However, this can consume large disk space quantities depending on the amount of mail stored.
It might be, therefore, useful to turn this feature off in the ADMIN GUI -> Tools -> Task Scheduler -> Backup User Mailboxes -> Disable
The alternative would be to backup to tape and this is detailed in "RESTORE FROM A CPIO ARCHIVE".
Solution
- RESTORE FROM GZIPPED CPIO FILE
------------------------------
Please follow the directions below:1. Log on a root user.2. Change to the /opt/insight/bin directory.3. Create the script listed below and name it mrestore.4. Change permissions on mrestore to -rwxr-xr-x# chmod 755 mrestore5. If you want to restore the mail box for user tomm,type the following and follow the directions# /opt/insight/bin/mrestore6. You are now finished.******** Below is the start of the script file ********
******** named mrestore ********
#/bin/sh# This script, named mrestore, is intended to be
# used to restore a users mail box from a system
# running SCOoffice 4 on OpenServer 5.0.7. CPIO=/bin/cpio
GZCAT=/bin/gzcat
ARCDIR=/opt/insight/htdocs/is4web/tarclear
echo "What is the user name that you wish to restore mail
box for? "
read musermchar=`echo $muser|cut -b 1`ls $ARCDIRecho ""
echo "Type in the file name to be used to extract the
$muser mail box from: "
read mfileecho ""
echo "Extracting mail box for user $muser"
echo ""
sleep 2$GZCAT $ARCDIR/$mfile | cpio -icdmv
"/opt/insight/var/spool/imap/$mchar/user/$muser/*"echo ""
echo "Restore from archive has just completed. "
echo "Will now reconstruct $muser mail box"
echo ""
sleep 2su cyrus -c "/opt/insight/bin/reconstruct -rf user/$muser"echo ""
echo "The recontruct for user $muser is complete"- RESTORE FROM A CPIO ARCHIVE
---------------------------
You data has been backed up to tape with:# cd /
# find . -print | cpio -ovc -C32768 -O/dev/rmt/ctape1this will backup the mail in the format:
opt/insight/var/spool/imap ...and individual mailboxes would be restored with:
# cpio -ivdumc -C32768 -I/dev/rmt/ctape1 "opt/insight/var/spool/imap/m/user/myuser*"under the current location of where you ran "cpio" from.
Assuming that the user's mailbox data is now in:
/opt/insight/var/spool/imap/m/user/myuserthen prior to reconstructing the user's mailbox with:
/local/sysadm/reconstruct_mail.sh -----
echo "Running Reconstructing for $1 ... "
su cyrus -c "/opt/insight/bin/reconstruct -rf user/'$1'"
echo "Checking Quota ... "
su cyrus -c "/opt/insight/bin/quota -f user/$1"
echo "Setting Permissions ... "
A=`echo $1 | cut -c1` export A
if [ ! -d /opt/insight/var/spool/imap/$A/user/$1 ]; then
echo "User $1 does not exist!!"
exit 1
fi
chown -R cyrus:cyrus /opt/insight/var/spool/imap/$A/user/$1
echo "Done!"
-----Consider whether the Cyrus MailStore knows about the ACL's and folders for this particular user.
In which case it may be useful to each night take a cyrus dump of the Cyrus Mailstore database with:
# su cyrus -c "/opt/insight/bin/ctl_mboxlist -d" > cyrus.outto restore this completely then:# su cyrus -c "/opt/insight/bin/ctl_mboxlist -u" < cyrus.outNOTE: Quota is set in the Admin GUI for each user under View Mailboxes.This is stored and can be replicated to other servers in:
/opt/insight/var/imap/quota