1 |
douglas |
809 |
#!/usr/local/bin/bash |
2 |
|
|
# Setup Mail |
3 |
|
|
# |
4 |
|
|
# Douglas Thrift |
5 |
|
|
# |
6 |
|
|
# $Id$ |
7 |
|
|
|
8 |
douglas |
827 |
user="`whoami`" |
9 |
douglas |
912 |
maildir="$HOME/.dovecot_mail" |
10 |
douglas |
827 |
|
11 |
douglas |
912 |
umask 0077 |
12 |
|
|
|
13 |
douglas |
1452 |
for mailbox in 'INBOX' 'Sent Items' 'Drafts' 'Spam' 'Spam.False '{Negative,Positive} 'Deleted Items'; do |
14 |
douglas |
912 |
if [[ $mailbox == 'INBOX' ]]; then |
15 |
|
|
mailbox_dir="$maildir" |
16 |
|
|
else |
17 |
|
|
mailbox_dir="$maildir/.$mailbox" |
18 |
douglas |
809 |
fi |
19 |
douglas |
912 |
|
20 |
|
|
echo "$mailbox" |
21 |
|
|
mkdir -pv "$mailbox_dir/"{new,cur,tmp} |
22 |
|
|
|
23 |
|
|
if [[ $mailbox == 'INBOX' ]] && [[ ! -f "$mailbox_dir/subscriptions" ]]; then |
24 |
|
|
cat > "$mailbox_dir/subscriptions" <<-EOF |
25 |
|
|
INBOX |
26 |
|
|
Sent Items |
27 |
|
|
Drafts |
28 |
|
|
Spam |
29 |
|
|
Spam.False Negative |
30 |
|
|
Spam.False Positive |
31 |
douglas |
1452 |
Deleted Items |
32 |
douglas |
912 |
EOF |
33 |
|
|
fi |
34 |
douglas |
809 |
done |
35 |
|
|
|
36 |
douglas |
1452 |
ln -fhsv '.Sent Items' "$maildir/.Sent" |
37 |
|
|
ln -fhsv '.Deleted Items' "$maildir/.Trash" |
38 |
|
|
|
39 |
douglas |
912 |
umask 0022 |
40 |
|
|
|
41 |
douglas |
811 |
mkdir -pv ~/bin |
42 |
|
|
|
43 |
douglas |
827 |
if [[ "$user" == "douglas" ]]; then |
44 |
douglas |
924 |
install -pv SpamUpdate.pl ~/bin/SpamUpdate |
45 |
douglas |
829 |
install -pv FalsePositive.pl ~/bin/FalsePositive |
46 |
douglas |
809 |
else |
47 |
|
|
ln -fsv ~douglas/bin/SpamUpdate ~/bin/SpamUpdate |
48 |
douglas |
829 |
ln -fsv ~douglas/bin/FalsePositive ~/bin/FalsePositive |
49 |
douglas |
809 |
fi |
50 |
douglas |
1452 |
|
51 |
|
|
# vim: noexpandtab tabstop=4 |