Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: magik_cypress on May 29, 2009, 08:41:46 AM

Title: SpamAssassin MySQL Plugin
Post by: magik_cypress on May 29, 2009, 08:41:46 AM
Hello,

program/localization/fr_FR/labels.inc

Code: [Select]
$labels['sauserprefs']  = 'Spam';
$labels['sauserprefssettings']  = 'Configuration des Spams';
$labels['spamgeneralsettings']  = 'Configuration principale';
$labels['spamthres']  = 'Seuil du score';
$labels['spamsubject']  = 'Tag sur le sujet';
$labels['spamsubjectblank']  = '(Laisser vide le champ)';
$labels['spamlang']  = 'Langue du message';
$labels['enabled']  = 'Activer';
$labels['disabled']  = 'Desactiver';
$labels['headers'] = "Entete du message";
$labels['foldheaders'] = "Autoriser plusieurs lignes dans les en-tetes";
$labels['spamlevelstars'] = "Utiliser 'Niveau de Spam' dans les en-tetes";
$labels['spamlevelchar'] = "Caractere du niveau de spam";
$labels['spamtests'] = "Service de spam externe";
$labels['userazor1'] = "Utiliser Razor v1";
$labels['userazor2'] = "Utiliser Razor v2";
$labels['usepyzor'] = "Utiliser Pyzor";
$labels['usebayes'] = "Utiliser naive Bayesian style classifier";
$labels['usedcc'] = "Utiliser DCC";
$labels['skiprblchecks'] = "Utiliser Realtime Blackhole List";
$labels['spamreportsettings']  = 'Rapport de configuration';
$labels['spamreport0']  = 'Inclure le rapport dans l\'en-tete du message original';
$labels['spamreport1']  = 'Inclure MIME Attachment dans l\'en-tete du message original';
$labels['spamreport2']  = 'Inclure le texte original dans le rapport';
$labels['spamaddressrules']  = 'Regels des adresses';
$labels['whitelist_from']  = 'Accepter les messages de';
$labels['blacklist_from']  = 'Rejeter les messages de';
$labels['whitelist_to']  = 'Accepter les messages envoye a';
$labels['addrule']  = 'Ajouter une regle';
$labels['rule']  = 'Regle';

program/localization/fr_FR/messages.inc

Code: [Select]
$messages['sauserprefchanged'] = 'Succes : modification de la configuration des spams';
$messages['sauserpreffailed'] = 'Erreur: aucun changement de la configuration des spams';
$messages['spamthresexp'] = 'Tout au-dessus du seuil est marque comme spam. L\'augmentation de ce seuil va augmenter la quantite de spam manquer, mais reduire le risque de faux positifs.';
$messages['spamlangexp'] = 'Selectionnez toutes les langues, tous les messages reçus qui sont ecrits dans des langues sélectionnees seront traites comme spam possible.';
$messages['headersexp'] = "Les en-tetes des messages produit par SpamAssassin fournissent des informations sur les resultats. Utilisez les options ci-dessous pour configurer ces en-tetes.";
$messages['spamtestssexp'] = "Certains controles de l\'utilisation des services bases sur Internet peuvent aider a identifier le spam. Selectionnez ceux que vous souhaitez utiliser:";
$messages['spamreport']  = 'Quand un message est identifie comme spam, un rapport de tous les essais et les évaluations attribuées est cree ...';
$messages['autowhitelist'] = 'Les adresses e-mail dans votre carnet d\'adresses sont automatiquement ajoutees a la liste \'accepter le courrier provenant de\'.';
$messages['whitelistexp'] = 'Un asterisque (*) peut être utilise comme un joker pour une plus grande flexibilite. Par exemple: *@example.com or *@*.example.com.';
$messages['spamaddressexists'] = 'Une regle qui existe deja pour cette adresse';
$messages['spamenteraddress'] = 'S\'il vous plait entrer une adresse a ajouter';
$messages['spamaddresserror'] = 'Erreur: L\'adresse semble invalide';
$messages['spamaddressdelete'] = 'Etes vous sur de vouloir supprimer cette regle?';
$messages['noaddressrules'] = 'Pas de regle pour cette d\'adresse trouvee.';

++
Cyp
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on May 30, 2009, 05:03:47 AM
Great thanks, I'll add it in the next version.

UPDATE: The new version is now available on the website.
Title: Error loading Template sauserprefs
Post by: mike113 on June 04, 2009, 11:26:36 PM
I'm getting this error when clicking the spam tab I haven't been able to figure out what is failing.
Code: [Select]

[04-Jun-2009 23:11:33 -0400] PHP Error: Error loading template for sauserprefs.sauserprefs in /usr/share/rc.beta.05.09/program/include/rcube_template.php on line 342 (GET /beta3/?_task=settings&_action=plugin.sauserprefs)


any ideas where the error is?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on June 05, 2009, 03:02:17 AM
I think you downloaded the latest developemnt version of the plugin, but you are actually using RC version 0.3b, not trunk. Is that correct? Please download the 0.3b version of the plugin and the error will vanish.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on August 16, 2008, 11:44:16 AM
Hi,

I have created a small plugin to integrate management of SpamAssassin preferences into RC. The preferences must be stored in a MySQL database (it will probably work with any database supported by RC but MySQL is what I use).

At the moment there are 2 versions of the patch, one for 0.3b and one for SVN trunk. If you are using Roundcube version 0.3b the development version of this plugin will not work for you, you must use the 0.3b version.

For more information or to download the plugin please visit RoundCube Patches & Plugins (http://www.tehinterweb.co.uk/roundcube/#pisauserprefs)
Title: Using this plugin with other skins
Post by: patricktech on June 09, 2009, 02:49:13 PM
i have another skin installed, mvision, and I cannot get the new tab to show up with this plugin?

Also, I had a previous user setting in the database, and this plugin did not detech or pickup my previous threshold levels?

Thanks, Patrick
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on June 10, 2009, 02:54:03 AM
I haven't tried the mvision skin in a while so I cant tell exactly what the problem is but from what I remember I think that it is missing the JS call required to let plugins add tabs, quite a few things have changed in the skin to allow plugins to do their thing. Until the offical guide to making skins comes out I can only work with the default skin.

Its odd that your previous settings were not picked up but without a little more digging I cannot say whats wrong. There is a function in sauserprefs.php called _load_user_prefs this loads loads the settings from the database. First step is to run that query manaully and check what is returned.

One more thing: Is your current threshold level an interger? If not you will need to change the increment setting in your config so that the number is available in the threshold dropdown list. eg. If you have a threshold of 3.5 you will need an increment of 0.5
Title: SpamAssassin MySQL Plugin
Post by: patricktech on June 10, 2009, 12:14:36 PM
I overlooked the fact that your plugin is configured to set the user prefs threshold as "required_hits" instead of the new syntax being "required_score" in 3.2.x.

Also, an issue that I see is, if a user logs in to roundcube and they click on personal settings and go to the spam tab, it will show a threshold and a everything as already being setup. Even though they do not have any settings in the userprefs table at all. It would be nice to see an enable/disable button or something to that affect. So a user that doesnt have spam filtering turned on, would go to the page and all the defaults would be filled in, they would just have to click an enable button which would put all the necessary settings in the table or if they click disable, it would remove all the settings etc.

Thanks for your time and quick response. I hope you find my suggestions useful.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on June 11, 2009, 02:54:23 AM
Ah thanks, I did not know `required_hits` had changed, I will have to modify the plugin to read both and always write out `required_score` since it is the more correct one.

For the enabled/disable thing... do you not have any global settings in your database? The plugin reads both the user settings and the global ones and then combines them to get the currently active settings. I have never looked into what happens if you have no global or user settings since I never imaginged that happening. May be it is something I should investigate.

UPDATE: deprecated pref `required_hits` removed from the code in the repo, the plugin will still work with it but will update it to `required_score`
Title: SpamAssassin MySQL Plugin
Post by: patricktech on June 15, 2009, 11:19:44 AM
Sorry for the delay, I have been out of town for a few days....

I do have the $GLOBAL variables defined. Those are for the entire mail server and the 'required_score' is set to a very high number, almost essentially just allowing spam; really only catching spam that has ridiculous scores. I would think the ability for a end-user to be able to log in to roundcube and enable spam filtering (i.e. puts the required score and other settings in the database for that account) would be a good thing. Since the threshold the end user can set is 1-10, this setting will obviously be more within the realm of catching spam and filtering it out.

If at a later date, they decided they do not want spam filtering (for whatever reason), it would be nice if they could log in to roundcube again and disable spam filtering (i.e. removes any entires in the userprefs table for their account).
Title: 11
Post by: qrst570 on June 16, 2009, 06:21:41 PM
±äƵµ÷ËÙ¼¼ÊõÁ¬Ðøµ÷½Ú --- ¿Õѹ»úÓÍ 's BLOG (http://www.fyez.cn/html/blog/297/1822.htm)¿Õѹ»úÈȱÃ×ÛºÏÓŵã --- ¿Õѹ»úÓÍ 's BLOG (http://www.cttlw.com/html/blog/338/1323.htm)¿ÕÆøѹËõ»ú±äƵµ÷ËÙ¿ØÖÆ·½Ê½µÄÉè¼Æ --- ¿Õѹ»úÓÍ 's BLOG (http://www.cttlw.com/html/blog/338/1324.htm)±äƵµ÷ËÙ¿ØÖƵĽÚÄÜЧ¹û --- ¿Õѹ»úÓÍ 's BLOG (http://www.lkren.com/html/blog/76/762.htm)¿Õѹ»úÓͼÓÇâ´¦Àí --- ¿Õѹ»úÓÍ 's BLOG (http://www.lkren.com/html/blog/76/763.htm)
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on June 17, 2009, 01:44:12 PM
I have never really considered a situation where some one would effectivly want to turn off all spam settings. I guess the problem is that removing prefs from the SQL table does not actually turn off spam filtering, it just sets it back to default. So the effect of doing that would be different on different systems. Puting a straing "on or off" on the interface would be misleading in most setups I think.
Title: SpamAssassin MySQL Plugin
Post by: patricktech on June 21, 2009, 08:43:18 PM
Understandable. Something I can look to mod in myself I guess. :)

The one issue I see is a user that doesnt have user prefs, when the go to the spam tab, the plugin shows settings, atleast it could be misleading to an end user that doesnt know what to look for, when in fact no spam settings exist in the userprefs table for them.

I guess depending on its application and how its presented to the users could determine a lot. Maybe I will look at adding an enable and disable button that can be turned on or off in the config file??? i.e. choose to have it in use or not.

Thanks, Patrick
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on June 25, 2009, 03:12:02 AM
I have added some new options to the code (currently in the repo): In the score drop down a new option at the top called "Default Score". Also if some one has a score which is not in the drop down then a new value is added called "Other ([score])" so that a score is never lost. Then at the bottom of the screen, next to the save button there is a new "Restore Default Settings" button which does excatly what it says on the tin. It has the effect of deleteing all the user's settings since anything which matches the default is not saved to the DB.
Title: SpamAssassin MySQL Plugin
Post by: jnorth on July 10, 2009, 02:29:28 PM
How does one tell SpamAssassin to use these settings?  I'll write a step-by-step if someone can point me in the right direction to get mine working.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on July 11, 2009, 08:25:52 AM
The offical instructions are here UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL) If you do a search from Spamassassin and MySQL you should find some guides.
Title: SpamAssassin MySQL Plugin
Post by: techdude on July 14, 2009, 10:41:46 AM
What modifications do I need to make to this to get it to work with another Template?  Such as the MobileMe Template?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on July 15, 2009, 03:39:26 PM
It depends what version of RC (and the plugin) you have. If its 0.3b then your options are limited, there is a sauserprefs.css file in the plugin folder and you can tweak that to try and match your skin, but that’s about it – unless you want to edit the code in sauserprefs.php

