#!/bin/sh if [ ! "$1" -o ! "$2" ] then echo "Need a dir and a To: address (i.e. the google group's address)." exit 1 fi DIRECTORY=$1 TO_ADDRESS=$2 MYDIR=$(dirname $0) UNDERS_DIRS=$(echo $1 | sed 's/-/_/g') $MYDIR/check_mails_thorough.sh $DIRECTORY #echo #echo "OK, here's mutt so you can see how the dup situation looks, as a sanity check on the dedup run." #echo #echo "Expected number of mails: $(find $DIRECTORY -name rejected -prune -o -name .mh_sequences -prune -o -type f -print | wc -l)" #echo #read # #mutt -f $DIRECTORY sudo -u nobody $MYDIR/manual_dedup.sh $DIRECTORY echo echo "Stopping before mutt in case the dedup went poorly" echo echo "Expected number of mails: $(find $DIRECTORY -name rejected -prune -o -name .mh_sequences -prune -o -type f -print | wc -l)" echo read #mutt -e 'macro index B .*\nlojban@googlegroups.com\nyq' -e 'set envelope_from=yes' -e "set from=upload_$UNDERS_DIRS@teddyb.org" -f $DIRECTORY find $DIRECTORY -name rejected -prune \ -o -name .mh_sequences -prune \ -o -name ',*' -prune \ -o -type f -print | \ xargs -n 1 -i $MYDIR/resend.sh {} $TO_ADDRESS echo echo echo grep upload_ /var/log/exim4/mainlog | grep -v '<= upload_' | tail echo echo echo "DONE WITH MONTH $1"