You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2006/11/24 07:08:19 UTC

[Bug 5205] New: spamd ldap configuration with same time virtual-config-dir usage

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5205

           Summary: spamd ldap configuration with same time virtual-config-
                    dir usage
           Product: Spamassassin
           Version: 3.1.7
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: braun@sap.com


The idea of having the config in a ldap server, so that users can change their
config, without a local server account is great. But running spamd with none
local users, which still have their individual bayes databases but config in a
ldap server does not work, as the two options ldap-config and virtual-config-dir
are exclusive. So what would be great, is, that having the config in the ldap,
but still be able to use virtual-config-dir as data storage for the baayes and
auto-whitelist databases would be even better. 
I changed the code of spamd a little bit, so that exactly that works. So that I
can use the following command line options:
--virtual-config-dir="/spamassassin/users/%u" -x 
and configure the user_scores_dsn, user_scores_ldap_username,
user_scores_ldap_password entries in local.conf.

With the followinf small patch the following happens. If there is no user_prefs
file in the virtual config dir, it tries to find one in the ldap server.
But compared to the plian ldap-config option, if the config e.g. enables bayes
filtering, if still saved the users individual databses in the
virtual-config-dir. So I can have config in ldap but still individual users
databases. Best of two worlds so to say.

The small patch is, which works for me is:

*** spamd       Mon Nov 20 01:41:05 2006
--- /usr/perl/bin/spamd Wed Nov 22 04:37:19 2006
***************
*** 1818,1832 ****
      $userdir   = $dir;
      $prefsfile = $dir . '/user_prefs';
  
-     # Log that the default configuration is being used for a user.
-     info("spamd: using default config for $username: $prefsfile");
    }
  
    if ( -f $prefsfile ) {
! 
      # Found a config, load it.
      $spamtest->read_scoreonly_config($prefsfile);
    }
  
    # assume that $userdir will be a writable directory we can
    # use for Bayes dbs etc.
--- 1821,1838 ----
      $userdir   = $dir;
      $prefsfile = $dir . '/user_prefs';
  
    }
  
    if ( -f $prefsfile ) {
!     # Log that the default configuration is being used for a user.
!     info("spamd: using default config for $username: $prefsfile");
      # Found a config, load it.
      $spamtest->read_scoreonly_config($prefsfile);
    }
+   else {
+     info("ldap: entering handle_user_ldap($username)");
+     $spamtest->load_scoreonly_ldap($username);
+   }
  
    # assume that $userdir will be a writable directory we can
    # use for Bayes dbs etc.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.