-------- Original-Nachricht --------
> Datum: Tue, 21 Jul 2009 18:34:39 +0200
> Von: Julien Valroff <jul...@kirya.net>
> An: dspam-devel@lists.sourceforge.net
> Betreff: [Dspam-devel] DSPAM preferences

> Hi,
> 
> Following to Stevan's suggestion in the discussion around sf bug
> #2824760:
> I would say that the logic regarding preferences should be:
> Priority 1) User preferences
> Priority 2) Use group preferences
> Priority 3) Use default preferences (uid 0)
> Fallback) Use preferences from dspam.conf
> 
> I take the leave to ask the following: I have never really experimented
> with default.prefs files.
> 
> Would someone be so kind and explain the following part of admin.cgi:
>   if ($FORM{'username'} eq "") {
>     $FILE = "./default.prefs";
>     if ($CONFIG{'PREFERENCES_EXTENSION'} != 1 && ! -l
> "$CONFIG{'DSPAM_HOME'}/default.prefs") {
>       $DATA{'ERROR'} = "<em>WARNING:</em> " .
>         "These default preferences will not be loaded by DSPAM, but only
> by ".
>         " the CGI interface when a user initially sets up their
> preferences. ".
>         "To have DSPAM override its configuration with these default ".
>         "preferences, symlink $CONFIG{'DSPAM_HOME'}/default.prefs to the
> ".
>         "default.prefs file in the CGI directory.<BR><BR>";
>     }
> 
The code is loading default.prefs from the root where dspam.cgi/admin.cgi is 
installed. But it checks first if the file is a symlink and if it so it will 
warn you that the one it is going to load (the one in the root of 
dspam.cgi/admin.cgi) could be different then the one used by the DSPAM binary 
(since the binary will not read the web root but the default.prefs found in 
DSPAM HOME).


> What are the default preferences? Stevan refers to uid 0,
>
uid 0 is used as the default when loading preferences with the preference 
extension.


> are they only
> used when using preferences-extension?
>
Yes.


> If not using them, then
> default.prefs is used?
> 
Yes and no. The absolute last fallback is dspam.conf. If default.prefs are not 
there then dspam.conf wins.


Using uid 0 with the preference extension can be very handy. Consider this 
scenario here:
- You run a pure opt-in setup
- You want to set certain preferences for all but allow users to overwrite them

Then I would do the whole setup that way:
+-----+------------------------+---------+
| uid | preference             | value   |
+-----+------------------------+---------+
|   0 | dailyQuarantineSummary | off     |
|   0 | enableBNR              | on      |
|   0 | enableWhitelist        | on      |
|   0 | fallbackDomain         | off     |
|   0 | ignoreGroups           | off     |
|   0 | ignoreRBLLookups       | off     |
|   0 | makeCorpus             | on      |
|   0 | optIn                  | off     |
|   0 | optOut                 | on      |
|   0 | optOutClamAV           | on      |
|   0 | processorBias          | on      |
|   0 | showFactors            | off     |
|   0 | signatureLocation      | headers |
|   0 | spamAction             | tag     |
|   0 | spamSubject            | [SPAM]  |
|   0 | statisticalSedation    | 5       |
|   0 | storeFragments         | off     |
|   0 | tagNonspam             | off     |
|   0 | tagSpam                | off     |
|   0 | trainingMode           | TOE     |
|   0 | trainPristine          | off     |
|   0 | whitelistThreshold     | 10      |
+-----+------------------------+---------+

And preferences for user where you opt-in the user as soon you create a mailbox 
for him would look like this:
+-----+------------+-------+
| uid | preference | value |
+-----+------------+-------+
|   6 | optIn      | on    |
|   6 | optOut     | off   |
+-----+------------+-------+

While another user who went into the Web UI and changed his settings to fit 
more to his needs would have this here:
+-----+------------------------+---------+
| uid | preference             | value   |
+-----+------------------------+---------+
|   4 | dailyQuarantineSummary | off     |
|   4 | enableBNR              | on      |
|   4 | enableWhitelist        | on      |
|   4 | optIn                  | on      |
|   4 | optOut                 | off     |
|   4 | showFactors            | off     |
|   4 | signatureLocation      | headers |
|   4 | spamAction             | tag     |
|   4 | spamSubject            | [SPAM]  |
|   4 | statisticalSedation    | 1       |
|   4 | trainingMode           | TOE     |
+-----+------------------------+---------+

For that user (uid 4) and any other user DSPAM is loading his preferences and 
then merge them with the default (uid 0) but NOT overwriting user set 
preferences. The result would look like this for user with uid 4:
+-----+------------------------+---------+
| uid | preference             | value   |
+-----+------------------------+---------+
|   4 | dailyQuarantineSummary | off     |
|   4 | enableBNR              | on      |
|   4 | enableWhitelist        | on      |
|   0 | fallbackDomain         | off     |
|   0 | ignoreGroups           | off     |
|   0 | ignoreRBLLookups       | off     |
|   0 | makeCorpus             | on      |
|   4 | optIn                  | on      |
|   4 | optOut                 | off     |
|   0 | optOutClamAV           | on      |
|   0 | processorBias          | on      |
|   4 | showFactors            | off     |
|   4 | signatureLocation      | headers |
|   4 | spamAction             | tag     |
|   4 | spamSubject            | [SPAM]  |
|   4 | statisticalSedation    | 1       |
|   0 | storeFragments         | off     |
|   0 | tagNonspam             | off     |
|   0 | tagSpam                | off     |
|   0 | trainPristine          | off     |
|   4 | trainingMode           | TOE     |
|   0 | whitelistThreshold     | 10      |
+-----+------------------------+---------+

And for user with uid 6 it will look like this:
+-----+------------------------+---------+
| uid | preference             | value   |
+-----+------------------------+---------+
|   0 | dailyQuarantineSummary | off     |
|   0 | enableBNR              | on      |
|   0 | enableWhitelist        | on      |
|   0 | fallbackDomain         | off     |
|   0 | ignoreGroups           | off     |
|   0 | ignoreRBLLookups       | off     |
|   0 | makeCorpus             | on      |
|   6 | optIn                  | on      |
|   6 | optOut                 | off     |
|   0 | optOutClamAV           | on      |
|   0 | processorBias          | on      |
|   0 | showFactors            | off     |
|   0 | signatureLocation      | headers |
|   0 | spamAction             | tag     |
|   0 | spamSubject            | [SPAM]  |
|   0 | statisticalSedation    | 5       |
|   0 | storeFragments         | off     |
|   0 | tagNonspam             | off     |
|   0 | tagSpam                | off     |
|   0 | trainingMode           | TOE     |
|   0 | trainPristine          | off     |
|   0 | whitelistThreshold     | 10      |
+-----+------------------------+---------+


That is pretty much what "dspam_admin aggregate preference <user>" does but it 
does it regardless of the presence of the preference extension.



> Cheers,
> Julien
> 
// Steve
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

------------------------------------------------------------------------------
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to