I'm trying to set up TMDA to use MySQL for is list storage for the first
time.
In my incoming filter if I explicitly state the sql to use it works just
fine, but if I try to define a variable in my config file and then use it in
my incoming filter I get the following error:
===<Begin Error>===
Uncaught Python 2.2.3 Exception (Mon Apr 26 14:05:25 2004):
-----------------------------------------------------------
Traceback (most recent call last):
File "/usr/bin/tmda-filter", line 53, in ?
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/usr/bin/tmda-rfilter", line 891, in ?
main()
File "/usr/bin/tmda-rfilter", line 825, in main
infilter.read(Defaults.FILTER_INCOMING)
File "/usr/lib/python2.2/site-packages/TMDA/FilterParser.py", line 338, in
read
self.__parse(fp)
File "/usr/lib/python2.2/site-packages/TMDA/FilterParser.py", line 385, in
__parse
raise file.exception
ParsingError: Filter contains parsing errors:
/home/sentinel/.tmda/filters/incoming
[line 42]: "from-sql": missing or bogus <action> field
===<End Error>===
Here are the filter rules I'm using, the one that works is all on one line:
from-sql -addr_column=Address -action_column=Action "select Address, Action
from MyLists where ListName in ('WhiteList') and %(criteria)s order by
Action desc" ok
and the one that causes the above error is:
from-sql -addr_column=Address -action_column=Action "${SQL_WHITELIST}" ok
in my config file I have the following statement:
SQL_WHITELIST = """
select Address, Action
from MyLists
where ListName in ('WhiteList')
and %(criteria)s
order by Action desc"""
It spans 6 lines as shown, I've also tried with it all on one line in case
it had anything to do with line breaks.
Any help on this would be apreciated. I have no idea why it works when I
put the entire sql script in the filter but does not work when I try using a
variable.
Thanks for any help,
Dave
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users