martexx
Verified User
Hello,
I nedeed a way of spamassassin to get intiligent.
So i updated spamassassin with all kind of new rules and info and it blocked 97% of the spam.
Then i discovered sa-learn
as i (think) i understand sa-learn does the learning as the user wich invokes the command.
YThis is offcource not what i want. bacause i have many different accounts on the server. what is spam to user1 can be ham for user2.
So i thought i could install the spam button plugin in to squirrelmail. so that users can teach the spamassassin what is spam and ham for them
But in the config file for the spam button plugin for squirrelmail ar a lot off options wich i cant set due to a lack of knowledge.
squirrelmail is run as user nobody i think, so in the config file i need to set the option so that if the "this is spam" button is pressed a sa-learn command is invoked, but as the user who is reading his email and NOT as the nobody user.
how do i do this?
the options in the plugin config.php ar as followed
// Sample for SpamAssassin:
//
//$is_spam_shell_command = '/usr/bin/sa-learn --spam --configpath=/etc/spamassassin -p /root/.spamassassin/user_prefs';
//$is_not_spam_shell_command = '/usr/bin/sa-learn --ham --configpath=/etc/spamassassin -p /root/.spamassassin/user_prefs';
//
// Sample for SpamAssassin per-user configuration:
//
//$is_spam_shell_command = '/usr/bin/sa-learn --spam --username=###EMAIL_ADDRESS###';
//$is_not_spam_shell_command = '/usr/bin/sa-learn --ham --username=###EMAIL_ADDRESS###';
//
// Advanced sample for SpamAssassin:
//
// In order to make sure you are running sa-learn as the correct user (else it will be
// run as the user that your web server runs as), you may need to run the command with
// sudo. In /etc/sudoers, you will want to set this:
//
// web_server_user ALL=(sa_user) NOPASSWD: /usr/bin/sa-learn, /usr/bin/spamassassin
//
// Where you need to change "web_server_user" to the actual userID of the user running
// your web server, and "sa_user" to the user that should run sa-learn (or spamassasin).
//
// After that, one of the following command pairs should work for you (remember to
// replace "sa_user" with the correct username):
//
//$is_spam_shell_command = 'sudo -u sa_user /usr/bin/sa-learn --spam';
//$is_not_spam_shell_command = 'sudo -u sa_user /usr/bin/sa-learn --ham';
//
//$is_spam_shell_command = 'sudo -u sa_user /usr/bin/spamassassin -r --configpath=/etc/spamassassin -p /root/.spamassassin/us$
//$is_not_spam_shell_command = 'sudo -u sa_user /usr/bin/spamassassin -k --configpath=/etc/spamassassin -p /root/.spamassassi$
//
//
//
would this work out off the box if i set it to use the per user config option?
Thanks in advance
I nedeed a way of spamassassin to get intiligent.
So i updated spamassassin with all kind of new rules and info and it blocked 97% of the spam.
Then i discovered sa-learn
as i (think) i understand sa-learn does the learning as the user wich invokes the command.
YThis is offcource not what i want. bacause i have many different accounts on the server. what is spam to user1 can be ham for user2.
So i thought i could install the spam button plugin in to squirrelmail. so that users can teach the spamassassin what is spam and ham for them

But in the config file for the spam button plugin for squirrelmail ar a lot off options wich i cant set due to a lack of knowledge.
squirrelmail is run as user nobody i think, so in the config file i need to set the option so that if the "this is spam" button is pressed a sa-learn command is invoked, but as the user who is reading his email and NOT as the nobody user.
how do i do this?
the options in the plugin config.php ar as followed
// Sample for SpamAssassin:
//
//$is_spam_shell_command = '/usr/bin/sa-learn --spam --configpath=/etc/spamassassin -p /root/.spamassassin/user_prefs';
//$is_not_spam_shell_command = '/usr/bin/sa-learn --ham --configpath=/etc/spamassassin -p /root/.spamassassin/user_prefs';
//
// Sample for SpamAssassin per-user configuration:
//
//$is_spam_shell_command = '/usr/bin/sa-learn --spam --username=###EMAIL_ADDRESS###';
//$is_not_spam_shell_command = '/usr/bin/sa-learn --ham --username=###EMAIL_ADDRESS###';
//
// Advanced sample for SpamAssassin:
//
// In order to make sure you are running sa-learn as the correct user (else it will be
// run as the user that your web server runs as), you may need to run the command with
// sudo. In /etc/sudoers, you will want to set this:
//
// web_server_user ALL=(sa_user) NOPASSWD: /usr/bin/sa-learn, /usr/bin/spamassassin
//
// Where you need to change "web_server_user" to the actual userID of the user running
// your web server, and "sa_user" to the user that should run sa-learn (or spamassasin).
//
// After that, one of the following command pairs should work for you (remember to
// replace "sa_user" with the correct username):
//
//$is_spam_shell_command = 'sudo -u sa_user /usr/bin/sa-learn --spam';
//$is_not_spam_shell_command = 'sudo -u sa_user /usr/bin/sa-learn --ham';
//
//$is_spam_shell_command = 'sudo -u sa_user /usr/bin/spamassassin -r --configpath=/etc/spamassassin -p /root/.spamassassin/us$
//$is_not_spam_shell_command = 'sudo -u sa_user /usr/bin/spamassassin -k --configpath=/etc/spamassassin -p /root/.spamassassi$
//
//
//
would this work out off the box if i set it to use the per user config option?
Thanks in advance