Roundcube Community Forum

 

SpamAssassin MySQL patch

Started by JohnDoh, August 16, 2008, 11:44:16 AM

Previous topic - Next topic

JohnDoh

Hi,

I have created a small patch 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).

The patch works with rev1652 (the latest SVN right now) and adds a 'Spam' tab to the 'Personal Settings'. It has been tested with SpamAssassin version 3.2.3. I have attached a screenshot as well as the patch.

Install
======
To apply the patch run `patch -ul -d /path/to/roundcubemail/ -p1 < /path/to/patch`. This should be all you need to do to install the patch.

Config
======
The config file is located in plugins/sauserprefs/config.inc.php
* You must set the database connection string
* Enter the table name, name of the username field, preference field, and value field
* Enable/disable the preferences you want your users to be able to change in $sauserprefs_config['settings']

20081112: New versions of the patch added; one for the 0.2beta release and one (r1940) which works with the SVN.

THIS PATCH IS NO LONGER SUPPORTED. IT HAS NOW BEEN CONVERTED TO USE THE PLUGIN API. FURTHER DISCUSSION CAN BE FOUND HERE http://www.roundcubeforum.net/api-based-plugins/4879-spamassassin-mysql-plugin.html
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

Grandmaster_Bofhy

I installed the patch discovered that in the config.inc.php file there is a

$changepasswd_config['db_dsnw'] = ....

where it should be

$sauserprefs__config['db_dsnw'] = ....

I also cannot start up the plugin.
Is there something that needs to be added elsewhere to start up the plugin?

-- Neil

JohnDoh

doh! sorry, the line should be $sauserprefs_config['db_dsnw'] = .... I have updated the attached file.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

Grandmaster_Bofhy

It also appears that

 if ($RCMAIL->action=='sauserprefs')
    include('program/steps/settings/sauserprefs.inc');

 if ($RCMAIL->action=='sauserprefs')
    include('program/steps/settings/sauserprefs.inc');


should be added into index.php
around line 280

JohnDoh

No, that is not missing. This patch is for rev1652, the need to include that code in index.php was removed some time ago.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

rgalps

This plugin seems to have a problem with Safari on the Mac. It works in IE and on FF, but clicking the 'Spam' link from within Safari doesn't do anything.

mdr

Has anyone had a chance to upgrade this patch to a later version from SVN.  I love the functionality of this patch but I need a later version of roundcube for my needs.

JohnDoh

Hi,

Sorry, i probably should have updated this thread. what SVN version do you have?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pyther24

Could you update the patch to make it work with roundcube 2 beta?

Cheers!!!

JohnDoh

Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

zuluh

sorry, which is the release r1940? Does this patch works with RC 0.1.1?

JohnDoh

1940 is the SVN version from about 6 weeks ago.

sorry no, i dont have a version of this code that works with 0.1.1
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pyther24

Thank you so much! It works great. Is it possible some how add a block/allow button/link to the email message so a filter is automatically added to the database?

JohnDoh

You could add something, I guess next to the little + for adding addresses to the address book, which adds and address to the whitelist/blacklist. Is that what you had in mind? I think its the kind of feature that should wait until the plugin api is done, at the moment I am trying to keep the number of files that have to be patched to a minimum.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pyther24

Yeah that is exactly what I was thinking.

Waiting is probably a good idea, however I'd love to have that feature :P I suppose I'll just have to enter them manually until the plugin api is completed.

Lastly, I think it might be a good idea to change the Score threshold to text box instead of a drop down (this is minor though and just a suggestion).