store | blogs | forums | twitter | facebook | wiki | downloads | support portal
Atomic Secure Linux
It is currently Fri Oct 24, 2014 7:47 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Tortuga error
Unread postPosted: Mon Sep 29, 2008 2:59 am 
Offline
Forum User
Forum User

Joined: Tue Sep 16, 2008 8:30 am
Posts: 7
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:
#!/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


Top
 Profile  
 
 Post subject:
Unread postPosted: Mon Sep 29, 2008 7:07 am 
Offline
Forum Regular
Forum Regular

Joined: Sun Nov 20, 2005 4:16 pm
Posts: 187
Location: Right Behind You!
Code:
if [ -d $domain then


Forgot to close the bracket and add a ";"

_________________
-Andy


Top
 Profile  
 
 Post subject:
Unread postPosted: Mon Sep 29, 2008 7:34 am 
Offline
Forum User
Forum User

Joined: Tue Sep 16, 2008 8:30 am
Posts: 7
I copied that file from http://www.atomicrocketturtle.com/tortu ... -client.sh

Now my file is:

Code:
#!/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...


Top
 Profile  
 
 Post subject:
Unread postPosted: Mon Sep 29, 2008 8:15 am 
Offline
Forum Regular
Forum Regular

Joined: Sun Nov 20, 2005 4:16 pm
Posts: 187
Location: Right Behind You!
Code:
for user in `ls $MAILHOME/$domain`; do


See if that clears it

_________________
-Andy


Top
 Profile  
 
 Post subject:
Unread postPosted: Wed Oct 01, 2008 2:12 am 
Offline
Forum User
Forum User

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


Top
 Profile  
 
 Post subject:
Unread postPosted: Wed Oct 01, 2008 3:26 am 
Offline
Forum User
Forum User

Joined: Tue Sep 16, 2008 8:30 am
Posts: 7
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group