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 '
#!/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
#!/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
[root@spamfilter ~]# /root/qmhandle-1.3.2/qmHandle -s
Total messages: 4685
Messages with local recipients: 34
Messages with remote recipients: 3
Messages with bounces: 0
Messages in preprocess: 4648
Messages stuck in preprocess. What is the reason for it?