Tortuga error
Posted: Mon Sep 29, 2008 2:59 am
I got error message when I ran tortuga user client file (/root/bin/tortuga-user-client_antispam.sh):
/root/bin/tortuga-user-client_antispam.sh: line 25: syntax error near unexpected token `if'
/root/bin/tortuga-user-client_antispam.sh: line 25: ` if [ -d $MAILHOME/$domain/$user/Maildir/.HAM/cur ]; then '
Code inside of tortuga-user-client_antispam.sh:
What might be wrong?
Regards,
Knikke
/root/bin/tortuga-user-client_antispam.sh: line 25: syntax error near unexpected token `if'
/root/bin/tortuga-user-client_antispam.sh: line 25: ` if [ -d $MAILHOME/$domain/$user/Maildir/.HAM/cur ]; then '
Code inside of tortuga-user-client_antispam.sh:
Code: Select all
#!/bin/sh
MAILHOME=/var/qmail/mailnames/
CONFIG=/etc/mail/tortuga_antispam/
SALEARN="/usr/bin/sa-learn -C $CONFIG -u GLOBAL --showdots "
# Check for lock file
if [ -f /var/lock/spam-training ]; then
exit
fi
touch /var/lock/spam-training
# Get list of domains
for domain in `ls $MAILHOME`; do
# is it a directory
if [ -d $domain then
## get list of users
for user in `ls $MAILHOME/$domain` do
# check for ham dir
if [ -d $MAILHOME/$domain/$user/Maildir/.HAM/cur ]; then
# find all ham, and train
$SALEARN --ham $MAILHOME/$domain/$user/Maildir/.HAM/cur
# get rid of old ham
rm -f $MAILHOME/$domain/$user/Maildir/.HAM/cur/*
fi
# check for spam dir
if [ -d $MAILHOME/$domain/$user/Maildir/.SPAM/cur ]; then
# find all spam, and train
$SALEARN --spam $MAILHOME/$domain/$user/Maildir/.SPAM/cur
# get rid of old spam
rm -f $MAILHOME/$domain/$user/Maildir/.SPAM/cur/*
fi
done
fi
done
Regards,
Knikke