Quote:
Originally Posted by aaron01
Bigjohn- thanks for all the information you have provided here! I am having a little trouble getting the script to work, in fact the same problem that grokdesigns was having that he mentioned back on page 6. I contacted him to see if he figured anything out about it but he hadn't yet.
The problem is when the script ran, I had the following e-mailed to me:
Learning SPAM
Learning HAM
Done
So I decided to check /home/(user)/mail/(domain)/aaron/ to see if the SPAM and HAM folders were listed there. They were, but they, and every other folder, had a dot "." in front of them. So they were .SPAM and .HAM. So in the script, I decided to add a dot in front of the folder names, and when the script ran this is the result that I received:
Learning SPAM
Processing /home/(user)/mail/(domain)/aaron/.SPAM
Learned tokens from 0 message(s) (0 message(s) examined)
Learning HAM
Processing /home/(user)/mail/(domain)/aaron/.HAM
Learned tokens from 0 message(s) (0 message(s) examined)
rm: cannot remove `/home/(user)/mail/(domain)/aaron/.HAM': Is a directory
Done
I do have messages in both the SPAM and HAM folders. I'm not sure why exactly it isn't working, but I would appreciate any help! 
|
The .SPAM (dot SPAM) folder indicates your host server's email system uses maildirs instead of mbox format mail files.
Inside the .SPAM and .HAM folder or any other extra folders you created through your email client / horde are sub folders cur, new, and tmp.
Each of those sub folders contains individual mail message files, rather than mbox files.
Your email client shows the folders as SPAM, HAM, etc. (without the dot)
Do you see any files with names like courierimapsunscribed? If so, your host probably runs Courier-imap.
You might be able to modify the learnspam script so that it no longer uses the --mbox option and correctly finds the dot-prefixed folders. The read messages are in cur and the unread messages are in new.
Change the code for the find command and the sa-learn lines:
Code:
for FILE in `find $HOME -path '*SPAM/cur' -print`
...
sa-learn --spam $FILE
Do the same for the HAM lines.
(Notice that the -name parameter changed to -path for the find commands) This is using the bash shell. I have not fully tested this yet but, hypothetically, it looks like it should work.
Also, here are a few links that might be helpful:
http://wiki.apache.org/spamassassin/BayesInSpamAssassin
http://wiki.apache.org/spamassassin/RemoteImapFolder
http://da.andaka.org/Doku/imapspamfilter.html