If you are using SVN trunk then there is a skins folder inside the plugin dir, and default inside that – make a copy of this folder and give it the same name as your skin and you can tweak the template files, css and images.
Title: SpamAssassin MySQL Plugin
Post by: spiderling on July 24, 2009, 01:06:02 AM
I am a newbie to managing a dedicated server and to RC, and I'm having a little trouble understanding the configuration settings for this plugin.

I'm using RC 0.3beta and uploaded the sauserprefs folder into the plugins folder. Added the sausesrprefs to the $rcmail_config['plugins'] array.

I have RC's 'users' table which has a 'username' field and a 'preferences' field, but it does not have a 'value' field. :confused:
Am I to create a separate table for this?

Thanks in advance
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on July 24, 2009, 03:27:44 AM
hi, i think maybe you are looking in the wrong place. you should be putting in the info from your SpamAssassin user prefs table, not the RC users table. UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL) should get you started on setting up SpamAssassin and MySQL.
Title: SpamAssassin MySQL Plugin
Post by: spiderling on July 28, 2009, 06:41:56 PM
Thanks for the info. I'll give it try.
Title: 0.3-stable released
Post by: patricktech on September 15, 2009, 11:42:41 AM
Do you have the latest stable release of your plugin to work with 0.3-stable release of RC?

Thanks...
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 16, 2009, 03:24:32 AM
the copy on the website will work with 0.3s
Title: SpamAssassin MySQL Plugin
Post by: voltron81 on September 17, 2009, 06:03:58 AM
Have somebody tried to install this plugin with ISPConfig 3?
The difference is that Spamassassin is controlled by ISPConfig, so I think the database is different...
What do you think?

Thanks
Michele
Title: SpamAssassin MySQL Plugin
Post by: richermartyn on September 21, 2009, 08:04:42 AM
Hi...
 I have some information regarding MYSQL...
To begin using the Stats Plugin you will need to create a table for the plugin to write to
CREATE TABLE stats (
  day date NOT NULL default'',
  username varchar(100) NOT NULL default '',
  domain varchar(100) default '',
  spam int(20) default '0',
  ham int(20) default '0',
  PRIMARY KEY (day,username,domain)
) TYPE=MyISAM
You will need to replace the following variables with settings for your configuration  You will need to replace the following variables with settings for your configuration  
# Configure SQL for statistical storage
use_stats                       1
user_stats_dsn                  DBI:mysql:spamassassin_beta:sql_hostname
user_stats_sql_username         sql_username
user_stats_sql_password         sql_password
user_stats_sql_table            sql_table
Title: SpamAssassin MySQL Plugin
Post by: utiltiy on October 03, 2009, 07:12:26 AM
Hello,

can me anybody help with the MySQL Settings?

I insert my Database String, but it's save from Settings Possible.

Must i create a new Databse for this or what must i do for it?

Thanks
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on October 04, 2009, 06:55:22 AM
the plugin interacts with the mysql database which stores your SpamAssassin settings. If you dont have one of those then either this plugin isnt for you or you need to configure your SpamAssassin to use a mysql database (there are lots of guides on how to do that on the internet just do some searching)
Title: No fields in the sauserprefs form
Post by: henlon on October 11, 2009, 01:43:33 PM
I'm running on RC0.3s and have installed the latest plugins from the repository.
When I go to the 'SPAM' label and click on the settings in the left menu i only receive the button 'SAVE' in the forms.
Is there anything more I have to do?
I have created the mySQL db with the fields 'username' 'preference' and 'value'
There are no errors in the log file.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on October 12, 2009, 03:09:00 AM
Try using the zip/tag.gz version on the website rather than the one from the repo and see if you have the same issue. Also could you post your config file? You should see a "restore default values" button as well as a save one. Are the fields missing for all sections or just one?
Title: SpamAssassin MySQL Plugin
Post by: henlon on October 13, 2009, 01:34:13 PM
Yes, exept from the first 'General settings' wich is the same as the fields under User settings in the first window.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on October 14, 2009, 02:44:51 AM
well thats quite clever, did you have an old version of this plugin installed? make sure you have cleared your cache, sounds like you might be using an old version of the JS file.
Title: SpamAssassin MySQL Plugin
Post by: henlon on October 18, 2009, 04:05:17 AM
Hi again and thanks for your interest in my current issue.

I have installed a brand new installation of RC 0.3s
Copied the latest version og sauserpref from the repository

I got the same empty forms with just the botton 'SAVE'

I looked in the RC log but there are no errors

Here is the first part of my config.inc.php file.
I have changed the password and the server string

As a clue, the function with adding contacts from the addressbook make posts in the database

$sauserprefs_config = array();

// spamassassin database settings
$sauserprefs_config['db_dsnw'] = 'mysql://root:mypassword@mysqlserver/sauserprefs';

// PEAR database DSN for read only operations (if empty write database will be used)
// useful for database replication
$sauserprefs_config['db_dsnr'] = '';

// use persistent db-connections
// beware this will not "always" work as expected
// see: PHP: Persistent Database Connections - Manual (http://www.php.net/manual/en/features.persistent-connections.php)
$sauserprefs_config['db_persistent'] = FALSE;

// table that holds user prefs
$sauserprefs_config['sql_table_name'] = "userpref";

// name of the username field in the user prefs table
$sauserprefs_config['sql_username_field'] = "username";

// name of the preference field in the user prefs table, holds the name of the preference
$sauserprefs_config['sql_preference_field'] = "preference";

// name of the value field in the user prefs table, holds the value of the preference
$sauserprefs_config['sql_value_field'] = "value";
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on October 18, 2009, 04:17:57 AM
have you tried the things i said before ... using the version actually designed for 0.3s from the website and clearing your cache?

if that made no difference then could you pm me some login details so I could see this for myself please?

one more thing, which browser are you using?
Title: SpamAssassin MySQL Plugin
Post by: henlon on October 18, 2009, 07:37:10 AM
Jippiee !!!

It works.

I must have an old repository version of userprefs.
Title: SpamAssassin MySQL Plugin
Post by: neonknight on December 02, 2009, 02:58:44 AM
Hello everyone, my first posting here :)

How can I disable the language selector in the general setting tab? What needs to be set in $rcmail_config['sauserprefs_dont_override'] ?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 02, 2009, 03:14:48 AM
hi, try this:

$rcmail_config['sauserprefs_dont_override'] = array('ok_languages', 'ok_locales');
Title: New french translation
Post by: mikey on December 08, 2009, 10:04:14 AM
Hello,

Find attached to this message a new french translation file.
French accents are HTML encoded when not in alert boxes.

Many thanx Rosali for your comment. Hope it is OK now.

Regards,
Mike.
Title: SpamAssassin MySQL Plugin
Post by: rosali on December 08, 2009, 10:25:45 AM
I think JohnDoh won't be happy about that as the forum code will replace special chars by entities. Please attach your translation as a file utf-8 encoded without BOM.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 09, 2009, 03:08:50 AM
Thanks Mike. But why did you replace the accented characters with HTML entities? The proper characters should always be used I think.
Title: SpamAssassin MySQL Plugin
Post by: neonknight on December 18, 2009, 03:39:10 AM
JohnDoh, thank you for your reply, this works perfectly.

I have corrected the German translatations (de_CH and de_DE) as they were full of typos. I also changed the form from the less formal "Du" to the formal "Sie", which might be more appropriate if you have paying customers ;)
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 19, 2009, 09:56:54 AM
neonknight and mikey thanks for the translations i have added them to the repo
Title: SpamAssassin MySQL Plugin
Post by: theodm on December 25, 2009, 09:43:23 AM
The plugin works nicely, thanks for that.

