Roundcube Community Forum

 

SpamAssassin MySQL Plugin

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

Previous topic - Next topic

tparvais

Hello

Is it possible to get this plugin working fine with "spamassassin in a box" from jam software ?

This is one of the unique spamassassin package I found that is working fine on windows 2008 with Hmailserver.

Spamassassin in a box seems to be customizable, but I never do any spamassasin specific config local.cf etc... I'm a bit lost

Thank you


JohnDoh

if settings are stored in a mysql database in the normal spamassassin way then it should work, if not it will not.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

garyg

#122
Hello everyone.

I searched the forum but it seems I am the only one to get the following issue (well, actually I am not, my whole company gets the same issue). On my firefox and Chromium, when I use sauserprefs for inserting a record into the database, I get a javascript error, although the plugin says that my changes were saved. Of course, in the SQL database, nothing gets recorded. My RoundCube version is 0.8.2. SAuserprefs version is the last one (4th of October 2012).

I use the form to add an email address "garybaldi.baldi <at> laposte.net" to the blacklist (notice that the first entry "garybaldi" was added manually in the database. thats means SAuserprefs does not have any problem with connecting to the database):


I save my changes. The email address in the field disappears and SAuserprefs tells me "Successfully changed spam settings". Obviously, the email address does not get recorded in the database.


When I immediately check Javascript error console on Firefox, here is what I get. Same thing happens with Chromium. Is there a problem with the iframe variables or something ? I strongly suspect some sort of javascript problem with preference-frame iframe variables. I am no javascript coder, so it's a bit long for me to debug that. Do you guys have any clue on that issue ?


Thank you for your help.

Gary

JohnDoh

hi, this was because of a change in the core which occured one day before 0.8.2 came out. there is a fix in the files here https://github.com/JohnDoh/Roundcube-Plugin-SpamAssassin-User-Prefs-SQL/tree/rc-0.8
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

garyg

Thank you JohnDoh, problem is fixed !

schickel007

#125
Hi,

after installing (with mysql-database) and activating this plugin, my userpref will not be use. My change in the Spam-Plugin is in the databas, but retrievieng mails will always get the default score.

In mail log is also no error.

What must be done, that spamd use the user-pref and not the default-score?

What infos do you need, for debug?

Using:
Roundcube 0.8.4
SpamAssassin Server version 3.3.2                                                                                                                                     
  running on Perl 5.12.4                                                                                                                                             
  with SSL support (IO::Socket::SSL 1.44)                                                                                                                             
  with zlib support (Compress::Zlib 2.02401)


JohnDoh

did you setup your spamassassin to read user prefs from the database? http://wiki.apache.org/spamassassin/UsingSQL
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

schickel007

Yes I did.

/etc/spamassassin/sql.cf:

user_scores_dsn                 DBI:mysql:spamassassin:localhost:3306
user_scores_sql_password        password
user_scores_sql_username        username
user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username = CONCAT('%',_DOMAIN_) ORDER BY username ASC


Database is also like described in the post from spamassassin.

JohnDoh

there are instructions on that page for how to run spamassassin in debug mode so you can see what it is doing, or you could try asking the spamassin community for help. sounds like not a roundcube/pluing issue to me.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

oldschool

Hi!

First of all you need a running spamassassin-mysql-mailsystem.
Be warned: This is NOT an easy process.

The next step is to combine the system from above with the rc-plugin.


Rgds.

schickel007

#130
One thing I must tell you:

I'm on Gentoo. I run amavisd-new for many years and the only reason I try Spamassassin is the plugin in roundcube.

MySQL and Apache is working very well. Changes I made in the Plugin will be stored in database. But the only thing, what is really important: Spamd is connecting to database but don't use the userprefs. My spamd is starting with the right options to use mysql:

/etc/conf.d/spamd:
SPAMD_OPTS="-q -u nobody -m 5 -c -H"

I've tested also some postfix-configs (also from http://wiki.apache.org/spamassassin/IntegratedSpamdInPostfix - the part with MySQL).
master.cf:
smtp    inet    n - n - - smtpd -o content_filter=spamassassin
spamassassin unix  -       n       n       -       -       pipe
             flags=Rq user=nobody argv=/usr/bin/spamc -u ${user} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

main.cf:
spamassassin_destination_recipient_limit = 1

I'll search and debug and try to get a solution.....

schickel007

Ok, I see something:

Dez  3 11:30:19.648 [13744] info: spamd: connection from localhost [127.0.0.1] at port 35907
Dez  3 11:30:19.653 [13744] info: spamd: handle_user unable to find user: 'schickel'

The username is not schickel only. It is the whole mailadress.... So, it seems, that the mysql-query is wrong.

schickel007

I#ve got it:

in postfix master.cf:
spamassassin unix  -       n       n       -       -       pipe
flags=Rq user=nobody argv=/usr/bin/spamc -u ${recipient} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

-u ${recipient} and not -u ${user}

Now I can go on

oldschool

Quote from: schickel007 on December 03, 2012, 08:06:42 AM
I#ve got it:

in postfix master.cf:
spamassassin unix  -       n       n       -       -       pipe
flags=Rq user=nobody argv=/usr/bin/spamc -u ${recipient} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

-u ${recipient} and not -u ${user}

Now I can go on

Niiice!
;)

edsonmendes

Hi,

I have a mail server running on FreeBSD-Postfix-MySQL-SpamAssassin-Maia-Dovecot-Pear + Roundcube0.8.6.
It is so difficult to deploy pluguin sauserprefs 0.8.6 with settings Spamassassin + Mayan.

Would anyone help me?