| Email General questions, webmail, mailing lists. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
new spamassassin script
Dear All,
Some of you who run your own spamassassin training scripts using cron might be interested in the latest update to the one I posted in one of the other threads on the subject. I completely re-wrote it to give better output and make configuration easier. I'm not a regular poster on these forums, but the forums have been a useful resource for me. So, this is a sort of thank-you to everyone here ![]() I suppose I have to say that it is run at your own risk, although I use this same file (with a couple of alterations for the names of folders) on live servers with numerous email accounts without any problems. If you run the script on your account, make sure you have backups, or use new spam/ham folders just for testing (use an IMAP client to copy from another email folder). There is a section clearly marked and documented at the top of the file to change the names of the folders the script looks for. As a summary: 1. It works with MAILDIR only 2. Finds all spam and ham folders of the same name in ALL email accounts for the cpanel account it is run on. 3. users have to move uncaught spam to a learnspam folder. 4. users should move false positives to a ham folder (and any legitimate messages they receive to balance the bayes database). 5. messages marked as read in the spam folder get learned from each time the script is run. 6. spam messages older than 7 days get automatically learnt. 7. the /new maildir folder does not get processed by this script, so nothing is done to messages that the user hasn't seen on their screen. 8. ham and spam messages are moved to (configurable) folders after the learning process. 9. it doesn't run sa-learn if there are no messages in the folders NOTE: If you have a dedicated server, DO NOT RUN AS ROOT unless you specifically know the consequences. You would only run as root if you use machine wide bayes databases etc. By default spamassassin runs per user (site). It was rather long to post as code/text, so I have attached it as a file. You will have to rename it once you FTP it to your account (and enable execute permissions on it). It is meant to be run via cron however often you feel it needs to run. Please let me know either on here or by email if you have problems or questions. If I can make any improvements I would be glad to hear your comments! Regards Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
| This user thanks jdcopelin for this great post! | Edwin (July 30th, 2007) |
|
|
#2 (permalink) |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Jonathan -
This may ultimately end up being a godsend! Thanks. I'll have a look at it. One of the servers I have some clients on is running 'maildir'...
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|
|
#3 (permalink) |
|
Surpass Fan
Seasoned Poster
Joined in Jun 2003
Lives in SoCal
Hosted on Vega
86 posts
Gave thanks: 1
Thanked 0 times
|
Will this work if you have mail forwarders? Instead of having additional mailboxes for all my email addys I just have forwarders set to send them to my main account. This prevents duplicate emails (one in the original mailbox and one in the main account the email was forwarded to).
__________________
funny, witty, thought provoking signature |
|
|
|
|
|
#5 (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:
Yes, the forwarded messages still end up being stored in the same way, so the script will work. I have webmaster and other aliases forwarded to another email address on the account and it works fine. The script lists all the mail folders as it is processing them so you can see where it has "been".Hope you find my script useful. Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#6 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Hello Edwin,
If your server uses maildir format and not mbox then I see know reason why it shouldn't work. There are two ways to find out which one your server has: 1) go to "server status" in one of your cpanel accounts. If exim shows as "(exim-4.66-0_cpanel_maildir)" then you have maildir. 2) if your server uses maildir format, the /home/username/mail folder for your account will have new/ cur/ and tmp/ directories. As long as the paths are set correctly in the script, then you shouldn't have any problems running it. If you do decide to run it, make a backup of the home directory just in case. Depending on how many people ask questions, I might add some info on how to change it to test just a single email account. Let me know how you get on with the script. There is an updated version in the pipeline already, so the more feedback I get the better it will become! Regards Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
#8 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Hmm not sure what gave you that idea
. Not all shared servers use maildir yet though. The script runs on a single cpanel account. I run the script on my reseller account (pass32) without any problems and my dedicated is a similar set-up to pass32.Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
#9 (permalink) | |
|
Surpassing Dutch
Super #1
Joined in Sep 2004
Hosted on SH98
2,556 posts
Gave thanks: 189
Thanked 45 times
|
I couldn't find any of those things you said in your earlier post. So I thought it must be dedicated. But maybe I just didn't check it good enough (a few beers do that) or the server is not yet ready for it.
Edit: It *WAS* the beers . this is what I found:Quote:
__________________
sh98
|
|
|
|
|