+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast
Results 1 to 10 of 115

Thread: SpamAssassin MySQL Plugin

  1. #1
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default SpamAssassin MySQL Plugin

    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
    Last edited by JohnDoh; 06-09-2009 at 06:28 PM.
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  2. #2
    magik_cypress is offline Registered User
    Join Date
    Dec 2008
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default SpamAssassin MySQL Plugin

    Hello,

    program/localization/fr_FR/labels.inc

    Code:
    $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:
    $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

  3. #3
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

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

    UPDATE: The new version is now available on the website.
    Last edited by JohnDoh; 05-30-2009 at 12:59 PM.
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  4. #4
    mike113 is offline Registered User
    Join Date
    Jun 2009
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default Error loading Template sauserprefs

    I'm getting this error when clicking the spam tab I haven't been able to figure out what is failing.
    Code:
    [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?

  5. #5
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

    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 Patches: Sieverules, SpamAssassin Prefs, and more…

  6. #6
    patricktech is offline Registered User
    Join Date
    Mar 2008
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Using this plugin with other skins

    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

  7. #7
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

    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
    Last edited by JohnDoh; 06-10-2009 at 09:16 AM.
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  8. #8
    patricktech is offline Registered User
    Join Date
    Mar 2008
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default

    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.
    Last edited by patricktech; 06-10-2009 at 09:08 PM. Reason: Retracting paragraph

  9. #9
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

    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`
    Last edited by JohnDoh; 06-12-2009 at 02:37 PM.
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  10. #10
    patricktech is offline Registered User
    Join Date
    Mar 2008
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default

    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).
    Last edited by patricktech; 06-15-2009 at 04:22 PM.

+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast

LinkBacks (?)

  1. 06-09-2009, 07:41 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts