$ARCHIVES_BIN/generate-list-descriptions
-for list in `ls $MAJORDOMO_FILES`; do
- cd $ARCHIVES_ROOT
- listdir=$MAJORDOMO_FILES/$list/files/public/archive
-
- if [ ! -d $listdir ]; then
- continue
- fi
- # If the list is present in the "blacklist file", do not archive it, and
- # send a complain by email, but throttle it so that it's not too obnoxious.
- if grep "$list" $ARCHIVES_BIN/blacklist >/dev/null 2>&1; then
- complainfile=${list}_complained
- if [ -f $complainfile ]; then
- # already complained, but remove file if it's too old. This makes us
- # complain once every 12 hours
- age=`stat --format=%Y $complainfile`
- now=`date +%s`
- if [ $(($now - $age)) -gt $((60 * 60 * 12)) ]; then
- rm $complainfile
- fi
- continue
- fi
- # use a subscribed address so that it is not held for moderation
- echo "warning: sensitive list $list found on archives" | mail -s "sensitive list found" $DESTINATION_ADDRESS -- -f $SOURCE_ADDRESS
- touch $complainfile
- continue
- fi
- if [ ! -d "$list" ]; then
- mkdir $list
- fi
- cd $list
-
- for mbox in `ls --reverse $listdir`; do
- path=$listdir/$mbox
- mbox=${mbox%%.gz} # remove possible trailing .gz
+process_one_mbox() {
+ local path mbox ymon year month ydashm rcfile doit gzipped
+ path=$1
+ mbox=$2
ymon=${mbox##*.} # extract yyyymm
year=${ymon%%??} # extract yyyy
month=${ymon##????} # extract mm
fi
fi
date > $ydashm/last-checked
+}
+
+for list in `ls $MAJORDOMO_FILES`; do
+ cd $ARCHIVES_ROOT
+ listdir=$MAJORDOMO_FILES/$list/files/public/archive
+
+ if [ ! -d $listdir ]; then
+ continue
+ fi
+ # If the list is present in the "blacklist file", do not archive it, and
+ # send a complain by email, but throttle it so that it's not too obnoxious.
+ if grep "$list" $ARCHIVES_BIN/blacklist >/dev/null 2>&1; then
+ complainfile=${list}_complained
+ if [ -f $complainfile ]; then
+ # already complained, but remove file if it's too old. This makes us
+ # complain once every 12 hours
+ age=`stat --format=%Y $complainfile`
+ now=`date +%s`
+ if [ $(($now - $age)) -gt $((60 * 60 * 12)) ]; then
+ rm $complainfile
+ fi
+ continue
+ fi
+ # use a subscribed address so that it is not held for moderation
+ echo "warning: sensitive list $list found on archives" | mail -s "sensitive list found" $DESTINATION_ADDRESS -- -f $SOURCE_ADDRESS
+ touch $complainfile
+ continue
+ fi
+ if [ ! -d "$list" ]; then
+ mkdir $list
+ fi
+ cd $list
+
+ for mbox in `ls --reverse $listdir`; do
+ path=$listdir/$mbox
+ mbox=${mbox%%.gz} # remove possible trailing .gz
+
+ process_one_mbox $path $mbox
done
# XXX maybe this can be done better with mod_rewrite?