Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: jimmi on April 21, 2011, 06:36:27 AM

Title: Markasjunk2 + sa-learn: no logs
Post by: jimmi on April 21, 2011, 06:36:27 AM
Sure it is something stupid, but I cannot see the point :(

I'm using markasjunk2 with the following config.inc.php:
$rcmail_config['markasjunk2_learning_driver'] = cmd_learn;
$rcmail_config['markasjunk2_read_spam'] = true;
$rcmail_config['markasjunk2_unread_ham'] = false;
$rcmail_config['markasjunk2_detach_ham'] = true;
$rcmail_config['markasjunk2_spam_flag'] = 'Junk';
$rcmail_config['markasjunk2_ham_flag'] = null;
$rcmail_config['markasjunk2_debug'] = true;
$rcmail_config['markasjunk2_mb_toolbar'] = true;
$rcmail_config['markasjunk2_spam_cmd'] = '/usr/bin/sa-learn -D --spam --username=spamassassin %f  2>&1';
$rcmail_config['markasjunk2_ham_cmd'] = 'sa-learn --ham --username=spamassassin %f';
$rcmail_config['markasjunk2_spam_dir'] = null;
$rcmail_config['markasjunk2_ham_dir'] = null;
$rcmail_config['markasjunk2_filename'] = null;
$rcmail_config['markasjunk2_email_spam'] = null;
$rcmail_config['markasjunk2_email_ham'] = null;
$rcmail_config['markasjunk2_email_attach'] = true;
$rcmail_config['markasjunk2_email_subject'] = 'learn this message as %t';
$rcmail_config['markasjunk2_sauserprefs_config'] = '../sauserprefs/config.inc.php';

sa-learn is working because I see the tokens increasing using "sa-learn --dump magic", I wanted to make some debug but I cannot find any log, except the following:
88.149.227.234 - - [21/Apr/2011:07:12:32 +0200] "POST /?_task=mail&_action=plugin.markasjunk2.junk HTTP/1.1" 200 252 "https://rc.7girello.net/?_task=mail" "Mo
zilla/5.0 (X11; U; Linux i686; it; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16"
88.149.227.234 - - [21/Apr/2011:07:13:45 +0200] "POST /?_task=mail&_action=moveto HTTP/1.1" 200 398 "https://rc.7girello.net/?_task=mail" "Mozilla/5.0 (X11; U
; Linux i686; it; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16"


Any suggestion to?

Thanks in advance :)
Jimmi
Title: Markasjunk2 + sa-learn: no logs
Post by: JohnDoh on April 21, 2011, 07:33:12 AM
You're just trying to find the debug log file? It depends where RC is configued to do its logging but by default its in the logs dir inside the roundcube folder (assuming the webserver can write to it)
Title: Markasjunk2 + sa-learn: no logs
Post by: jimmi on April 21, 2011, 10:13:39 AM
Yep, that's it! Apologize for the poor knowledge of RC ;)
Title: Markasjunk2 + sa-learn: no logs
Post by: guillermitus on April 25, 2011, 12:28:16 PM
Quote from: jimmi;34373Sure it is something stupid, but I cannot see the point :(

I'm using markasjunk2 with the following config.inc.php:
$rcmail_config['markasjunk2_learning_driver'] = cmd_learn;
$rcmail_config['markasjunk2_read_spam'] = true;
$rcmail_config['markasjunk2_unread_ham'] = false;
$rcmail_config['markasjunk2_detach_ham'] = true;
$rcmail_config['markasjunk2_spam_flag'] = 'Junk';
$rcmail_config['markasjunk2_ham_flag'] = null;
$rcmail_config['markasjunk2_debug'] = true;
$rcmail_config['markasjunk2_mb_toolbar'] = true;
$rcmail_config['markasjunk2_spam_cmd'] = '/usr/bin/sa-learn -D --spam --username=spamassassin %f  2>&1';
$rcmail_config['markasjunk2_ham_cmd'] = 'sa-learn --ham --username=spamassassin %f';
$rcmail_config['markasjunk2_spam_dir'] = null;
$rcmail_config['markasjunk2_ham_dir'] = null;
$rcmail_config['markasjunk2_filename'] = null;
$rcmail_config['markasjunk2_email_spam'] = null;
$rcmail_config['markasjunk2_email_ham'] = null;
$rcmail_config['markasjunk2_email_attach'] = true;
$rcmail_config['markasjunk2_email_subject'] = 'learn this message as %t';
$rcmail_config['markasjunk2_sauserprefs_config'] = '../sauserprefs/config.inc.php';

sa-learn is working because I see the tokens increasing using "sa-learn --dump magic", I wanted to make some debug but I cannot find any log, except the following:
88.149.227.234 - - [21/Apr/2011:07:12:32 +0200] "POST /?_task=mail&_action=plugin.markasjunk2.junk HTTP/1.1" 200 252 "https://rc.7girello.net/?_task=mail" "Mo
zilla/5.0 (X11; U; Linux i686; it; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16"
88.149.227.234 - - [21/Apr/2011:07:13:45 +0200] "POST /?_task=mail&_action=moveto HTTP/1.1" 200 398 "https://rc.7girello.net/?_task=mail" "Mozilla/5.0 (X11; U
; Linux i686; it; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16"


Any suggestion to?

Thanks in advance :)
Jimmi

$rcmail_config['markasjunk2_spam_cmd'] = '/usr/bin/sa-learn -D --spam --username=spamassassin %f  2>&1';
$rcmail_config['markasjunk2_ham_cmd'] = 'sa-learn --ham --username=spamassassin %f';

you have to correct this to lines,
your www-data user will try to make the /var/www/.spamassasin/ folder for the lock files, try with somthing like this

$rcmail_config['markasjunk2_ham_cmd'] = 'sa-learn --ham --username=spamassassin --cf=\'bayes_path /home/%u/.spamassassin/bayes\' --prefspath=/home/%u/.spamassassin/user_prefs %f';


and correct the permission for the apache user to read and write data tho the /home/userX/.spamassasin folder

the --username option do not make this command to be run as another user

just tel me if you dont understand, i speak spanish
Title: Re: Markasjunk2 + sa-learn: no logs
Post by: cypriot on May 25, 2012, 09:36:24 AM
Hi There,
is it possible you could help me to make this Spam control run on my host please ?