Author Topic: sauserprefs aka SpamAssassin User Prefs SQL not working in a virtual alias setup  (Read 7658 times)

Offline it2

  • Newbie
  • *
  • Posts: 2
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:

Code: [Select]
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

Offline it2

  • Newbie
  • *
  • Posts: 2
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:

Code: [Select]
=============================
| 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?
« Last Edit: March 23, 2012, 08:08:51 AM by it2 »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