Bug 7029 - custom query to bayes username -> id lookup
Summary: custom query to bayes username -> id lookup
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-31 08:16 UTC by Marcel Asio
Modified: 2014-03-31 08:16 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
Patch for proposed change which adds a config param. text/plain None Marcel Asio [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Asio 2014-03-31 08:16:47 UTC
Created attachment 5195 [details]
Patch for proposed change which adds a config param.

I'm doing a setup where I'm going to put spamassassin  checks before the delivery of the mail, and at this stage the username of receiving user is not know but only the email address.

The problem with this approach is that the query spamassassin uses for looking up the id in bayes_vars expects username. So I would like to make a change to the code that adds a config option where a custom query can be defined. Code for this change is attached as a patch. 

This would allow me to use this query for lookup:
  SELECT id FROM bayes_vars WHERE username = spam_user(?)

Instead of the hardcoded one:
  SELECT id FROM bayes_vars WHERE username = ?