Author Topic: Understanding sauserprefs global settings & mysql table entries  (Read 4617 times)

Offline insight

  • Newbie
  • *
  • Posts: 3
Hi,

I've not figured out how to correctly adjust the global / default settings for all users which have no personal entries in the userpref table when using the sauserprefs plugin:

My understanding is that mysql entries with username  $GLOBAL  will be used by default  but these global settings are not created in the mysql table. I set the default values in  config.inc.php  but those are just the default values when a user accesses the plugin and only if his entries differ from the default value they are saved in the database with his username.

But when amavis scans an email and does a database lookup for a username in table userpref and does not find the user, how could it use the default values from config.inc.php? I think the default values from config.inc.php have to be added to the table with $GLOBAL as username but should I do that by editing the mysql entries by hand?

I think I'm missing something, please enlighten me ;-)

Thanks

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,866
Re: Understanding sauserprefs global settings & mysql table entries
« Reply #1 on: March 29, 2015, 08:49:46 AM »
The purpose of the plugin is to let users control their settings. It does not manage the global settings - only reading them so it knows when a user sets something different.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline insight

  • Newbie
  • *
  • Posts: 3
Re: Understanding sauserprefs global settings & mysql table entries
« Reply #2 on: March 29, 2015, 12:33:18 PM »
Ok thanks for the answer, that explains what I was missing. I just found it a bit confusing that I have to set the actual default values in amavis then copy them into the config.inc.php so that the plugin knows what the default values actually are. If you mention that in the readme file of the plugin it would help during the setup.

It might also help to mention in the readme that the individual user values set via the plugin will be applied by amavis but that they are not reflected in the headers amavis adds to the scanned emails. I found it a bit strange that in the header amavis says  X-Spam-Status: No, score=-1.118 required=6.31   while the value of 6.31 is the default value from amavis.conf when a user actually has it set to 5 then amavis will mark a 5.1 email as spam but still have the 6.31  as required value in the header. I got really confused about that and thought the plugin wouldnt work while it actually did.

Thanks anyway, very helpful plugin
« Last Edit: March 29, 2015, 12:38:58 PM by insight »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,866
Re: Understanding sauserprefs global settings & mysql table entries
« Reply #3 on: March 30, 2015, 08:19:31 AM »
Quote
Ok thanks for the answer, that explains what I was missing. I just found it a bit confusing that I have to set the actual default values in amavis then copy them into the config.inc.php so that the plugin knows what the default values actually are. If you mention that in the readme file of the plugin it would help during the setup.

The plugin takes defaults from the database and from the config file becase Spamassassin can be configured with the defaults in the database, in the config file, or a mix of the two. There is no way for the plugin to read the config files so the defaults have to be set again in the plugin config to ensure it knows them all.

Quote
It might also help to mention in the readme that the individual user values set via the plugin will be applied by amavis but that they are not reflected in the headers amavis adds to the scanned emails. I found it a bit strange that in the header amavis says  X-Spam-Status: No, score=-1.118 required=6.31   while the value of 6.31 is the default value from amavis.conf when a user actually has it set to 5 then amavis will mark a 5.1 email as spam but still have the 6.31  as required value in the header. I got really confused about that and thought the plugin wouldnt work while it actually did.

That does not have anything to do with the plugin I think. I use regular Spamassessin not Amavis and the headers that it sets in the message are fine.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…