Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: it2 on March 19, 2012, 11:13:46 AM

Title: sauserprefs aka SpamAssassin User Prefs SQL not working in a virtual alias setup
Post by: it2 on March 19, 2012, 11:13:46 AM
Hi there,

I have to set up the SA Plugin tp work in Roundcube and Sapamassassin with stored user_prefs in mysql. After installing and configuring, I see that the plugin make the following statement to the DB:


INSERT INTO sa_user_prefs (vuser_email, preference, value) VALUES ('username', 'ok_locales', 'zh en ja ko ru th')]


Looks fine, but in our db the username is not in table, cause this is a virtual_alias. The field must be a emailaddress.

Does anyone know how to change the INSERT Value from "username" to "users mailaddress"?

Thanks
Tom
Title: Re: sauserprefs aka SpamAssassin User Prefs SQL not working in a virtual alias setup
Post by: it2 on March 23, 2012, 08:03:18 AM
hi again,

maybe my question is not realy clear, so I will explain it again:

In my database table "sa_user_prefs" is like this:


=============================
| id | vuser_email | preference | value |
=============================


The field "id" is not interessting here. "vuser_email" is filled up wirh mail-addresses, "preference" and "value" with sa stuff.

Unfortunately the sql statement dont use a mailadress for "vuser_email", but an username.

Now I need to know, if there is a possibility to conf sauserprefs to use an email not an username in steh sql.

Does anybody know how to handle that?

Best regards
Tom

EDIT: We use usernames for roundcube login. Maybe this is the point! But this Setup cannot be changed, because this is a virtual_users setup. Maybe it is possible to transform username to mailadress with a variable change? Does someone know in wich roundcube variable the mailadress goes?
Title: Re: sauserprefs aka SpamAssassin User Prefs SQL not working in a virtual alias setup
Post by: rosali on March 23, 2012, 12:32:20 PM
http://trac.roundcube.net/wiki/Plugin_Hooks#email2user

http://trac.roundcube.net/wiki/Plugin_Hooks#user2email

I'm not sure if you are familiar with PHP and the Roundcube Plugin API. But these two hooks could be used to archieve what you want.
Title: Re: sauserprefs aka SpamAssassin User Prefs SQL not working in a virtual alias setup
Post by: JohnDoh on March 24, 2012, 04:37:59 AM
this change makes it possible to configure the username

https://github.com/JohnDoh/Roundcube-Plugin-SpamAssassin-User-Prefs-SQL/commit/e649df789cbc0c647ecc01ebcf458ebf13b4919a