Bug 1222 - ConfSourceSQL: die if we cannot connect to SQL server
Summary: ConfSourceSQL: die if we cannot connect to SQL server
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 2.43
Hardware: All All
: P3 enhancement
Target Milestone: 3.0.0
Assignee: SpamAssassin Developer Mailing List
URL: http://horde.net/~jwm/software/misc/s...
Depends on:
Reported: 2002-11-22 11:04 UTC by John Morrissey
Modified: 2004-03-04 12:20 UTC (History)
1 user (show)

Attachment Type Modified Status Actions Submitter/CLA Status
john's patch patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description John Morrissey 2002-11-22 11:04:38 UTC
I've patched SpamAssassin so that spamd won't filter messages if a
user_scores_dsn is configured but is unavailable (spamd can't connect or some
other error occurs when fetching user prefs).

We're going to let our users specify their thresholds (required_hits) and
white/blacklists this way, but I found that these prefs could be ignored if the
SQL server is unavailable. For example, if a user has an e-mail address in his
whitelist, but the SQL server is unavailable when a message comes through from
that address, the user's prefs won't be applied (and he'll start hollering at
us). It's one of those situations where I'd rather err on the cautious side. :-)

If no rows are returned by the SQL query, it's seen as a success and processing
occurs normally (IOW, these changes only apply to hard errors).

I searched the archives and bug system a bit and couldn't find any discussion on
this; if it's already been hashed out, please be gentle. :-)
Comment 1 Justin Mason 2004-02-28 14:51:32 UTC
Created attachment 1803 [details]
john's patch

just attaching the patch in case john forgets about it and nukes the file on
his server ;)

This does seem like useful code.  Again, another patch for Mike ;)
Comment 2 Justin Mason 2004-02-28 14:52:09 UTC
Also -- there's a confirmed CLA for jwm.
Comment 3 Michael Parker 2004-03-03 08:05:09 UTC
Two questions:

1) Should the skipping of the check on hard error be configurable?

2) Should we apply this to the LDAP code as well?
Comment 4 Michael Parker 2004-03-04 21:20:12 UTC
Fixed in r7008, I did not implement for the ConfSourceLDAP code.