If you are running postfix/dovecot using the server app on OSX 10.8.x and want to implement the markasjunk2 plugin for roundcube, allow me to save you hours of frustration… Here are the settings that worked for me.
Assuming you intent to use sa-learn to update the Bayesian filter when using the plugin, modify config.inc.php as follows:
$rcmail_config[‘markasjunk2_learning_driver’] = cmd_learn;
$rcmail_config[‘markasjunk2_spam_cmd’] = ‘sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/sa-learn –spam %f’;
Set ham options for learn driver:
$rcmail_config[‘markasjunk2_ham_cmd’] = ‘sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/sa-learn –ham %f’;
$rcmail_config[‘markasjunk2_debug’] = true;
In order for roundcube to call sa-learn with access permission to spamassassin database, it is necessary to update the sudoers file.
Open terminal and type: sudo visudo
(homebrew is so much easier on the eyes)
Once in the sudoers file, add the following line:
_www ALL=(root) NOPASSWD:/Applications/Server.app/Contents/ServerRooy/usr/bin/sa-learn
After you have added the changes, save your changes – ‘:’ brings up menu and ‘w’ to write changes. Then ‘:’ and ‘q’ to quit (I prefer nano to vim, but supposedly there is some voodoo about changing the sudoers file in an unsafe manner and you’ll shoot your eye out.. blah blah blah.
Open roundcube inbox, and mash the junk button, and see the results in the log file:
Here are some good references (without which, I’d have never gotten this working):
- http://www.roundcubeforum.net/index.php/topic,5957.0 (good stuff at the bottom of page 2)