I'm having error messages at the top of the page and below every section saying: SERVICE CURRENTLY NOT AVAILABLE! Error No. [500]

This happens only with this plugin, other option pages work fine. Where does this come from? I've added a screenshot as attachment that shows it.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 27, 2009, 05:03:07 AM
please check [rc root]/logs/errors and post the error
Title: SpamAssassin MySQL Plugin
Post by: theodm on January 16, 2010, 08:01:10 AM
Sorry for the late reply, with all the holidays I totally forgot about having this issue ;)

I've checked the error log, but there are no errors when I go to the plugin page. When I put a wrong password when logging in it shows up there, so the error log is properly writable.

I've tried removing things from the both the templates and the php one by one, but haven't really been able to trace it back to anything. I can make the top one disappear by renaming the 'prefsscreen' css tag in either settings.css or sauserprefs.html. That obviously breaks the page, but it's around there apparently. Also I can magically make the top one disappear by putting an echo in the index.php before it outputs the actual page. So basically by putting a text before the actual html. Not all browsers like that though :)
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on January 16, 2010, 09:21:53 AM
try turning up the debug_level in your main rc config file may be you can get some more info that way. other than that I think the only way is to go though the sauserprefs.php bit by bit and see which line causes the error.
Title: SpamAssassin MySQL Plugin
Post by: theodm on January 16, 2010, 09:39:19 PM
Increasing the debug level gave useful information. It shows those messages because it tries to make queries on the session table, but that fails because the current database is the one used by the plugin instead (where my sa prefs are stored).

In the sauserprefs.php a new rcube_mdb2 instance is created, but right after the db_connect call in the _db_connect function, the database for the main connection is also changed to the same as specified for the plugin. Printed the current database right before and right after to verify.

If I change the db_persistent setting in the main config to true it doesn't give the error and works fine. I don't really need/want persistent connections though, so if you have some suggestions on a workaround it would be great :)
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on January 17, 2010, 04:21:08 AM
try adding new_link=true to your sauserprefs DSN eg: mysql://user:passwd@host/database?new_link=true
Title: SpamAssassin MySQL Plugin
Post by: theodm on January 17, 2010, 07:08:22 AM
That fixes it, thanks for your help! :)
Title: Swedish Translation
Post by: Reino on February 23, 2010, 05:09:30 AM
I have created a Swedish translation of the SpamAssassin Prefs plugin.

Code: [Select]

<?php
/* Author: Reino Wallin */
/* http://www.oribium.se/  */

$labels = array();
$labels['sauserprefs']  = 'Skräppost';
$labels['sauserprefssettings']  = 'Inställningar för skräppost';
$labels['spamgeneralsettings']  = 'Allmänna inställningar';
$labels['spamthres']  = 'Tröskelvärde';
$labels['spamsubject']  = 'Rubrikmärkning';
$labels['spamsubjectblank']  = '(lämna tom om du inte vill lägga till någon text till rubriken)';
$labels['spamlang']  = 'Brevets språk';
$labels['enabled']  = 'Aktiverad';
$labels['disabled']  = 'Ej aktiverad';
$labels['headers'] = 'Brevhuvud';
$labels['foldheaders'] = 'Tillåt flera rader i brevhuvudet';
$labels['spamlevelstars'] = 'Använd \'Spam Level\' i brevhuvudet';
$labels['spamlevelchar'] = 'Tecken för \'Spam Level\'';
$labels['spamtests'] = 'Internetbaserade tester av skräppost';
$labels['userazor1'] = 'Använd Razor v1';
$labels['userazor2'] = 'Använd Razor v2';
$labels['usepyzor'] = 'Använd Pyzor';
$labels['usebayes'] = 'Använd bayesklassificering';
$labels['usedcc'] = 'Använd DCC';
$labels['skiprblchecks'] = 'Använd svartlistor i realtid';
$labels['spamreportsettings']  = 'Rapportinställningar';
$labels['spamreport0']  = 'Lägg till rapporten till originalbrevets brevhuvud';
$labels['spamreport1']  = 'Sänd rapporten med originalbrevet som en MIME-bilaga';
$labels['spamreport2']  = 'Sänd rapporten med originalbrevet som en text-bilaga';
$labels['spamaddressrules']  = 'Adressregler';
$labels['whitelist_from']  = 'Acceptera brev från';
$labels['blacklist_from']  = 'Avvisa brev från';
$labels['whitelist_to']  = 'Acceptera brev till';
$labels['addrule']  = 'Lägg till';
$labels['rule']  = 'Regel';
$labels['importfromaddressbook'] = 'Importera adresser från adressboken';
$labels['deleteall'] = 'Radera alla';
$labels['autoscore'] = 'Auto';
$labels['defaultscore'] = 'Använd grundinställningar';
$labels['otherscore'] = 'Annan (%s)';
$labels['usedefault'] = 'Återställ grundinställningar';
$labels['langoptions'] = 'Språkinställningar';
$labels['bayes'] = 'Bayesinställningar';
$labels['purgingbayes'] = 'Raderar bayesdata...';
$labels['purgebayes'] = 'Radera personliga bayesdata';
$labels['bayesautolearn'] = 'Använd bayesinlärning';
$labels['bayesautooptions'] = 'Inställningar för inlärning';
$labels['bayesnonspam'] = 'Tröskelvärde för vanliga brev';
$labels['bayesspam'] = 'Tröskelvärde för skräppost';
$labels['bayesrules'] = 'Använd bayesregler';
$labels['help']  = 'Hjälp';

$messages = array();
$messages['sauserprefchanged'] = 'Dina inställningar för skräppost har sparats';
$messages['sauserpreffailed'] = 'Fel: Det går inte att spara dina inställningar för skräppost';
$messages['spamthresexp'] = 'Alla brev som vid granskningen av SpamAssassin får ett värde som överstiger tröskelvärdet för skräppost blir märkta som skräppost. Ökar man tröskelvärdet innebär det att viss skräppost inte blir märkt som skräppost, men man reducerar också risken att vanliga brev blir märkta som skräppost.';
$messages['spamlangexp'] = 'Välj de språk du förväntar dig att mottagna brev är skrivna på. Brev som är skrivna på andra språk än de du inte valt kommer att bli betrakade som möjlig skräppost';
$messages['headersexp'] = 'SpamAssassin lägger till information i brevhuvudet på brev som granskats av SpamAssassin. Informationen beskriver resultatet av granskningen. Använd inställningarna nedan för att konfigurera dessa brevhuvuden.';
$messages['spamtestssexp'] = 'Vissa kontroller som SpamAssassin utför för att karaktärisera ett brev, baseras på tjänster på Internet. Välj de tjänster du önskar använda dig av:';
$messages['spamreport']  = 'När ett brev karaktäriseras som skräppost skapas en rapport med alla resulten från granskningen som SpamAssassin gör...';
$messages['autowhitelist'] = 'Lägg per automatik till adresserna i din adressbok till \'Acceptera brev från\' listan.';
$messages['whitelistexp'] = 'Du kan använda en asterisk (*) för att skapa ett mer flexibelt regelverk, exempelvis: *@example.com eller *@*.example.com.';
$messages['spamaddressexists'] = 'En regel finns redan för denna adressen';
$messages['spamenteraddress'] = 'Ange en adress att lägga till';
$messages['spamaddresserror'] = 'Fel: Ogiltlig adress';
$messages['spamaddressdelete'] = 'Är du säker på att du vill radera denna adressregel?';
$messages['spamaddressdeleteall'] = 'Är du säker på att du vill radera alla adressregler?';
$messages['noaddressrules'] = 'Det existerar inga adressregler.';
$messages['importingaddresses'] = 'Importerar adresser...';
$messages['usedefaultconfirm'] = 'Är du säker på att du vill återställa grundinställninganra? Om så sker raderar du dina nuvarande inställningar, som exempelvis dina adressregler.';
$messages['purgebayesexp'] = 'Radera personliga bayesdata som samlats in från dina brev';
$messages['bayesnonspamexp'] = 'Brev som erhåller ett skräppostvärde under detta tröskelvärde kommer att användas för att förbättra skräppostsystemets förmåga att identifiera brev som inte är skräppost.';
$messages['bayesspamexp'] = 'Brev som erhåller ett skräppostvärde över detta tröskelvärde kommer att användas för att förbättra skräppostsystemets förmåga att identifiera skräppost.';
$messages['bayesautohelp'] = 'Om bayesinlärning är aktiverat kommer skräppostsystemet att vid granskningen av brev, som med stor sannolikhet är spräppost eller med stor sannolikhet är vanliga brev, att automatiskt uppdatera sin databas och förbättra sin förmåga att detektera skräppost. Brev som är mer svårbedömda kommer inte att användas vid inlärningen';
$messages['bayeshelp'] = 'Vid klassificering av brev baserat på Bayes försöker man identifiera spräppost med hjälp av ord, eller korta bokstavssekvenser, som är vanligt förekommande i vanliga brev respektive skräppost.';
$messages['rblhelp'] = 'Serveradresser som finns i länkar infogade i brev kommer att kontrolleras mot ett flertal \'svartlistor\' och listor över välkända källor för skräppost.';
$messages['dcchelp'] = 'DCC (Distributed Checksum Clearinghouse) är en internettjänst baserad på ett antal sevrar som dagligen samlar in och beräknar checksumman för miljontals brev. Checksumman för inkommande brev jämförs med data i databasen och desto större likhet som råder desto större sannolikhet är det att brevet är att betrakta som skräppost.';
$messages['pyzhelp'] = 'Pyzor är en distribuerad internettjänst för att detektera skräppost. Den baseras på att man beräknar en checksumma av brevet som kontrolleras mot nätverksbaserade databaser för att se om andra har klassificerat brevtexten som skräppost.';
$messages['raz2help'] = 'Vipul\'s Razor är en distribuerad internettjänst för att detektera skräppost. Den baseras på att man beräknar en checksumma av brevet som kontrolleras mot nätverksbaserade databaser för att se om andra har klassificerat brevtexten som skräppost. Razor är effektivt även när det gäller så kallade muterade brevtexter.';
$messages['levelhelp'] = 'Brevhuvudet benämnt \'Spam Level\', som visar hur brevet klassificerats, kan läggas till breven och underlätta för vidare behandling.';
$messages['foldhelp'] = 'Skall de brevhuvud som SpamAssassin lägger till brevet struktureras som en lång rad eller ett flertal separata brevhuvud.';
$messages['bayesruleshlp'] = 'Innan bayesklassificering kan göras effektivt måste en inlärning av vad som är spräppost respektive vanliga brev ske. Om man inte väljer att använda bayesklassificering kommer skräppostsystemet att öka sin förmåga att detektera skräppost genom både manuellt och automatiskt inlärning, men klassificering kommer inte att ske.';
$messages['purgebayesconfirm'] = 'Är du säker på att du vill radera alla dina bayesdata?';

