|
|
#172 (permalink) |
|
Registered User
Comfy Contributor
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 |
|
|
|
|
|
#173 (permalink) | ||
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
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:
Regards Jonathan
__________________
Server: Pass32 and dedicated server |
||
|
|
|
|
|
#174 (permalink) |
|
Registered User
Comfy Contributor
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 |
|
|
|
|
|
#175 (permalink) |
|
Registered User
Comfy Contributor
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.. |
|
|
|
|
|
#176 (permalink) |
|
Registered User
Comfy Contributor
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.. |
|
|
|
|
|
#177 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
--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 |
|
|
|
|
|
|
#178 (permalink) |
|
Registered User
Comfy Contributor
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? |
|
|
|
|
|
#179 (permalink) |
|
Registered User
Comfy Contributor
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 |
|
|
|
|
|
#180 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
Hope that fixes it! Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|