Author Topic: SpamAssassin MySQL patch  (Read 28390 times)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« on: August 16, 2008, 11:44:16 AM »
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
« Last Edit: June 09, 2009, 01:24:50 PM by JohnDoh »
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Grandmaster_Bofhy

  • Newbie
  • *
  • Posts: 3
Incorrect Declaration
« Reply #1 on: August 24, 2008, 06:05:24 AM »
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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #2 on: August 24, 2008, 06:35:17 AM »
doh! sorry, the line should be $sauserprefs_config['db_dsnw'] = .... I have updated the attached file.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Grandmaster_Bofhy

  • Newbie
  • *
  • Posts: 3
SpamAssassin MySQL patch
« Reply #3 on: August 24, 2008, 07:51:55 AM »
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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #4 on: August 24, 2008, 09:55:49 AM »
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…

Offline rgalps

  • Newbie
  • *
  • Posts: 0
SpamAssassin MySQL patch
« Reply #5 on: September 06, 2008, 04:06:38 PM »
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.

Offline mdr

  • Jr. Member
  • **
  • Posts: 12
SpamAssassin MySQL patch
« Reply #6 on: November 02, 2008, 01:27:25 AM »
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.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #7 on: November 06, 2008, 03:34:25 AM »
Hi,

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

Offline pyther24

  • Newbie
  • *
  • Posts: 7
SpamAssassin MySQL patch
« Reply #8 on: November 09, 2008, 03:10:00 PM »
Could you update the patch to make it work with roundcube 2 beta?

Cheers!!!

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #9 on: November 12, 2008, 03:21:30 AM »
done. please see first post.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zuluh

  • Newbie
  • *
  • Posts: 1
SpamAssassin MySQL patch
« Reply #10 on: November 16, 2008, 03:11:22 PM »
sorry, which is the release r1940? Does this patch works with RC 0.1.1?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #11 on: November 17, 2008, 06:15:55 AM »
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…

Offline pyther24

  • Newbie
  • *
  • Posts: 7
SpamAssassin MySQL patch
« Reply #12 on: November 23, 2008, 07:40:53 PM »
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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,326
SpamAssassin MySQL patch
« Reply #13 on: November 24, 2008, 06:30:13 AM »
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…

Offline pyther24

  • Newbie
  • *
  • Posts: 7
SpamAssassin MySQL patch
« Reply #14 on: November 24, 2008, 08:37:29 AM »
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).