?>

Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on February 23, 2010, 12:54:48 PM
great thanks.
Title: Amavisd-New
Post by: roe1234 on February 25, 2010, 12:51:51 PM
Is there any ability to get this plugin working with Amavisd-New?
Title: SpamAssassin MySQL Plugin
Post by: Nosferatuvn on March 03, 2010, 03:10:14 AM
hi,

i have installed the spamassassin but it dont work realy Oo

if i change something online i get "Spam settings cannot changed"
but why ???

i set my db datas on the config.

but i dont found the mysql things to add it on my db?

eg.: i dont have SELECT id FROM bayes_vars WHERE username = %u

bayesvars on my db ?

pls can someone help me
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on March 06, 2010, 04:07:53 AM
so you have the spamassasin database all setup and the plugin is correctly configured to connect to that database, not the rc one, is that right?

the sauserprefs_bayes_delete_query is optional, just leave it blank if you are not using bayesian data or it is not being stored in the db.
Title: free classified ads websites
Post by: ross02 on March 06, 2010, 04:25:27 AM
The leading resource of allfree classified ads websites (http://yardit.com)
Title: SpamAssassin MySQL Plugin
Post by: Crupuk on March 16, 2010, 07:45:16 AM
Quote from: roe1234;25841
Is there any ability to get this plugin working with Amavisd-New?


+1

I agree with this, i have amavisd-new user pref..
Title: SpamAssassin MySQL Plugin
Post by: Volnhar on March 17, 2010, 11:17:28 PM
Quote from: Crupuk;26166
+1

I agree with this, i have amavisd-new user pref..


Wont the SpamAssassin part work anyway?

I don't have access from my server from work, but will have a look tonight.

If not then having this work with amavisd-new would be great. :)
Title: SpamAssassin MySQL Plugin
Post by: Crupuk on March 18, 2010, 02:05:29 AM
Quote from: Volnhar;26192
Wont the SpamAssassin part work anyway?


I don't think so, because spamassassin is called from amavisd-new and juste retourne a spam score.

Amavisd-new use is own prefs.

Thanks for you help
Title: SpamAssassin MySQL Plugin
Post by: fabiovin70 on March 19, 2010, 11:12:46 AM
Hello,
my first post here. I hope this is the right place to start.
I'm Italian and quite a newbie with linux and mysql.
I have just set up an ubuntu 9.10 mail server with spamassassin, amavisd-new, ISPConfig and RoundCube for my organization.
It is working quite well except that we are receiving too much spam.
I'm trying to install the sauserprefs plugins but I have some doubts.
In mysql I have the following databases:
    * dbispconfig (47 tables)
    * information_schema (28 tables)
    * mysql (23 tables)
    * roundcube (6 tables)
In the config.inc.php file of the sauserprefs plugin I have set the roundcube database but I'm not sure that it is the correct database.
Then with PHPmyadmin I have created a table called userprefs with 3 fields (username, preference and value) that I have set to text.
In this way, in RoundCube, I can access the plugin and even save the preferences but I'm not sure it will work and especially I'm not sure it will connect to spamassassin (how spamassassin can take the information from this database?).
Any help and explanation will be appreciated.
I've tried to research this on google but I still have many doubts.
Thank you.
Title: SpamAssassin MySQL Plugin
Post by: fritz001 on March 19, 2010, 01:09:13 PM
CREATE TABLE userpref (
  username varchar(100) NOT NULL default '',
  preference varchar(50) NOT NULL default '',
  value varchar(100) NOT NULL default '',
  prefid int(11) NOT NULL auto_increment,
  PRIMARY KEY  (prefid),
  KEY username (username)
);
Title: SpamAssassin MySQL Plugin
Post by: fabiovin70 on March 19, 2010, 02:22:22 PM
OK, it seems it's working. I'm able to save the preferences.
I did the tables with the suggested commands in the roundcube database, is it right?
Will spamassassin use the same database?
Thanks.

Addendum:

Maybe I did a mistake in mysql by making two separate databases for ISPConfig and roundcube?
Even if I'm able to save the preferences, it seems that they have no effect.
The only effect that I can see is when I change the policies in the ISPConfig (i.e. permissive, normal and their spam levels), but from this plugin I can't notice any effect.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on March 23, 2010, 04:03:43 PM
this isnt really the best place for help setting up spamassassin or ispconfig, have you gone though this UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL?) if you're still stuck i suggest finding some spamassassin support or may be ispconfig. hope you get it working.
Title: sauserprefs_bayes_delete_query
Post by: snyder on May 09, 2010, 07:33:25 AM
Hello,

Does the deletion of user bayesian data work for anybody?
I am getting "server error" message every time I try to use this functionality.

It seems like the problem is with the following piece of code in purge_bayes() function:
if ($rcmail->config->get('sauserprefs_bayes_delete_query', true)) {
           $this->api->output->command('display_message', $this->gettext('servererror'), 'error');
           return;
                }

($rcmail->config->get('sauserprefs_bayes_delete_query', true)) always returns TRUE and further lines of the function are never executed.

After commenting out the above part everything works as expected.
(However, I suppose, this code should rather be fixed than removed ;) )
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on May 09, 2010, 07:52:37 AM
its been fixed already in the repo, Commit 17dcbfb9c4d902eb8a8a28c4817cf7fac2988e9e to JohnDoh's RoundCube-Plugin-SpamAssassin-User-Prefs-SQL - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-SpamAssassin-User-Prefs-SQL/commit/17dcbfb9c4d902eb8a8a28c4817cf7fac2988e9e)
Title: SpamAssassin MySQL Plugin
Post by: snyder on May 09, 2010, 07:58:53 AM
great, thanks! :)
(I should have check GitHub first, sorry...)
Title: SpamAssassin MySQL Plugin
Post by: Crupuk on May 14, 2010, 09:11:31 AM
Quote from: Volnhar;26192
Wont the SpamAssassin part work anyway?

I don't have access from my server from work, but will have a look tonight.

If not then having this work with amavisd-new would be great. :)


Nothing about this ?

:-D
Title: a little issue
Post by: Dane on August 15, 2010, 02:54:05 PM
a little issue in sauserprefs.php

change this:

