Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cyrus / postfix / always_bcc and archiving mail..
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dashnu
l33t
l33t


Joined: 21 Jul 2004
Posts: 703
Location: Casco Maine

PostPosted: Thu Jun 08, 2006 12:24 pm    Post subject: cyrus / postfix / always_bcc and archiving mail.. Reply with quote

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
View user's profile Send private message
dashnu
l33t
l33t


Joined: 21 Jul 2004
Posts: 703
Location: Casco Maine

PostPosted: Fri Jun 09, 2006 12:27 pm    Post subject: Reply with quote

..b..u..m..p..
_________________
write quit bang
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum