hi,

i want to integrate my whitelist in a mysql database.

i setup the ~/.tmda/config like the first example on
http://www.tmda.net/config-vars.html#DB_CONFIRM_APPEND

this causes the following error in ~/.tmda/logs/debug:
File "/usr/local/tmda-0.92/TMDA/Util.py", line 752, in db_insert
  DatabaseError = getattr(dbmodule, 'DatabaseError')
  AttributeError: 'module' object has no attribute 'DatabaseError'

the lookup into the whitelist based on mysql works fine in the incoming
filter

here is my configuration:
(i set it up with virtual users an maildrop!)

~/.tmda/config:

MAIL_TRANSFER_AGENT = "postfix"
RECIPIENT_DELIMITER = "+"
DELIVERY = "~/Maildir/"
CONFIRM_APPEND = os.path.expanduser("~/.tmda/lists/confirmed")
LOGFILE_DEBUG = os.path.expanduser("~/.tmda/logs/debug")
LOGFILE_INCOMING = os.path.expanduser("~/.tmda/logs/incoming")
LOGFILE_OUTGOING = os.path.expanduser("~/.tmda/logs/outgoing")
HOSTNAME = "mydomain.com"
import MySQLdb
DB_CONNECTION =
MySQLdb.connect(db='maildb',host='localhost',user='username',passwd='******')
DB_CONFIRM_APPEND = """INSERT INTO tmda_whitelist (user_email, address)
VALUES (%(recipient)s, %(sender)s)"""
---

next problem (not important...)

~/.tmda/filters/incoming:

from-sql -addr_column=address "SELECT address FROM tmda_whitelist WHERE
user_email = %(recipient)s" AND %(criteria)s LIMIT 1" accept

this works fine, but when i put this sql into the ~/.tmda/config and
include it in the incoming filter, it doesn't.

example:

~/.tmda/config:
SQL_WHITELIST = """SELECT address FROM tmda_whitelist WHERE user_email =
%(recipient)s" AND %(criteria)s LIMIT 1"""

~/.tmda/filters/incoming:
from-sql -addr_column=object_email "$(SQL_WHITELIST)" accept



- stefan

-- 

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to