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 » Make SPAM ASSASSIN work for you...

Email General questions, webmail, mailing lists.

Reply
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 11 votes, 4.82 average.
Old June 5th, 2007, 1:53 PM   #172 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
Oh, In that script do I have to change "SPAMFOLDER" to "SPAM" and "HAMFOLDER" to "HAM" as I named the folders "SPAM" and "HAM" based on the original thread?

Anything else I need to do? thanks
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 5th, 2007, 5:14 PM   #173 (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 kdanieli View Post
Oh, In that script do I have to change "SPAMFOLDER" to "SPAM" and "HAMFOLDER" to "HAM" as I named the folders "SPAM" and "HAM" based on the original thread?
Sorry for the late reply, I have been at work.

Here's one of the lines of code from the script with two words highlighted:

for SPAMFOLDER in `find /home/username/mail -name .spam -print`

The blue text is a shell variable, don't change it or the rest of the script won't work! The text in red should be the name of the spam folder (don't forget to include the dot). It is case sensitive.
Until the names match, spamassassin won't be able to "see" the emails. The fact the emails are still in their folders means that the script couldn't find the right folders either.

Quote:
Synchronising spam database
bayes: synced databases from journal in 1 seconds: 1053 unique entries (1464 total entries)
This line is perfectly normal. When sa-learn is called, we use the no-sync switch. As spamassassin learns messages it keeps a record of them in a "journal" until it is synchronised with the main database. Doing the synch once per run of the script is more efficient.

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 June 5th, 2007, 6:23 PM   #174 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
Thanks for explaining. I think I understand the first part. My folders are all named "SPAM" and "HAM" - all uppercase, as specified earlier in this thread. I'll go change the learnspam script and make "ham" and "spam" into upercase.

Thanks
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 5th, 2007, 6:29 PM   #175 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
I changed "ham" and "spam" to "HAM" and "SPAM" each twice: (See the first and fifth lines of each section below)

for SPAMFOLDER in `find /home/kdanieli/mail -name .SPAM -print`
do
echo " "
echo -e "\tProcessing verified spam in $SPAMFOLDER"
echo -n -e "\t\t"
find $SPAMFOLDER/cur -type f -name \*S | sa-learn --SPAM --no-sync -f -
echo -e "\t\tMoving messages marked as read..."
cd $SPAMFOLDER
cd ../.Trash
echo -n -e "\t\tCurrent Directory: " ; pwd
echo -n -e "\t\t"
for MSG in `find $SPAMFOLDER/cur -type f -name \*S`
do
#echo -e -n "\t\t\t" ; mv -v $MSG cur/
echo -n "." ; mv $MSG cur/

done
done

echo " "
echo "Learning from HAM"
for HAMFOLDER in `find /home/kdanieli/mail -name .HAM -print`
do
echo " "
echo -e "\tProcessing $HAMFOLDER/cur"
echo -n -e "\t\t"
find $HAMFOLDER/cur -type f -name \*, -or -name \*S | sa-learn --HAM --
no-sync -f -

echo -e "\t\tRemoving ham messages..."
echo -n -e "\t\t"
for MSG in `find $HAMFOLDER/cur -type f -name \*, -or -name \*S`
do
#rm -v $MSG
echo -n "." ; rm $MSG
done
done

echo " "
echo "Synchronising spam database"
sa-learn --sync --progress


-------------

Is that good?

Last edited by kdanieli; June 5th, 2007 at 6:33 PM..
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 6th, 2007, 9:36 AM   #176 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
OK it finally ran

(The line 5s needed not to change so I changed them back.)

It seems to have run...a couple of questions.

1) for HAM, it mentions 1 message processed in each folder - but there were many messages in most of the HAM folders

2) for the SPAM, it mentions an error in the script line 30

Here's what I got

Processing verified spam in /home/kdanieli/mail/kdanieli.com/kd/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/kd/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/ken/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/ken/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/spam/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/spam/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/kend/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/kend/.Trash

Learning from HAM

Processing /home/kdanieli/mail/kdanieli.com/kd/.HAM/cur
Learned tokens from 1 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/ken/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/spam/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/kend/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Synchronising spam database


Please see questions 1) & 2) above. thanks

Last edited by kdanieli; June 6th, 2007 at 9:43 AM..
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 6th, 2007, 4:26 PM   #177 (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 kdanieli View Post
I changed "ham" and "spam" to "HAM" and "SPAM" each twice: (See the first and fifth lines of each section below)

find $SPAMFOLDER/cur -type f -name \*S | sa-learn --SPAM --no-sync -f -
find $HAMFOLDER/cur -type f -name \*, -or -name \*S | sa-learn --HAM --no-sync -f -
Regarding the error on line 30
--SPAM has to be --spam because --spam is specifying a command parameter
the same goes for --HAM, it must be lowercase for sa-learn to understand the command. That is why it can't understand the --no-sync which is the second parameter.
I hope that explains it.

From reading through the rest of your post I can't see why it hasn't learned from any messages, other than because the --spam/--ham parameters were wrong it literally didn't know what to do, so didn't do anything with them.
Or, are you sure that a previous script run didn't move the messages out of the HAM/SPAM folders so there weren't any messages left in the folder to learn from?

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 June 6th, 2007, 8:35 PM   #178 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
This is what I have in the script now (so we're on the same page).

#!/bin/sh

for SPAMFOLDER in `find /home/kdanieli/mail -name .SPAM -print`
do
echo " "
echo -e "\tProcessing verified spam in $SPAMFOLDER"
echo -n -e "\t\t"
find $SPAMFOLDER/cur -type f -name \*S | sa-learn --spam --no-sync -f -
echo -e "\t\tMoving messages marked as read..."
cd $SPAMFOLDER
cd ../.Trash
echo -n -e "\t\tCurrent Directory: " ; pwd
echo -n -e "\t\t"
for MSG in `find $SPAMFOLDER/cur -type f -name \*S`
do
#echo -e -n "\t\t\t" ; mv -v $MSG cur/
echo -n "." ; mv $MSG cur/

done
done

echo " "
echo "Learning from HAM"
for HAMFOLDER in `find /home/kdanieli/mail -name .HAM -print`
do
echo " "
echo -e "\tProcessing $HAMFOLDER/cur"
echo -n -e "\t\t"
find $HAMFOLDER/cur -type f -name \*, -or -name \*S | sa-learn --ham --
no-sync -f -

echo -e "\t\tRemoving ham messages..."
echo -n -e "\t\t"
for MSG in `find $HAMFOLDER/cur -type f -name \*, -or -name \*S`
do
#rm -v $MSG
echo -n "." ; rm $MSG
done
done

echo " "
echo "Synchronising spam database"
sa-learn --sync --progress

Is that correct?
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 7th, 2007, 9:09 AM   #179 (permalink)
Registered User
Comfy Contributor
 
kdanieli's Avatar
 
Joined in Nov 2006
Hosted on SH107
105 posts
Gave thanks: 8
Thanked 0 times
I have changed to --spam and --ham as you said (see above) but I'm still getting the same error messages. (Error in line 30 and the counts). Also the HAM and SPAM folders have been purged by the script as you said.

Here is the report I get in email:


Processing verified spam in /home/kdanieli/mail/kdanieli.com/kd/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/kd/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/ken/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/ken/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/spam/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/spam/.Trash

Processing verified spam in /home/kdanieli/mail/kdanieli.com/kend/.SPAM
Learned tokens from 1 message(s) (1 message(s) examined)
Moving messages marked as read...
Current Directory: /home/kdanieli/mail/kdanieli.com/kend/.Trash

Learning from HAM

Processing /home/kdanieli/mail/kdanieli.com/kd/.HAM/cur
Learned tokens from 1 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/ken/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/spam/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Processing /home/kdanieli/mail/kdanieli.com/kend/.HAM/cur
Learned tokens from 0 message(s) (1 message(s) examined)
script/learnspam: line 30: no-sync: command not found
Removing ham messages...

Synchronising spam database
kdanieli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 7th, 2007, 4:04 PM   #180 (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 kdanieli View Post
I have changed to --spam and --ham as you said (see above) but I'm still getting the same error messages. (Error in line 30 and the counts).
I think I have spotted the problem - it looks like there is a break in line 29 as it thinks "--no-sync" is a command on line 30. All that needs to be on one line (ie the same as the similar line that it runs for learning spam). Sorry I didn't pick that up yesterday!

Hope that fixes it!
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
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