2007-11-19 23:06

by Vasil Kolev

Seems like the day is nice for stuff like this:

#!/bin/sh
for i in `grep mailman 02fsa-alias|grep -v \#|cut -d : -f 1 `; do
        cmd=`grep -w ^$i: 02fsa-alias|cut -d \| -f 2-|sed 's/\//_/g'`;
        sed "s/CMD/\|$cmd/;s/_/\//g" procmailrc.template  > /home/fsa/mail/conf/procmailrc.$i
        sed -i 's/^'$i':.*$/'$i': | procmail _home_fsa_mail_conf_procmailrc.'$i'/;s/_/\//g' a2
done
mailq |grep -B 1 ^daemon|grep Nov|awk '{print $2}'|xargs -n1 cancelmsg

Leave a Reply