View previous topic :: View next topic |
Author |
Message |
dashnu l33t
Joined: 21 Jul 2004 Posts: 703 Location: Casco Maine
|
Posted: Thu Jun 08, 2006 12:24 pm Post subject: cyrus / postfix / always_bcc and archiving mail.. |
|
|
I need figure out an good archival plan for my mail server (or fix the current one).
Currently I use always_bcc which goes to a archiver@mydomain.net.
Each night after I backup the current imap directories I tar up this archiver's mail dirs. and save it off to a safe place...
Code: | # Mail Arch Back Start
echo "Arch Mail Backup" >> /tmp/arch.log
$TAR zcPpfX $TARGET_PATH/arch-`date +%m%d%y`.tar.gz $ARCH_PATH/* >> /tmp/arch.log 2>&1 >> /tmp/arch.log
#Call this sript to clean up old mails
/usr/local/bin/arch-delete.sh >> /tmp/arch.log 2>&1 >> /tmp/arch.log
|
The last script I call is the problem child.. At this point I want to remove all the backed up mail form archivers account.
Code: |
#!/bin/sh
ARCHDIR=archiver
DIR=/var/spool/imap/user/$ARCHDIR
C=0
if [ -d $DIR ];then
cd $DIR && echo now in $DIR
for I in *.
do
if [ -f $I ]; then
echo $I, $C
rm -v $I
let C++
fi
done
# as user cyrus reconstruct the maildir files
su - cyrus -c "reconstruct -r $ARCHDIR"
echo "processed $C mails"
else
echo $DIR not found
exit 1
fi
|
This for the most part does what I expected. It removes the mail files but the messages still remain but totally empty.
What am I doing wrong. This is all done while the cyrus server is off.
Any other ideas how I can accomplish this would also be great.. Maybe there is some software I could use.
I am prepping up for a requirement my work will soon have. That is, I must save mail for 7 years. _________________ write quit bang |
|
Back to top |
|
|
dashnu l33t
Joined: 21 Jul 2004 Posts: 703 Location: Casco Maine
|
Posted: Fri Jun 09, 2006 12:27 pm Post subject: |
|
|
..b..u..m..p.. _________________ write quit bang |
|
Back to top |
|
|
|