Author Topic: SpamAssassin MySQL Plugin  (Read 100405 times)

tparvais

  • Guest
Re: SpamAssassin MySQL Plugin
« Reply #120 on: July 20, 2012, 06:18:41 PM »
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


Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,855
Re: SpamAssassin MySQL Plugin
« Reply #121 on: July 21, 2012, 07:14:17 AM »
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…

Offline garyg

  • Newbie
  • *
  • Posts: 2
Re: SpamAssassin MySQL Plugin
« Reply #122 on: October 19, 2012, 05:59:54 AM »
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
« Last Edit: October 19, 2012, 06:12:47 AM by garyg »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,855
Re: SpamAssassin MySQL Plugin
« Reply #123 on: October 19, 2012, 10:38:26 AM »
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…

Offline garyg

  • Newbie
  • *
  • Posts: 2
Re: SpamAssassin MySQL Plugin
« Reply #124 on: October 23, 2012, 03:43:05 AM »
Thank you JohnDoh, problem is fixed !

Offline schickel007

  • Newbie
  • *
  • Posts: 6
Re: SpamAssassin MySQL Plugin
« Reply #125 on: November 30, 2012, 10:42:35 AM »
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)

« Last Edit: November 30, 2012, 10:44:35 AM by schickel007 »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,855
Re: SpamAssassin MySQL Plugin
« Reply #126 on: December 01, 2012, 02:42:30 AM »
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…

Offline schickel007

  • Newbie
  • *
  • Posts: 6
Re: SpamAssassin MySQL Plugin
« Reply #127 on: December 01, 2012, 10:49:27 AM »
Yes I did.

/etc/spamassassin/sql.cf:
Code: [Select]
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.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,855
Re: SpamAssassin MySQL Plugin
« Reply #128 on: December 02, 2012, 06:49:47 AM »
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…

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
Re: SpamAssassin MySQL Plugin
« Reply #129 on: December 02, 2012, 09:24:56 AM »
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.

Offline schickel007

  • Newbie
  • *
  • Posts: 6
Re: SpamAssassin MySQL Plugin
« Reply #130 on: December 03, 2012, 05:50:55 AM »
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.....
« Last Edit: December 03, 2012, 06:08:40 AM by schickel007 »

Offline schickel007

  • Newbie
  • *
  • Posts: 6
Re: SpamAssassin MySQL Plugin
« Reply #131 on: December 03, 2012, 06:34:41 AM »
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.

Offline schickel007

  • Newbie
  • *
  • Posts: 6
Re: SpamAssassin MySQL Plugin
« Reply #132 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

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
Re: SpamAssassin MySQL Plugin
« Reply #133 on: December 03, 2012, 05:32:31 PM »
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!
;)

Offline edsonmendes

  • Newbie
  • *
  • Posts: 2
FreeBSD-Postfix-MySQL-SpamAssassin-Maia-Dovecot
« Reply #134 on: April 19, 2013, 09:07:08 AM »
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?