aboutsummaryrefslogtreecommitdiff
path: root/mail-archive
blob: 79d652c5c57ade3264c96084bd6b89d577e597f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#
# Simple mail archiving tool.
#

# Setup.
INBOX="INBOX"
ZNBOX="ZNBOX"
YEAR="${1:=`date +%Y`}"
mkdir -p ~/mail/$ZNBOX/$YEAR/

# Archive mail.
mv ~/mail/$INBOX.* ~/mail/$ZNBOX/$YEAR/

# Start with a fresh folder structure.
for folder in `ls -1 ~/mail/$ZNBOX/$YEAR/ | grep $INBOX.`; do
  mkdir -p ~/mail/$folder/{cur,new,tmp}
done