if (!isset($no_override['skip_rbl_checks'])) {
               if ($_POST['_spamskiprblchecks'] == "1")
                  $new_prefs['skip_rbl_checks'] = "";
               else
                  $new_prefs['skip_rbl_checks'] = "1";

for:

if (!isset($no_override['skip_rbl_checks'])) {
               if ($_POST['_spamskiprblchecks'] == "1")
                  $new_prefs['skip_rbl_checks'] = "0";
               else
                  $new_prefs['skip_rbl_checks'] = "1";

regards
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on August 16, 2010, 03:27:23 AM
thanks, this has been fixed in the repo version.
Title: SpamAssassin MySQL Plugin
Post by: dvdsmith on August 25, 2010, 05:19:38 PM
Quote from: fritz001;26219
CREATE TABLE userpref (
  username varchar(100) NOT NULL default '',
  preference varchar(50) NOT NULL default '',
  value varchar(100) NOT NULL default '',
  prefid int(11) NOT NULL auto_increment,
  PRIMARY KEY  (prefid),
  KEY username (username)
);


I'm pretty new mysql, so forgive me if I missed the obvious.  

So far as I can tell this was the only mention I could find specifying the details of the field required for this plugin.  The readme only tells you to create the table and fields, not field length or anything else.  I would suggest the above should be in the readme or at least the essential details.

Dave
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on August 26, 2010, 03:29:44 AM
TBH I kind of assumed that any one who used the plugin would already have their SA setup. There are lots of guides out there for how to it with different databases, including the SA documentation itself.

But I understand what you are saying about it being hard to know where to start, may be I will add a link to the SA documentation in the readme.
Title: Changed Page
Post by: LMSSML on September 01, 2010, 07:59:22 AM
Hi there,

When I installed the plugin

When i used on roundcube what happends it's the following it looses the separator and opens a total page of spam filter making roundcube icon above some options.

Is it possible to open has settings and the left options opende and see the tabs above ?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 01, 2010, 11:22:53 AM
are you using the default skin and correct version of the plugin for your version of rc?
Title: SpamAssassin MySQL Plugin
Post by: LMSSML on September 01, 2010, 12:23:23 PM
Hi there,

I'.m using rc 0.4

and the version of spam is sauserprefs.

Version of spamassasin 3.2.3
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 01, 2010, 04:11:51 PM
hmm sauserprefs version 1.4 right? its at the top of [rc root]/plugins/sauserprefs/sauserprefs.php. and its the default RC skin not running inside iframes or anthing like that right? it should look like this http://www.tehinterweb.co.uk/roundcube/plugins/sauserprefs.jpg
Title: No it goes strange
Post by: LMSSML on September 04, 2010, 07:07:50 AM
Hi John


Thanks for the awnser:


but it goes a little different from what you have posted.

What you have posted that's the way I like to be but it goes like my jpeg.

What I did do wrong ?


Any help ?
Title: SpamAssassin MySQL Plugin
Post by: SKaero on September 04, 2010, 07:41:55 AM
What browser is that happening in and have you tried clearing your browser cache?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 04, 2010, 08:15:27 AM
You are using the wrong version of the plugin for your version of RC.
Title: Browser
Post by: LMSSML on September 04, 2010, 09:20:21 AM
Hi there,


It's happenning with firefox and Internet explorer and safari.

By the way the version of round cube is 0.4

and the version of spam plugin it was downloaded from GitHub.


Any advice ?

Thanks
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 04, 2010, 09:56:03 AM
Well I loaded the 0.4b version of the plugin into the 0.4s version of RC and I got a screen that looks just like the one you posted so I think may be somethingn somewhere has got in a twist. I suggest you delete the sauserprefs folder from your installation, and then goto the repo and make sure you download the copy from the correct branch, or use the zip file for 0.4s on the website. DO NOT use the master branch as it says on the website and in the CHANGELOG thats for the SVN-Trunk version of RC. Finally make sure you have cleared your browsers cache.
Title: works with version 0.3
Post by: LMSSML on September 04, 2010, 02:00:11 PM
HI there,


It disappeard the problem with version 0.3 stable from this site:

JohnDoh's RoundCube-Plugin-SpamAssassin-User-Prefs-SQL at 0.3-stable - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-SpamAssassin-User-Prefs-SQL/tree/0.3-stable)

Has John know .

THe problem here is that I got an error saving the settings for the spam.

See attach
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 05, 2010, 04:16:17 AM
Hi, I'm sorry if you are not going to answer my questions or take any notice of what I say then I cannot help you. That error most likely means there is a mistake in your config. There should be more info in the RC error log [rc root]/logs/errors. I hope you get it working.
Title: pl_PL localisation
Post by: chilek on September 05, 2010, 06:37:50 AM
JohnDoh: I haven't found your contact details anywhere, though I write here: I've fixed polish localisation of sasuserprefs plugin. How could I send it to you? Bests, Tomasz.
Title: SpamAssassin MySQL Plugin
Post by: dziobak on September 05, 2010, 07:02:58 AM
You can attach it on forum.
Title: Sorry John
Post by: LMSSML on September 05, 2010, 08:36:06 AM
HI John

Sorry if I couldn't express the best way but what I mean with this it's when I put the version 0.3 it works without problem if I use the version of 0.4 the problem persists.

Althout I've checked the log that you were saying and no problems appears meanwhile I made a debug on rc log pass it to 8 and error log stays on the same without any problem.

 Thanks
Title: Working but not at all
Post by: LMSSML on September 05, 2010, 09:55:16 AM
HI John

I was using 0.4 beta on RC and I upgraded to 04. stable version .


Ok the version 0.3 does not work and it was has the first post I post, dealined.

So I upgraded to 0.4 stable and put the plugin in the version of 0.4 spamuserprefs, and it went good.

No problem except two little things:

First droped the table on database and created new one like this:

CREATE TABLE IF NOT EXISTS `userpref` (
  `username` varchar(100) NOT NULL DEFAULT '',
  `preference` varchar(50) NOT NULL DEFAULT '',
  `value` varchar(100) NOT NULL DEFAULT '',
  `prefid` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`prefid`),
  KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


Two things won't work:

If I click on General Settings it takes too long and it doesn't show anything, also the same behavior to Bayes Settings.


Althout I could not save anything same error reported in the last post.

Any help ?


Thanks
Title: SpamAssassin MySQL Plugin
Post by: Pretenderr on September 19, 2010, 07:40:28 AM
to be deleted, wrong button. sorry
Title: SpamAssassin MySQL Plugin
Post by: Pretenderr on September 19, 2010, 07:43:34 AM
hello,

do I understand correctly that this plugin will not work on shared web hosting? even if spamassassin is installed by webhoster?

regards
david
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 19, 2010, 08:34:47 AM
if you have read/write access to the database that stores your prefs then you can, if not then no.
Title: Thoughts on ldap ?
Post by: nkoz on September 23, 2010, 07:10:27 AM
Hi , are there any thoughts of also supporting ldap for spamassassin user preferences ?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on September 23, 2010, 01:02:56 PM
i dont really know anything about LDAP so I wouldn't really know where to start to do that :/
Title: SpamAssassin MySQL Plugin
Post by: nkoz on September 29, 2010, 07:37:14 AM
Thanx for your reply ... Me on the other hand know nothing on ajax/javascript :(
Title: SpamAssassin MySQL Plugin
Post by: emal011 on September 30, 2010, 11:48:01 AM
Quote from: LMSSML;29860
HI there,


It disappeard the problem with version 0.3 stable from this site:

JohnDoh's RoundCube-Plugin-SpamAssassin-User-Prefs-SQL at 0.3-stable - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-SpamAssassin-User-Prefs-SQL/tree/0.3-stable)

Has John know .

THe problem here is that I got an error saving the settings for the spam.

See attach


Here the same problem...

SpamAssassin User Prefs (SQL) version 1.5

I can not change nothing!
Title: ok_locales
Post by: roentgen on January 11, 2011, 04:42:51 PM
Hi

If I read Mail::SpamAssassin::Conf - SpamAssassin configuration file (http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html#language_options) correctly ok_locales may take only en ja ko ru th zh values.

ok_languages is another story which seems to correspond to the real language.

Sorry if I understood something wrong.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on January 12, 2011, 04:19:33 PM
yes I think you might be right, I will try and correct the plugin
Title: Any news
Post by: LMSSML on February 03, 2011, 05:26:08 PM
HI there,

I saw on log that evry time I try to save something on spam assassin user prefereneces it become with an error on roundcube.

and on the log it become with:
Feb  3 22:22:04 mailserver roundcube: MDB2 Error: syntax error (-2): _doQuery: [Error message: Could not execute statement]#012[Last executed query: SELECT , #012#011#011   FROM   #012#011#011   WHERE   = 'teste@example.pt'#012#011#011   AND     <> 'whitelist_from'#012#011#011   AND     <> 'blacklist_from'#012#011#011   AND     <> 'whitelist_to';]#012[Native code: 1064]#012[Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' #012#011#011   FROM   #012#011#011   WHERE   = 'teste@example.pt'
Feb  3 22:22:04 mailserver roundcube: [03-Feb-2011 22:22:04 +0000]: DB Error: MDB2 Error: syntax error Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT ,  FROM    WHERE   = 'teste@example.pt' AND     <> 'whitelist_from' AND     <> 'blacklist_from' AND     <> 'whitelist_to';] [Native code: 1064] [Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '  FROM    WHERE   = 'teste@example.pt' AND      'whi' at line 1]  in /var/www/rc4/program/include/rcube_mdb2.php on line 644 (POST /rc4/?_task=settings&_action=plugin.sauserprefs.save)
Feb  3 22:22:04 mailserver roundcube: PHP Warning:  array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/rc4/plugins/sauserprefs/sauserprefs.php on line 65
Feb  3 22:22:04 mailserver roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/rc4/plugins/sauserprefs/sauserprefs.php on line 125
Feb  3 22:22:04 mailserver roundcube: PHP Warning:  array_flip() [function.array-flip]: The argument should be an array in /var/www/rc4/plugins/sauserprefs/sauserprefs.php on line 498
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on February 04, 2011, 03:03:38 AM
That error shows there are alot of bit missing from the SQL. Check that you have set
Code: [Select]
// spamassassin database settings
$rcmail_config['sauserprefs_db_dsnw'] = 'mysql://username:password@localhost/database';

// table that holds user prefs
$rcmail_config['sauserprefs_sql_table_name'] = &quot;userpref&quot;;

// name of the username field in the user prefs table
$rcmail_config['sauserprefs_sql_username_field'] = &quot;username&quot;;

// name of the preference field in the user prefs table, holds the name of the preference
$rcmail_config['sauserprefs_sql_preference_field'] = &quot;preference&quot;;

// name of the value field in the user prefs table, holds the value of the preference
$rcmail_config['sauserprefs_sql_value_field'] = &quot;value&quot;;

// username of the &quot;global&quot; or default settings user in the database, normaly $GLOBAL or @GLOBAL
$rcmail_config['sauserprefs_global_userid'] = &quot;\$GLOBAL&quot;;

correctly in your config and that you remember to rename it from config.inc.php.dist to config.inc.php
Title: SpamAssassin MySQL Plugin
Post by: LMSSML on February 04, 2011, 01:10:45 PM
Hi there

The config.inc.php goes like this.


/*
 +-----------------------------------------------------------------------+
 | SAUserPrefs configuration file                                        |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 +-----------------------------------------------------------------------+

*/

$sauserprefs_config = array();

// spamassassin database settings
//$sauserprefs_config['db_dsnw'] = 'mysql://roundcube:password@localhost/roundcube';

// PEAR database DSN for read only operations (if empty write database will be used)
// useful for database replication
$sauserprefs_config['db_dsnr'] = '';

// use persistent db-connections
// beware this will not "always" work as expected
// see: PHP: Persistent Database Connections - Manual (http://www.php.net/manual/en/features.persistent-connections.php)
$sauserprefs_config['db_persistent'] = FALSE;

// table that holds user prefs
$sauserprefs_config['sql_table_name'] = "userpref";

// name of the username field in the user prefs table
$sauserprefs_config['sql_username_field'] = "username";

// name of the preference field in the user prefs table, holds the name of the preference
$sauserprefs_config['sql_preference_field'] = "preference";

// name of the value field in the user prefs table, holds the value of the preference
$sauserprefs_config['sql_value_field'] = "value";

// enable the whitelists synchronisation
// NOTE: To use this your SpamAssassin prefs table must include a field in which the contact_id from the RC address book can be stored
// check README for more information
$sauserprefs_config['whitelist_sync'] = FALSE;

// don't allow these settings to be overriden by the user
// eg. $sauserprefs_config['dont_override'] = array('required_score','rewrite_header Subject');
$sauserprefs_config['dont_override'] = array();

// default settings
// these are overridden by $GLOBAL and user settings from the database
$sauserprefs_config['default_prefs'] = array(
                                                                        "required_score" => "5",
                                                                        "rewrite_header Subject" => "*****SPAM*****",
                                                                        "ok_languages" => "all",
                                                                        "ok_locales" => "all",
                                                                        "fold_headers" => "1",
                                                                        "add_header all Level" => "_STARS(*)_",
                                                                        "use_razor1" => "0",
                                                                        "use_razor2" => "1",
                                                                        "use_pyzor" => "1",
                                                                        "use_dcc" => "1",
                                                                        "use_bayes" => "1",
                                                                        "skip_rbl_checks" => "0",
                                                                        "report_safe" => "1",
                                                                        "bayes_auto_learn" => "1",
                                                                        "bayes_auto_learn_threshold_nonspam" => "0.1",
                                                                        "bayes_auto_learn_threshold_spam" => "12.0",
                                                                        "use_bayes_rules" => "1"
                                                                );

// spam score increment - increment values in the the score threshold drop down by this, from 0 to 10
$sauserprefs_config['score_inc'] = 1;

// delete user bayesian data stored in database
// the query can contain the following macros that will be expanded as follows:
//      %u is replaced with the username (from the session info)
// use an array to run multiple queries
// eg. $sauserprefs_config['bayes_table'] = array(
//                                                                                              'DELETE FROM bayes_seen WHERE id IN (SELECT id FROM bayes_va$
//                                                                                              'DELETE FROM bayes_token WHERE id IN (SELECT id FROM bayes_v$

$sauserprefs_config['bayes_delete_query'] = '';

// define languages
$sauserprefs_config['languages'] = array(
                                                                        "af" => "Afrikaans",
                                                                        "sq" => "Albanian",
                                                                        "am" => "Amharic",
                                                                        "ar" => "Arabic",
                                                                        "hy" => "Armenian",
                                                                        "eu" => "Basque",
                                                                        "bs" => "Bosnian",
                                                                        "bg" => "Bulgarian",
                                                                        "be" => "Byelorussian",
                                                                        "ca" => "Catalan",
                                                                        "zh" => "Chinese",
                                                                        "hr" => "Croatian",
                                                                        "cs" => "Czech",
                                                                        "da" => "Danish",
                                                                        "nl" => "Dutch",
                                                                        "en" => "English",
                                                                        "eo" => "Esperanto",
                                                                        "et" => "Estonian",
                                                                        "fi" => "Finnish",
                                                                        "fr" => "French",
                                                                        "fy" => "Frisian",
                                                                        "ka" => "Georgian",
                                                                        "de" => "German",
                                                                        "el" => "Greek",
                                                                        "he" => "Hebrew",
                                                                        "hi" => "Hindi",
                                                                        "hu" => "Hungarian",
                                                                        "is" => "Icelandic",
                                                                        "id" => "Indonesian",
                                                                        "ga" => "Irish Gaelic",
                                                                        "it" => "Italian",
                                                                        "ja" => "Japanese",
                                                                        "ko" => "Korean",
                                                                        "la" => "Latin",


$rcmail_config['sauserprefs_db_dsnw'] = 'mysql://roundcube:password@localhost/roundcube?new_link=true';
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on February 05, 2011, 04:22:40 AM
and there is nothing in the error log about not being able to read it or anything like that?
Title: SpamAssassin MySQL Plugin
Post by: fritz001 on February 08, 2011, 06:03:03 PM
Hei John, can you add an option to enable edit of rules in (Address Rules ) instead of just Create/Delete ?
Also option "ok_languages" => "all" from config.inc.php ..?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on February 09, 2011, 03:24:13 AM
Quote
can you add an option to enable edit of rules in (Address Rules ) instead of just Create/Delete ?

It's only 1 peice of information so editing is the same as delete+create, I'm not sure its really nessecarry, I'll put it on the wish list.

Quote
Also option "ok_languages" => "all" from config.inc.php ..?

What about it?
Title: required_score not shown as default
Post by: jimmi on April 12, 2011, 07:18:27 AM
It could be only cosmetic, but looks weird.

I set in my database in $GLOBAL config the score 4.5, but when I go into the settings of RC interface the proposed score is still 5, only in the dropdown box I have the last entry "Others [4.5]".

Using spamc anyhow the required score is 4.5: is it correct?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on April 12, 2011, 09:37:34 AM
by default the scores available in the box are incremented by 1 from 0 to 10, if you want to use a different increment that can be changed from the config file.
Title: Postfix and SA MySQL Plugin?
Post by: a.l on April 17, 2011, 12:00:53 PM
Hi

I am really a noob. :-)

I'm trying to setup a mailserver where I want a configuration like this:
Postfix+dovecot+roundcube+SpamAssassin MySQL Plugin

I have some very basic postfix and dovecot setup up and running on a virtual machine before I go implement it on the real target server.
I have also installed the newest roundcube found in the beta of ubuntu 11.04 - however on the target server i will install roundcube from source to do stuff right (I can see the ubuntu dpkg installer does not ask all normally necessary questions.)

Now, because I would like to make it as user friendly as possible for the users of our local housing association (non-profit) then I would like to make use of the SA MySQL plugin.
(Besides that and because there is no Danish translation of this plugin I will make a translation right after I get this plugin to work and post it here. I already translated some of the strings however I would like to see the result before submitting.)

But there is a rock on the road that makes me stop!
It states in: http://www.tehinterweb.co.uk/roundcube/plugins/sauserprefs.README.txt
, that I should follow: UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL)
, but when I read the section about "Testing your Setup" in the bottom of the page I kind of get lost!

I am lost because I do not know how to call Postfix with "spamc -u " and the right username (e.g./perhaps making a script to decide that and call spamc)?

I am also a little lost about how to understand the concept of the username?

Thank you all very much in advance!
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on April 18, 2011, 03:26:42 AM
Hi, I think you might need to go ask the Postfix people. I don't know anything about Postfix though there could be other people around the forum who do and can post the answer I would guess a specialist postfix forum/list is what you want.
Title: SpamAssassin MySQL Plugin
Post by: a.l on May 09, 2011, 04:31:31 PM
Quote from: JohnDoh;34341
Hi, I think you might need to go ask the Postfix people. I don't know anything about Postfix though there could be other people around the forum who do and can post the answer I would guess a specialist postfix forum/list is what you want.


Thanks :-)

In the meantime i have been testing the plugin.

It seems to work (I havent tested it with spamassassin yet due to other work.)
The plugin works fine - I can set the different user preferences and the MySQL tables are updated.
However when I change a preference on the 'Generel Settings' section and try to save then only the first time I get "Successfully changed spam settings" on all attempts afterwards I get "Error: Cannot change spam settings" however they are _indeed_ changed in the MySQL table. (The other sections e.g. Internet Based Spam Tests and Bayes Settings do not have this problem.)

I have tried to wipe the tables and then it works again the first time and following attempts come with the error, but the preferences get changed.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on May 10, 2011, 02:53:14 AM
Quote
However when I change a preference on the 'Generel Settings' section and try to save then only the first time I get "Successfully changed spam settings" on all attempts afterwards I get "Error: Cannot change spam settings" however they are _indeed_ changed in the MySQL table.

That means one of the updates failed. It works fine for me. Could you look in the RC error log and see if there are any SQL errors please?
Title: SpamAssassin MySQL Plugin
Post by: a.l on May 10, 2011, 06:50:33 AM
Quote from: JohnDoh;34765
That means one of the updates failed. It works fine for me. Could you look in the RC error log and see if there are any SQL errors please?

Thx again :-)

Well, there are no errors in the logs/errors file (only some old - days ago while i was setting up roundcube.)
I'm using 0.5.2 of RC and v. 1.6 of sauserprefs. I've tried with Firefox 4 and google chrome 11. I use MySQL 5.1.54 and PHP 5.3.5  in ubuntu 11.04.
I've made a spamassassin db with a spamassassin user. The user has rights to make tables etc. I'm a sql and php newbie. I've created the db this way:
CREATE DATABASE spamassassin /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
GRANT ALL PRIVILEGES ON spamassassin.* TO spamassassin@localhost IDENTIFIED BY 'secretpw';

I hope I made a mistake somewhere.

Thank You for your help :-)

*Update* Forgot to mention I changed debug level from 4 to 8, but that did not have any impact on the errors log.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on May 12, 2011, 03:43:42 PM
the latest changeset in the repo adds a little more logging for when a save fails, that might help you track down whats wrong.

also i'm assuming that as well as creating the database you created the tables with the proper structure and put the field names in the plugin config right?
Title: SpamAssassin MySQL Plugin
Post by: jimmi on May 13, 2011, 03:16:18 AM
Hi,

I configured a mailserver with Postfix, Dovecot, Amavis+Clamav+Spamassassin and RC along with SA userprefs and MarkAsJunk2, and I would like to share my experience in order to look for mistakes I did or alternate solutions.

The SA module of Amavis is not working like spamd. Generally AWL and Byesean SQL tables works, userpref does not because SA is called by user amavis only.

MarkAsJunk2
- In order to make it working the spam command must be like:
$rcmail_config['markasjunk2_spam_cmd'] = '/usr/bin/sa-learn --spam --username=amavis %f';
therefore the choices are shared between users.

SA user preferences
- Obviously do not work. The feature that I miss is W/B listing, that amavis shares among users and therefore could be a nonsense here.

The new amavis 2.7.0 is in somehow implementying user preferences, I shall understand how. It looks to me that the best choice to use these plugins is to call clamav and spamassassin without amavis (http://www.miek.nl/s/151d344c47/), isn't?
Title: SpamAssassin MySQL Plugin
Post by: a.l on May 13, 2011, 06:08:51 AM
Quote from: JohnDoh;34813
the latest changeset in the repo adds a little more logging for when a save fails, that might help you track down whats wrong.

also i'm assuming that as well as creating the database you created the tables with the proper structure and put the field names in the plugin config right?


Thanks :-)

Well, I followed: UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL) - more particular the
Code: [Select]
CREATE TABLE `userpref` (
  `id` int(8) unsigned NOT NULL auto_increment,
  `username` varchar(128) NOT NULL default '',
  `preference` varchar(64) NOT NULL default '',
  `value` varchar(128) default NULL,
  `descript` varchar(128) default NULL,
  `added` datetime NOT NULL default '2003-01-01 00:00:00',
  `added_by` varchar(128) NOT NULL default '',
  `modified` timestamp(14) NOT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `type` (`preference`),
  KEY `added_by` (`added_by`),
  KEY `preference` (`preference`),
  KEY `username` (`username`)
) TYPE=MyISAM COMMENT='Spamassassin Preferences';


I have checked config.inc.php and they apply the defaults of: userpref, username, preference and value.

I downloaded the new sauserprefs.php from github and put it on my virtual machine.

The following output was then saved to the errors log:
[13-May-2011 11:38:15 +0200]: sauserprefs error: cannot update "ok_languages" = "af sq am ar hy eu bs bg be ca zh hr cs da nl en eo et fi fr fy ka de el he hi hu is id ga it ja ko la lv lt ms mr ne no fa pl pt ru th" for anders
[13-May-2011 11:39:05 +0200]: sauserprefs error: cannot update "ok_languages" = "af sq am ar hy eu bs bg be ca zh hr cs da nl en eo et fi fr fy ka de el he hi hu is id ga it ja ko la lv lt ms mr ne no fa pl pt qu rm ro ru sa sco gd sr sk sl es sw sv tl ta th tr uk vi cy yi" for anders
[13-May-2011 11:50:14 +0200]: sauserprefs error: cannot update "ok_languages" = "af sq am ar hy eu bs bg be ca zh hr cs da nl en eo et fi fr fy ka de el he hi hu is id ga it ja ko la lv lt ms mr ne no fa pl pt ru th" for anders
[13-May-2011 11:52:19 +0200]: sauserprefs error: cannot update "ok_languages" = "af sq am ar hy eu bs bg be ca zh hr cs da nl en eo et fi fr fy ka de el he hi hu is id ga it ja ko la lv lt ms mr ne no fa pl pt ru th" for anders
[13-May-2011 11:52:29 +0200]: sauserprefs error: cannot update "ok_languages" = "af sq am ar hy eu bs bg be ca zh hr cs da nl en eo et fi fr fy ka de el he hi hu is id ga it ja ko la lv lt ms mr ne no fa pl pt qu rm ro ru sa sco gd sr sk sl es sw sv tl ta th tr uk vi cy yi" for anders

1. It seems to be a problem saving the ok_languages.
2. The db gets updated with content ok_languages.
3. Well, besides the errors I found out that if I choose no languages to be selected/accepted at all it did not give any error. Also if I only selected english and danish I could save without errors.

So I guessed that one or more of the languages led to this error (message).

Now, I checked each language almost one by one. When I came to the language "Quechua" then the error came! However I boiled down to that the "value" varchar(128) of userpref table was too short, but thanks to your errors log entries I could find that out.
So sorry that I did not think of the obvious when I look back. :-) So please state that in the readme that value entry should set accordingly to the max amount of languages times 3 or 4 (for spaces and chars). I set it to 512 and it worked like a charm.

Thank you for your help and efforts!!! :-)
Title: SpamAssassin MySQL Plugin
Post by: a.l on May 13, 2011, 06:25:09 AM
Quote from: jimmi;34815
Hi,

...

The new amavis 2.7.0 is in somehow implementying user preferences, I shall understand how. It looks to me that the best choice to use these plugins is to call clamav and spamassassin without amavis (http://www.miek.nl/s/151d344c47/), isn't?


Hi Jimmi

All what you wrote is also interesting for me. I'm in the process of learning amavis at the moment because I want a similar setup like you.

Currently I read: amavisd-new documentation bits and pieces (http://www.ijs.si/software/amavisd/amavisd-new-docs.html)
It seems in the current version there might be some possibilities also according to http://www.ijs.si/software/amavisd/README.sql.txt

But it is one of the more complicated things I have tried to setup when there are so many components (Amavis, Postfix, Dovecot etc.) that all needs to work together. But it would really be nice if Amavis with the new features gets released soon, but else I have been thinking about making a small php page perhaps where users can set their preferences regarding spam threshold and kill level regarding current possibilities in amavis until new features of amavis are released with user preference support. Correct me if I have understood anything Wrong. :-)
Title: SpamAssassin MySQL Plugin
Post by: jimmi on May 13, 2011, 08:00:31 AM
Hi a.l.

Quote from: a.l;34821
... I have been thinking about making a small php page perhaps where users can set their preferences regarding spam threshold and kill level regarding current possibilities in amavis...


I opened a thread in the amavis ML (http://lists.amavis.org/pipermail/amavis-users/2011-May/000302.html) to understand the details of SA amavis integration. As far as I understood with the current amavisd-new it is not possible to set user preferences at all, at least not using a db. The only possibility is to set a user B/W lists as per document linked by you.

I'm learning now how to avoid using amavis (http://www.xtarutaru.com/2009/04/16/spamassassin-clamav-postfix-without-amavis-debian/), at least untill I may use the new features :)
Title: SpamAssassin MySQL Plugin
Post by: a.l on May 13, 2011, 11:00:00 AM
Quote from: jimmi;34822
Hi a.l.



I opened a thread in the amavis ML (http://lists.amavis.org/pipermail/amavis-users/2011-May/000302.html) to understand the details of SA amavis integration. As far as I understood with the current amavisd-new it is not possible to set user preferences at all, at least not using a db. The only possibility is to set a user B/W lists as per document linked by you.

I'm learning now how to avoid using amavis (http://www.xtarutaru.com/2009/04/16/spamassassin-clamav-postfix-without-amavis-debian/), at least untill I may use the new features :)


Interesting - thanks :) That is really, really something I will look into!
I just hope it addresses backscattering. There is something about it here VBounceRuleset - Spamassassin Wiki (http://wiki.apache.org/spamassassin/VBounceRuleset) and this confusing doc/article here: IntegratedSpamdInPostfix - Spamassassin Wiki (http://wiki.apache.org/spamassassin/IntegratedSpamdInPostfix) - notice, that it contains two ways of doing after queue filtering and it is unclear whether the warning at the top of the page refers to both or just the first example about how to setup (or not setup) an after queue.

And I think you are right.  I found a policy table and a users table (in the amavis docs) - but they do not allow for individual preferences. So either one has to compile the current pre-release with all the caveats it might have *sigh* or use the "temporary" solution you mention. But anyway since I'm going to make a solution targeting about 22+ current users on a voluntary basis its not that important if scanning a mail is going to take a little longer than with amavis.
Of course is someone has already made a backport of the amavis prerelease it could be a little interesting to try it out - however one has to think about at least the structure of the configuration files according to this: amavis-user Re: setting amavisd on new server Q (http://www.engardelinux.com/modules/index/list_archives.cgi?list=amavis-user&page=0068.html&month=2011-04)
Title: using email instead of username from session
Post by: sstahl on May 16, 2011, 04:59:08 PM
Is it possible to store the preferences using the email address stored in the user's identity instead of the one stored in the session variable?

The reason I ask is my system uses aliases and systems users so RC can only store the preferences for the actual user and not their alias.  Furthermore some user's may have multiple aliases but I'd be happy using settings for the main aliases.

So I have a username of salesdomain and an alias of sales@domain.com and right now the plugin stores the prefs under salesdomain while on my system SA need to use sales@doman.com.

Hopefully this makes some sense.

Thanks!

Scott.
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on May 18, 2011, 02:09:41 AM
you cant do it from the config but with a few changes in the code its not a problem. at the moment it uses session['username'] when building the SQL statements, you just need to change that to a new variable which holds the email address from your default identity
Title: SpamAssassin MySQL Plugin
Post by: ozgurerdogan on July 21, 2011, 01:17:01 PM
For what kind of SA install is this plugin for? My config is hmailserver and spamassasin is on a external linux box. To use this plugin, must I install SA on same server as hmail installed?

In README it says:

* You must set the database connection string
* Enter the table name, name of the username field, preference field, and value
field

Which database and which tables?
Title: SpamAssassin MySQL Plugin
Post by: JohnDoh on July 22, 2011, 04:21:41 AM
its the spamassassin prefs database, take a look at  UsingSQL - Spamassassin Wiki (http://wiki.apache.org/spamassassin/UsingSQL)
Title: SpamAssassin MySQL Plugin
Post by: wenhalchen on July 24, 2011, 03:15:12 AM
1. It seems to be a problem saving the ok_languages.
2. The db gets updated with content ok_languages.
Title: SpamAssassin MySQL Plugin
Post by: mjung on August 08, 2011, 08:12:08 PM
Quote from: wenhalchen;35830
1. It seems to be a problem saving the ok_languages.
2. The db gets updated with content ok_languages.

 
The plugin is OK, but most likely your database has a too short VARCHAR for the 'value' field. I use the following SQL statement to create my table:

Code: [Select]

  CREATE TABLE `userpref` (
   `id` int(8) unsigned NOT NULL auto_increment,
   `username` varchar(128) NOT NULL default '',
   `preference` varchar(64) NOT NULL default '',
   `value` varchar(16384) default NULL,
   `descript` varchar(128) default NULL,
   `added` datetime NOT NULL default '2003-01-01 00:00:00',
   `added_by` varchar(128) NOT NULL default '',
   `modified` timestamp(14) NOT NULL,
   UNIQUE KEY `id` (`id`),
   KEY `type` (`preference`),
   KEY `added_by` (`added_by`),
   KEY `preference` (`preference`),
   KEY `username` (`username`)
  ) TYPE=MyISAM COMMENT='Spamassassin Preferences';


HTH?
M
Title: SpamAssassin MySQL Plugin
Post by: adumpaul on November 04, 2011, 04:57:39 AM
This plugin module provides support for the auto-whitelist. It keeps track of the average SpamAssassin score for senders. Senders are tracked using a combination of their From: address and their IP address. It then uses that average score to reduce the variability in scoring from message to message and modifies the final score by pushing the result towards the historical average. This improves the accuracy of filtering for most email.
Title: Re: SpamAssassin MySQL Plugin
Post by: arodier on April 01, 2012, 09:01:41 AM
The reason is because the default size of the column value is to small. When you are saving the list of accepted languages, it doesn't fit in the column value.
You can modify your database like that:

Code: [Select]
[font=courier]alter table userpref modify column `value` VARCHAR(4096);
alter table userpref modify column `preference` VARCHAR(100);[/font]
Title: Re: SpamAssassin MySQL Plugin
Post by: tparvais on July 20, 2012, 06:18:41 PM
Hello

Is it possible to get this plugin working fine with "spamassassin in a box" from jam software ?

This is one of the unique spamassassin package I found that is working fine on windows 2008 with Hmailserver.

Spamassassin in a box seems to be customizable, but I never do any spamassasin specific config local.cf etc... I'm a bit lost

Thank you

Title: Re: SpamAssassin MySQL Plugin
Post by: JohnDoh on July 21, 2012, 07:14:17 AM
if settings are stored in a mysql database in the normal spamassassin way then it should work, if not it will not.
Title: Re: SpamAssassin MySQL Plugin
Post by: garyg on October 19, 2012, 05:59:54 AM
Hello everyone.

I searched the forum but it seems I am the only one to get the following issue (well, actually I am not, my whole company gets the same issue). On my firefox and Chromium, when I use sauserprefs for inserting a record into the database, I get a javascript error, although the plugin says that my changes were saved. Of course, in the SQL database, nothing gets recorded. My RoundCube version is 0.8.2. SAuserprefs version is the last one (4th of October 2012).

I use the form to add an email address "garybaldi.baldi <at> laposte.net" to the blacklist (notice that the first entry "garybaldi" was added manually in the database. thats means SAuserprefs does not have any problem with connecting to the database):
(http://velotrip.free.fr/step0.jpg)

I save my changes. The email address in the field disappears and SAuserprefs tells me "Successfully changed spam settings". Obviously, the email address does not get recorded in the database.
(http://velotrip.free.fr/step1.jpg)

When I immediately check Javascript error console on Firefox, here is what I get. Same thing happens with Chromium. Is there a problem with the iframe variables or something ? I strongly suspect some sort of javascript problem with preference-frame iframe variables. I am no javascript coder, so it's a bit long for me to debug that. Do you guys have any clue on that issue ?
(http://velotrip.free.fr/step2.jpg)

Thank you for your help.

Gary
Title: Re: SpamAssassin MySQL Plugin
Post by: JohnDoh on October 19, 2012, 10:38:26 AM
hi, this was because of a change in the core which occured one day before 0.8.2 came out. there is a fix in the files here https://github.com/JohnDoh/Roundcube-Plugin-SpamAssassin-User-Prefs-SQL/tree/rc-0.8
Title: Re: SpamAssassin MySQL Plugin
Post by: garyg on October 23, 2012, 03:43:05 AM
Thank you JohnDoh, problem is fixed !
Title: Re: SpamAssassin MySQL Plugin
Post by: schickel007 on November 30, 2012, 10:42:35 AM
Hi,

after installing (with mysql-database) and activating this plugin, my userpref will not be use. My change in the Spam-Plugin is in the databas, but retrievieng mails will always get the default score.

In mail log is also no error.

What must be done, that spamd use the user-pref and not the default-score?

What infos do you need, for debug?

Using:
Roundcube 0.8.4
SpamAssassin Server version 3.3.2                                                                                                                                     
  running on Perl 5.12.4                                                                                                                                             
  with SSL support (IO::Socket::SSL 1.44)                                                                                                                             
  with zlib support (Compress::Zlib 2.02401)

Title: Re: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 01, 2012, 02:42:30 AM
did you setup your spamassassin to read user prefs from the database? http://wiki.apache.org/spamassassin/UsingSQL
Title: Re: SpamAssassin MySQL Plugin
Post by: schickel007 on December 01, 2012, 10:49:27 AM
Yes I did.

/etc/spamassassin/sql.cf:
Code: [Select]
user_scores_dsn                 DBI:mysql:spamassassin:localhost:3306
user_scores_sql_password        password
user_scores_sql_username        username
user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username = CONCAT('%',_DOMAIN_) ORDER BY username ASC

Database is also like described in the post from spamassassin.
Title: Re: SpamAssassin MySQL Plugin
Post by: JohnDoh on December 02, 2012, 06:49:47 AM
there are instructions on that page for how to run spamassassin in debug mode so you can see what it is doing, or you could try asking the spamassin community for help. sounds like not a roundcube/pluing issue to me.
Title: Re: SpamAssassin MySQL Plugin
Post by: oldschool on December 02, 2012, 09:24:56 AM
Hi!

First of all you need a running spamassassin-mysql-mailsystem.
Be warned: This is NOT an easy process.

The next step is to combine the system from above with the rc-plugin.


Rgds.
Title: Re: SpamAssassin MySQL Plugin
Post by: schickel007 on December 03, 2012, 05:50:55 AM
One thing I must tell you:

I'm on Gentoo. I run amavisd-new for many years and the only reason I try Spamassassin is the plugin in roundcube.

MySQL and Apache is working very well. Changes I made in the Plugin will be stored in database. But the only thing, what is really important: Spamd is connecting to database but don't use the userprefs. My spamd is starting with the right options to use mysql:

/etc/conf.d/spamd:
SPAMD_OPTS="-q -u nobody -m 5 -c -H"

I've tested also some postfix-configs (also from http://wiki.apache.org/spamassassin/IntegratedSpamdInPostfix - the part with MySQL).
master.cf:
smtp    inet    n - n - - smtpd -o content_filter=spamassassin
spamassassin unix  -       n       n       -       -       pipe
             flags=Rq user=nobody argv=/usr/bin/spamc -u ${user} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

main.cf:
spamassassin_destination_recipient_limit = 1

I'll search and debug and try to get a solution.....
Title: Re: SpamAssassin MySQL Plugin
Post by: schickel007 on December 03, 2012, 06:34:41 AM
Ok, I see something:

Dez  3 11:30:19.648 [13744] info: spamd: connection from localhost [127.0.0.1] at port 35907
Dez  3 11:30:19.653 [13744] info: spamd: handle_user unable to find user: 'schickel'

The username is not schickel only. It is the whole mailadress.... So, it seems, that the mysql-query is wrong.
Title: Re: SpamAssassin MySQL Plugin
Post by: schickel007 on December 03, 2012, 08:06:42 AM
I#ve got it:

in postfix master.cf:
spamassassin unix  -       n       n       -       -       pipe
 flags=Rq user=nobody argv=/usr/bin/spamc -u ${recipient} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

-u ${recipient} and not -u ${user}

Now I can go on
Title: Re: SpamAssassin MySQL Plugin
Post by: oldschool on December 03, 2012, 05:32:31 PM
I#ve got it:

in postfix master.cf:
spamassassin unix  -       n       n       -       -       pipe
 flags=Rq user=nobody argv=/usr/bin/spamc -u ${recipient} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

-u ${recipient} and not -u ${user}

Now I can go on

Niiice!
;)
Title: FreeBSD-Postfix-MySQL-SpamAssassin-Maia-Dovecot
Post by: edsonmendes on April 19, 2013, 09:07:08 AM
Hi,

I have a mail server running on FreeBSD-Postfix-MySQL-SpamAssassin-Maia-Dovecot-Pear + Roundcube0.8.6.
It is so difficult to deploy pluguin sauserprefs 0.8.6 with settings Spamassassin + Mayan.

Would anyone help me?
Title: Re: SpamAssassin MySQL Plugin
Post by: rfassett on April 28, 2013, 11:26:01 AM
Do you have a specific problem? I have a somewhat similar configuration.

One thing that messed me up with sauserprefs on FreeBSD was the location of the config files.  I thought they were in /usr/local/etc/mail/spamassassin, but they ended up being in /usr/local/share/spamassassin

If it's something else, email me as I mostly only check the forums here during RoundCube updates. ;)

Address: rfassett at anent dot net
Title: Re: SpamAssassin MySQL Plugin
Post by: projectmyst on September 16, 2013, 07:07:38 AM
Is there any ways of getting this to work with plesk?
Title: Re: SpamAssassin MySQL Plugin
Post by: JB1985 on February 03, 2017, 03:01:18 AM
@JohnDon

have any idea to configure with amavis?

Score and Spam Subject are not working.