3 if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
4 source /a
/bin
/errhandle
/err
6 source /a
/bin
/bash_unpublished
/source-state
7 if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
12 # find but ignore directories which dont exist, assuming first args are directories
13 # and a following arg starts with -
17 if [[ $d == -* ]]; then
18 # past dirs, onto options
26 if (( ${#dirs[*]} )); then
31 # qemu-devel is our biggest list by far, so occasionally
32 # I want to hop into conversations about our mailing
33 # systems there, but I don't need many old messages.
34 myfind
/m
/md
/l
/qemu-devel
/new
-type f
-mtime +14 -execdir rm -- '{}' +
35 myfind
/m
/md
/l
/listhelper-moderatre
/new
-type f
-mtime +14 -execdir rm -- '{}' +
36 myfind
/m
/md
/{sec
,Spam
,Drafts
,{rtcc
,sysadmin
}/new
} -type f
-mtime +100 -execdir rm -- '{}' +
37 myfind
/m
/md
/log
-type f
-mtime +300 -execdir rm -- '{}' +
38 myfind
/m
/md
/dmarc
-type f
-mtime +60 -execdir rm -- '{}' +
39 myfind
/m
/md
/fsfalerts
-type f
-mtime +10 -execdir rm -- '{}' +
41 # not strictly a mail directory, but it fits well in this script
42 myfind
/p
/c
/.editor-backups
-type f
-mtime +300 -execdir rm -- '{}' +
54 [[ -d $d ]] ||
continue
55 leafdir
=${d##*/} # cur/new
56 archivebase
=${d%/*}-myarchive
57 archive
=$archivebase/$leafdir
58 mkdir
-p ${archivebase}/{cur
,tmp
,new
}
59 find $d -type f
-mtime +$days -name '1*' -exec mv '{}' $archive \
;
60 # count=$(find $d -type f -mtime +$days -name '1*' | wc -l)
61 # if (( count )); then
68 archive
400 .
/!(*archive|Drafts|Sent|INBOX
)/*(cur|new
) .
/l
/!(*archive
)/*(cur|new
)
69 archive
60 .
/{sysadmin
,rtcc
,fsfcc
,fsfmembers
}/{cur
,new
}
70 archive
14 .
/Junk
/{cur
,new
}