2 # This script performs postoffice updates.
6 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/etc:/usr/etc:/usr/athena/bin:/usr/local/bin
9 # The following exit codes are defined and MUST BE CONSISTENT with the
10 # error codes the library uses:
12 MR_MISSINGFILE=47836473
18 TARFILE=/var/tmp/po.out
19 SRC_DIR=/var/tmp/po.dir
20 IMAP_ROOT=/usr/local/cyrus
21 IMAP_CONFIG=${IMAP_ROOT}/config
22 IMAP_CHECK=${IMAP_CONFIG}/ignore_update_checks
23 IMAP_MBOXES=${IMAP_CONFIG}/mailboxes.input;
24 IMAP_QUOTA=${IMAP_CONFIG}/quota
25 IMAP_QINPUT=${IMAP_QUOTA}/input
26 IMAP_BIN=${IMAP_ROOT}/bin
33 if [ ! -r ${TARFILE} ]; then
41 uchost=`hostname | tr '[a-z]' '[A-Z]'`
42 echo $uchost | egrep -e "." > /dev/null
44 domain=`grep domain /etc/resolv.conf | awk '{print $2}' |tr '[a-z]' '[A-Z]'`
46 uchost=$uchost.$domain
55 if [ ! -d $uchost ]; then
56 echo "no directory for "$uchost
57 exit ${MR_MISSINGFILE}
67 cp mailboxes ${IMAP_MBOXES}
69 echo "failed to copy mailboxes"
73 if [ -r {$IMAP_MBOXES} ]; then
74 egrep "\..*\." ${IMAP_CONFIG}/mailboxes >> ${IMAP_MBOXES}
77 sort -o ${IMAP_MBOXES} ${IMAP_MBOXES}
85 cp quota ${IMAP_QINPUT}
87 echo "failed to copy quota"
95 cp ${IMAP_CONFIG}/mailboxes ${IMAP_CONFIG}/mailboxes.save
100 LD_LIBRARY_PATH=/usr/local/tcl/lib
101 export LD_LIBRARY_PATH
103 ${IMAP_BIN}/cyradm -file ${IMAP_BIN}/sync.cyradm sync -d
111 cp ${IMAP_CONFIG}/mailboxes ${IMAP_CONFIG}/mailboxes.backup
117 if [ -f ${TARFILE} ]; then
121 if [ -d ${SRC_DIR} ]; then