Hi!
I was looking for a way to process all .tmda queue in my vpopmail based
system, but couldn't find anything... So I've tried to create a generic
vpopmnail script, that will process all tmda-enabled Maildir folders and
first send a message of (new) pending messages - and delete the old stuff
... I know parts of the script doesn't take into account if the pending
directory isn't placed in the default position etc... But hopefully the
script is usefull for someone.... put it in /etc/cron.daily or something
like that
Regards,
/Brian
#!/bin/bash
TMDABINPATH=~vpopmail/tmda/bin
for domain in `ls ~vpopmail/domains 2>/dev/null` ; do
# List all users in domain
for user in `ls ~vpopmail/domains/$domain 2>/dev/null` ; do
# Process all user accounts
# test if account has a TMDA directory
if [ -d ~vpopmail/domains/$domain/$user/.tmda ]; then
# Test, that a config file is present
if [ -f ~vpopmail/domains/$domain/$user/.tmda/config ]; then
# Config file exists, issue command
TMDAMSG=`${TMDABINPATH}/tmda-pending -c
~vpopmail/domains/$domain/$user/.tmda/config -C -b -s`
# Any feedback from command ? If yes, mail it!
if [ -n $TMDAMSG ]; then
echo $TMDAMSG | mail -s 'TMDA Pending summary'
[EMAIL PROTECTED] # 2>/dev/null >/dev/null
fi
# Check optional configured timeout for messages
TMDATIMEOUT=`grep '^TIMEOUT=' <
~vpopmail/domains/$domain/$user/.tmda/config | awk -F\" '{print $2}'`
if [ -z $TMDATIMEOUT ]; then
TMDATIMEOUT=5d
fi
# Issue command to cleanup pending directory
${TMDABINPATH}/tmda-pending -c
~vpopmail/domains/$domain/$user/.tmda/config -b -s -O $TMDATIMEOUT -d
2>/dev/null >/dev/null
fi
fi
done
done
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users