Tortuga error

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
Knikke
Forum User
Forum User
Posts: 7
Joined: Tue Sep 16, 2008 8:30 am

Tortuga error

Unread post by Knikke »

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:

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

What might be wrong?

Regards,
Knikke
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Unread post by exi1ed0ne »

Code: Select all

if [ -d $domain then 
Forgot to close the bracket and add a ";"
-Andy
Knikke
Forum User
Forum User
Posts: 7
Joined: Tue Sep 16, 2008 8:30 am

Unread post by Knikke »

I copied that file from http://www.atomicrocketturtle.com/tortu ... -client.sh

Now my file is:

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

Still there is that same problem...
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Unread post by exi1ed0ne »

Code: Select all

for user in `ls $MAILHOME/$domain`; do 
See if that clears it
-Andy
Knikke
Forum User
Forum User
Posts: 7
Joined: Tue Sep 16, 2008 8:30 am

Unread post by Knikke »

It helped! Thanks!

Following problem is:

[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?
Knikke
Forum User
Forum User
Posts: 7
Joined: Tue Sep 16, 2008 8:30 am

Unread post by Knikke »

I found the reason:

[root@spamfilter ~]# /root/qmhandle-1.3.2/qmHandle -a
Qmail isn't running, can't send messages!

So, my qmail wasn't running...

Starting helped:
[root@spamfilter ~]# /usr/bin/svc-start qmail
Post Reply