### Author Topic: SpamAssassin MySQL patch  (Read 29400 times)

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #15 on: November 26, 2008, 06:15:31 AM »
I'm not sure about a textbox for the score, I don't see the need for any sort of freeform input. I was thinking of perhaps putting a slider rather than the drop down though, it might just look nicer.

I was thinking a bit more about whitelist/blacklist buttons. I have some code which syncs the RC addressbook and the whitelist may be that would be better. But then may be it would still need a "Block this sender button".
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### pyther24

• Newbie
• Posts: 7
##### SpamAssassin MySQL patch
« Reply #16 on: November 26, 2008, 07:09:35 AM »
Well I think for the most part "Block this sender" is ineffecent because spammers are always using different domains and email addresses. Personally I really would just like to add some whitelists. If you wouldn't mind sharing the code you have, that'd be great!

As for the score, the reason I suggested the textbox, was due to the fact that I use a score of 3.5. However, because 3.5 is not a valid opition it defaults to 1, thus any changes I make would the score would reduce to 1. I added extra values in for myself, to fix the problem. Is there some way you could read in the current score and keep it?

#### matrixn

• Newbie
• Posts: 4
##### SpamAssassin MySQL patch
« Reply #17 on: November 26, 2008, 08:12:43 PM »
Greetings,

i have installed the patch on 0.2 beta RC and i have created database, the spam module writes the data in the database but i dont known how to make spamassasin to access the database and read the settings for every user.

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #18 on: November 27, 2008, 07:38:53 AM »
hi, the internet is your friend... UsingSQL - Spamassassin Wiki
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #19 on: November 27, 2008, 03:36:03 PM »
New BETA version based on SVN version 2090

Attached is a beta version of the SpamAssassin MySQL patch built against SVN version 2090.

This version includes a new config option to set the step size by which the spam score options are incremented.

This version also includes a synchronisation function to copy any inserts, updates or deletes from the Roundcube address book to the SpamAssassin whitelist.

NOTE: The synchronisation function requires your SpamAssassin prefs table includes a field in which the contact_id from the Roundcube address book can be stored, the default value for this field (used for any address not in the address book should be -1). For example:
Code: [Select]
 ALTER TABLE userpref ADD contact_id INT NOT NULL DEFAULT '-1'; 

I have only just finished this code and its kinda late here so there could be a few bugs which is why I have called it beta, please report any any issues to this thread and I will try and fix them.

*FIXED a bug with data typing that sometimes stopped the correct spam score from being selected on page load, updated patch attached.

*UPDATE added the ability to configure the order of the fieldsets in the UI and also added a bit of text to tell users when whitlist/addressbook sync is enabled. New file attached  sauserprefs.beta2.r2099.patch includes these changes, built against SVN 2099 and will work with 2101.

**UPDATE 20090102**
I have added a new version of the patch, sauserprefs.BETA.0_2.patch. This version works with the 0.2 stable release of RoundCube. I have also made a number of improvements to the script.
NOTE: the config variable to change the order of the fieldsets added in the last version of this patch has been remove, the order of the field sets is now controlled in the template file (skins/default/templates/sauserprefs.html)

**UPDATE 20090108**
sauserprefs.r2198.patch - works with the SVN version
« Last Edit: January 13, 2009, 08:39:28 AM by JohnDoh »
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### pyther24

• Newbie
• Posts: 7
##### SpamAssassin MySQL patch
« Reply #20 on: November 28, 2008, 10:59:51 AM »
I installed the patch, but I'm not sure how to add the sql code. I don't hav e atable called userpref.

How do I go about applying the sql update? I'm a sql noob

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #21 on: November 28, 2008, 12:44:09 PM »
The field needs to be added to the table which stores your SpamAssasin settings so 'userpref' should be what ever that table is called. Do you have phpmyadmin? login and goto the database which contains the SA prefs table then select that table and add the field.

sorry its a bit of a rubbish explaination i know but i am not quite sure how to explain it.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### mdr

• Jr. Member
• Posts: 12
##### Thanks JohnDoh
« Reply #22 on: November 28, 2008, 07:56:57 PM »
Thanks JohnDoh for the update.  This seems to work great.   I've doing some testing and everything seems to be working great.  No problems.

The only change I would like to ask for, is to be able to change the order of the sections.  I would like to put the white/black list section higher on the page so my users can understand what they need to do better.  I have had a few questions on this.

Thanks again for the update!
-Matt

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #23 on: November 30, 2008, 05:54:51 AM »
Hi Matt. Great idea! I have added it to the latest version of the patch - see my post above about the new beta version ... you want beta2.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### mdr

• Jr. Member
• Posts: 12
##### Nice Update
« Reply #24 on: November 30, 2008, 11:19:10 PM »
This update looks like (Beta2)  The added feature works well for me, thanks.

Everything is working well for me, but I haven't tried the auto whitelist feature yet.

Thanks
-Matt

#### Sava

• Newbie
• Posts: 3
##### SpamAssassin MySQL patch
« Reply #25 on: December 01, 2008, 03:40:06 PM »
Hi! What you can say about Amavisd-mysql and this patch? May be MySQL schema in clear SpamAssassin and amavisd are similar?

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #26 on: December 02, 2008, 04:38:54 AM »
I know nothing about amavis so i have nothing to say about it and this patch.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### rosali

• Hero Member
• Posts: 2,533
##### SpamAssassin MySQL patch
« Reply #27 on: December 03, 2008, 02:06:50 PM »
Please, would you be so kind and post the necessary icons (.png). I don't know a Win32 application to handle unix patch files.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

#### JohnDoh

• Global Moderator
• Hero Member
• Posts: 2,385
##### SpamAssassin MySQL patch
« Reply #28 on: December 04, 2008, 03:23:18 AM »
Hi, No problem, images attached. Patch for Windows can read and apply the patch file... something like
Code: [Select]
c:\path\to\patch.exe --binary -ul -d c:\path\to\roundcubemail\ -p1 < c:\path\to\patch`
but it doesn't seem to like the images :/
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

#### rosali

• Hero Member
• Posts: 2,533
##### SpamAssassin MySQL patch
« Reply #29 on: December 04, 2008, 05:42:36 PM »
Thanks, great hint ...
Regards,
Rosali
__________________
MyRoundcube Project (commercial)