NAME
VUser::SpamAssassin::SQL::Userprefs - vuser SpamAssassin SQL user preferences extension
DESCRIPTION
VUser::SpamAssassin::SQL::Userprefs is an extension to vuser that allows one to view and modify users' SpamAssassin preferences in an SQL database.
CONFIGURATION
[vuser]
extensions = SpamAssassin::SQL::Userprefs
[Extension SpamAssassin::SQL::Userprefs]
# User scores database username and password.
# The DSN's here are in the same format as defined in the sql/README*
# files in the SpamAssassin package.
# This user needs select, insert and delete permissions.
# If the dsn is not set, the connection from SpamAssassin::SQL.
#dsn = dbi:mysql:localhost
#username = sa
#password = a-password
## SQL Queries
# Here you define the queries used to add, modify and delete users and
# attributes. There are a few predefined macros that you can use in your
# SQL. The values will be quoted and escaped before being inserted into
# the SQL.
# %u => username
# %o => option
# %v => value
# %-option => This will be replaced by the value of --option passed in
# when vuser is run.
# Add a preference to the database
add_query = INSERT into userpref set username = %u, preference = %o, value = %v
# Modify a value in the database
mod_query = UPDATE userpref set value = %v where username = %u and preference = %o
# Delete a preference for a user
del_query = DELETE from userpref where username = %u and preference = %o
# Delete all preferences for a user
delall_query = DELETE from userpref where username = %u
# Get the user's preferences
# Fixed columns:
# 1 username
# 2 preference
# 3 value
show_query = SELECT username,preference,value from userpref where username = %u
BUGS
VUser::SA::SQL::Userprefs doesn't handle preferences with multiple values (ex. blacklist_from) very well. It can't add them and attempting to modify them will change all of the values unless you contruct the query very carefully.
AUTHOR
Randy Smith <perlstalker@vuser.org>
LICENSE
This file is part of VUser-SpamAssassin-SQL.
VUser-SpamAssassin-SQL is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
VUser-SpamAssassin-SQL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VUser-SpamAssassin-SQL; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA