Roundcube Community Forum

 

SpamAssassin MySQL Plugin

Started by JohnDoh, May 29, 2009, 08:41:46 AM

Previous topic - Next topic

magik_cypress

Hello,

program/localization/fr_FR/labels.inc

$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

$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

JohnDoh

#1
Great thanks, I'll add it in the next version.

UPDATE: The new version is now available on the website.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

mike113

I'm getting this error when clicking the spam tab I haven't been able to figure out what is failing.

[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?

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

JohnDoh

#4
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
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

patricktech

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

JohnDoh

#6
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
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

patricktech

#7
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.

JohnDoh

#8
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`
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

patricktech

#9
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).


JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

patricktech

#12
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

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

jnorth

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.
GeorgiaCarry.org Member[/SIZE]