SA Bugzilla – Bug 5840
unable to use ldap+sql
Last modified: 2022-03-06 11:59:15 UTC
Hello guys! When I use ldap for user's scores & sql for bayes store I got following error (& nothing work at all, but there exists bug for this): config: failed to load user (user@domain.ltd) scores from SQL database: Can't connect to data source ldap://localhost:389/dc=domain,dc=ltd?spamassassin?sub?(|(mailalternateAddress=__USERNAME__)(mail=__USERNAME__)(mailForwardingAddress=__USERNAME__)), no database driver specified and DBI_DSN env var not set at /usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/Conf/SQL.pm line 125 spamd: service unavailable: Error fetching user preferences via SQL at /usr/local/bin/spamd line 2006, <GEN99> line 2. my config looks like: user_scores_dsn ldap://localhost:389/dc=domain,dc=ltd?spamassassin?sub?(|(mailalternateAddress=__USERNAME__)(mail=__USERNAME__)(mailForwardingAddress=__USERNAME__)) user_scores_ldap_username uid=spamd,ou=daemon,dc=domain,dc=ltd user_scores_ldap_password pass bayes_store_module Mail::SpamAssassin::BayesStore::SQL bayes_sql_dsn DBI:mysql:spamassassin:localhost:3306 bayes_sql_username spamd bayes_sql_password pass But I need to get scores from ldap (where stored all information about users) & store bayes/awl in sql. What I'm doing wrong? Why it's not possible? Can it be fixed? Thanks.
my run options: spamd_flags="-d -q --ldap-config -c -x -m 20 -u spamd"
Hey! Is anybody here? :(
It does seem that current code doesn't handle ldap and sql at the same time. If -q is enabled it will always try to load scores there through handle_user_sql if ($opt{'sql-config'} && !defined($current_user)) { unless (handle_user_sql('nobody')) { service_unavailable_error("Error fetching user preferences via SQL"); return 0; } } if ($opt{'ldap-config'} && !defined($current_user)) { handle_user_ldap('nobody'); }
Postponing into future, I don't think many people have this problem..