icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Email » new spamassassin script

Email General questions, webmail, mailing lists.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old July 29th, 2007, 1:31 AM   #10 (permalink)
Registered User
Fresh Surpasser
 
TheAngryPenguin's Avatar
 
Joined in Sep 2004
16 posts
Gave thanks: 0
Thanked 0 times
I am a little confused as to how I am supposed to customize this script for my environment. Here's how I had everything set up with the old mbox script:

Code:
#!/bin/sh
echo "Learning zSPAM"
for FILE in `find $HOME -name zSPAM -print`
do
echo "Processing $FILE"
sa-learn --spam --mbox $FILE
rm $FILE
touch $FILE
done

echo "Learning zHAM"
for FILE in `find $HOME -name zHAM -print`
do
echo "Processing $FILE"
sa-learn --ham  --mbox $FILE
rm $FILE
touch $FILE
done
echo "Done"
How do I set up the new script's "USER CONFIGURABLE VARIABLES" to mirror the old one?
TheAngryPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 29th, 2007, 5:01 PM   #11 (permalink)
Surpass Fan
Comfy Contributor
 
jdcopelin's Avatar
 
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
Quote:
Originally Posted by TheAngryPenguin View Post
I am a little confused as to how I am supposed to customize this script for my environment. Here's how I had everything set up with the old mbox script:

How do I set up the new script's "USER CONFIGURABLE VARIABLES" to mirror the old one?
Hi,
Sorry you've found configuring my script confusing. Looking at your previous scripts code I think you need these variables:
MYSPAM=.zSPAM
MYHAM=.zHAM

(and MYLEARNSPAM=.zLEARNSPAM)

I take it you put false-negatives into your zSPAM folder? If that is the case, you can just delete the section of code that deals with the learnspam folders (see below). It makes no difference to the learning process (I just found it easier to keep count of how many false-negatives my users were getting by keeping them separate from caught spam).

Code:
echo ""
echo "Learning from uncaught SPAM"
for SPAMFOLDER in `find $HOME/mail -name $MYLEARNSPAM -print`
        do
                echo -e "\n\t$SPAMFOLDER"
[snipped code]
                        mv -f --target-directory=$SPAMDIR $SPAM_FILES
                fi
done
I hope this helps. Run a home (or mail) directory backup first if you aren't sure of what you're doing! If you want I can show you how to run it on a specific (test) email account on your server so you can check the paths are correct before you run it on all your accounts in one go?

Regards
Jonathan
__________________
Server: Pass32 and dedicated server
jdcopelin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 29th, 2007, 5:38 PM   #12 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
Maybe I'm dumb, but I can't get it to work.

Can you post a For Dummys post on how to get this thing working?
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 29th, 2007, 5:58 PM   #13 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
Nevermind me.. It looks like I finally managed it

Quote:
Running jicoweb.com spam assassin training script

JicoScript learnspam script 0.6.20070609
SpamAssassin version 3.2.1

Currently running as user: bookieb

Checking spam and ham repositories exist...

Learning from SPAM

Learning from uncaught SPAM

Learning HAM

Synchronising spam database

Done
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 30th, 2007, 6:33 AM   #14 (permalink)
Surpass Fan
Comfy Contributor
 
jdcopelin's Avatar
 
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
Quote:
Originally Posted by Edwin View Post
Nevermind me.. It looks like I finally managed it
Hello Edwin,

I have created a new account on my server and created a test email account with spam, learnspam and ham folders (all three are empty). Here is what the output should be like:

Code:
Running jicoweb.com spam assassin training script

JicoScript learnspam script  0.6.20070609
SpamAssassin version 3.2.1

Currently running as user: demo

Checking spam and ham repositories exist...
/home/demo/spamdb exists!
/home/demo/hamdb exists!

Learning from SPAM

    /home/demo/mail/example.com/testuser/.spam
        no verified spam to learn!!
        not enough old spam!!

Learning from uncaught SPAM
    /home/demo/mail/example.com/testuser/.learnspam
        no spam messages to learn from!!

Learning HAM

    /home/demo/mail/example.com/testuser/.ham
        no ham messages to learn from!!
 
Synchronising spam database

Done
This is a little different to the output from when you ran the script on your account - so, it isn't finding maildir folders of the correct names. Did you change the names of the spam folders in the section towards the top of the file where it says "BEGIN USER CONFIGURABLE VARIABLES" and checked that you have used upper/lower case characters correctly? These lines here are the critical ones:

Code:
# 1. spammassassin spam delivery folder name
MYSPAM=.spam

# 2. learning spam (spam that arrived in the inbox, missed by spamassassin
MYLEARNSPAM=.learnspam

# 3. ham (spam which got marked as spam when it was a genuine email
MYHAM=.ham
Please let me know if I can help you further.

Cheers
Jonathan
__________________
Server: Pass32 and dedicated server
jdcopelin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 30th, 2007, 7:51 AM   #15 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
I will check this later, when I return from the evil thing called work.
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 30th, 2007, 11:23 AM   #16 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
Doh... I forgot... Thought it would run because it was in the same location. Didn't think of the /HOME thingy .. Changed it now though.
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 30th, 2007, 12:53 PM   #17 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
Damn.. Now I'm getting this:

Quote:
/bin/sh: /home/bookieb/sa-script/learnspam.php: /bin/sh
: bad interpreter: No such file or directory
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 31st, 2007, 5:55 PM   #18 (permalink)
Surpass Fan
Comfy Contributor
 
pseudoswede's Avatar
 
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
Okay, I'm testing this out on one of my domains. I ran the cron job just now, and I got this result...

Code:
Running jicoweb.com spam assassin training script

JicoScript learnspam script  0.6.20070609
SpamAssassin version 3.2.1

Currently running as user: ********

Checking spam and ham repositories exist...

Learning from SPAM

Learning from uncaught SPAM

Learning HAM
 
Synchronising spam database
expired old bayes database entries in 34 seconds
124948 entries kept, 49202 deleted
token frequency: 1-occurrence tokens: 70.03%
token frequency: less than 8 occurrences: 18.18%

Done
Is this running correctly?

Here are my user-configurable variables...

Code:
# BEGIN USER CONFIGURABLE VARIABLES
#
# The following two variables store where spam and ham are moved to once

SPAMDIR=$HOME/spamdb
HAMDIR=$HOME/hamdb

# Please change the values of these variables to the name of the folders you use for

# 1. spammassassin spam delivery folder name
MYSPAM=SPAM

# 2. learning spam (spam that arrived in the inbox, missed by spamassassin
MYLEARNSPAM=SPAM

# 3. ham (spam which got marked as spam when it was a genuine email
MYHAM=HAM
I have two mailboxes on this domain. The main account, which has a SPAM folder where I put all marked (but not high enough on points) and unmarked spam. For all spam with a score higher than (I think) 8, they get moved to the mailtrap mailbox. Every once in a while, I will move all spam in the mailtrap inbox into its own SPAM folder.
__________________
"In the end, everything will be fine - if it is not fine, it is not the end."
PseudoSwede
larvez.com
Dime9
pseudoswede is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On