Currently Being ModeratedNov 9, 2012 7:20 PM (in response to essandess)
This is really helpful!
I was reading in Apple's advanced server admin manual that it was a default that the server will train junk mail at 2:15. Another let down ...
I think you should be writing the unofficial manual for all of us novices.
Any chance I could get your help about my quarantine problem? I think it is trying to deliver to the quarantine address, but fails, but don't know why.
Again thanks for your time is getting spam training set up.
Currently Being ModeratedDec 5, 2012 7:29 PM (in response to essandess)
I've never been happy with bayes training since the old cyrus shared mailbox days.
Users shouldn't need to redirect messages and sharing access to junkmail/notjunkmail imap accounts is cumbersome.
Today, I tackled this with a quick script which does this:
- Scans every mail user for 2 folders (junkmail/notjunkmail)
- Feeds those messages to sa-learn, to train the bayes filters.
I will add
- purge the user junkmail/notjunkmail folders of messages > 30 days old.
End result, users simply drag messages within their own imap account.
The script can specifcy the standard 'Junk' folder so that client apps that filter to 'Junk' will contribute to the common bayes DB.
This creates an easy to use training system which allows all users to contribute easily.
Requires no server config, users only need to add their training folders.
This feature may be added to spamtrainer in a future version.
Currently Being ModeratedDec 6, 2012 1:36 AM (in response to UptimeJeff)
This sounds great!
Any chance that you might share this script with the community?
Currently Being ModeratedDec 6, 2012 2:40 AM (in response to Jeff Hargrove)
spamtrainer is already available for download at http://osx.topicdesk.com/spamtrainer
It is compatible with Mountain Lion. It allows you to run it at any time you like, can backup/restore your bayes DB and purge learned messages.
The additional features mentioned by UptimeJeff will be added in a future release.
Currently Being ModeratedDec 6, 2012 4:09 AM (in response to pterobyte)
Are there any instructions for setting this up?
Currently Being ModeratedDec 6, 2012 4:43 AM (in response to Kostas B)
once installed, "spamtrainer -h" or "man spamtrainer" will show you the available parameters. You will also find a PDF document on your desktop.
Currently Being ModeratedDec 7, 2012 3:05 AM (in response to pterobyte)
I installed this today and get errors when using the -d option as follows:
server02:db admin$ sudo /usr/sbin/spamtrainer -d
/usr/sbin/spamtrainer: line 1625: /usr/bin/cvt_mail_data: No such file or directory
/usr/sbin/spamtrainer: line 1626: /usr/bin/cvt_mail_data: No such file or directory
Training from user folders
/usr/sbin/spamtrainer: line 1376: cd: /Library/Server/Mail/Data/mail//cur: No such file or directory
/usr/sbin/spamtrainer: line 1391: cd: /Library/Server/Mail/Data/mail//new: No such file or directory
Learned new SPAM (junk mail)
/usr/sbin/spamtrainer: line 1435: cd: /Library/Server/Mail/Data/mail//cur: No such file or directory
/usr/sbin/spamtrainer: line 1450: cd: /Library/Server/Mail/Data/mail//new: No such file or directory
Learned new HAM (not junk mail)
Syncing SpamAssassin Database
Displaying SpamAssassin Database Stats
0.000 0 14 0 non-token data: spam
0.000 0 63 0 non-token data: ham
Deleting learned HAM and SPAM
Output produced by spamtrainer Version 1.9.8
The database doesn't appear to be updated and the junk / notjunk mail is not deleted.
Appears to run OK and updates the database if run with no options.
This is with a standard mail setup (nothing moved to different locatins, junkmail and notjunkmail users exist and mailboxes can be accessed through the Mail client.
Currently Being ModeratedDec 7, 2012 3:45 AM (in response to Chris Goodwin)
What puzzles me is that you say it runs fine without the -d flag. The output you show is from a section where the -d flag doesn't count.
Looks like a path problem to me. Any chance you have spaces in volume or path names somewhere?
Could you mail me your dovecot configuration files?
Currently Being ModeratedDec 7, 2012 3:59 AM (in response to pterobyte)
Yep - space in the boot volume name (Server HD) as delivered. Is renaming that going to have any effects on any services?
Which dovecot files in particular are you referring to? (I'm still trying to find my way around the new architecture having move from using Snow Leopard Server - new setup not migration).
Currently Being ModeratedDec 7, 2012 4:04 AM (in response to Chris Goodwin)
Space in Boot volume path is not a problem usually.
I think I found an obscure bug. Can you try and run spamtrainer again. You should be prompted to update to 1.9.9 which should fix it. Sorry about that and thanks for the feedback.
P.S. Don't need it anymore, but for reference, the conf files are in /Library/Server/Mail/Config/dovecot/
Currently Being ModeratedDec 7, 2012 4:14 AM (in response to pterobyte)
That seems to have done the trick!!
Excellent service (as usual).
Just need tosetup the auto run and hopefully good to go.
Currently Being ModeratedDec 7, 2012 4:43 AM (in response to Chris Goodwin)
Sorry for this, but I need some clarification:
"When run, it will read the designated HAM and SPAM mailboxes, update the SpamAssassin databases and delete mail that has been learned from".
Suppose I create these mailboxes using: spamtrainer -p mymailpartition -j myjunkmailbox -n mynotjunkmailbox -d
1. How the users are aware of these mailboxes? Or is this the messages confirmed as "Junk" in their Mail client.
2. What -d (delete processed mail) means?
3. I have set all the marked as junk to redirect to a specific mail account and the users check this mailbox for any false marked items. Can they "whitelist" addresses from there?
Currently Being ModeratedDec 7, 2012 8:58 AM (in response to Kostas B)
spamtrainer will not create any mailboxes for you. The -p -j and -n parameters are only so you can point spamtrainer to different accounts. spamtrainer makes the same assumptions Apple's learn_junk_mail script does. It also uses the same backend software - spamassassin's sa-learn.
It is simply more flexible because you can give it different parameters if you have customised your system. It also allows you to delete spam and ham messages that you put in the junkmail and notjunkmail mailboxes after it has learned those messages.
Running spamtrainer or learn_junk_mail will train the bayes DB. It is not a whitelist. Whitelisting can be done in amavisd.conf or a configuration file like local.cf
Currently Being ModeratedDec 9, 2012 4:46 PM (in response to essandess)
Oddly when I run "sudo serveradmin settings mail:imap | grep junk" on a brand new 10.8 Server install, I receive the following:
mail:imap:junk_mail_userid = ""
mail:imap:not_junk_mail_userid = ""
I've tried to set them manually with the following command:
sudo serveradmin settings mail:imap:junk_mail_userid = "junkmail"
This command does not seem to change the status at all. Any advice?
Thanks in advance.