Hi all, I'm using the "from-sql" in my incoming filter file.  I have
used and have tested this successfully in one way (customizing the sql
for each email address), which I'll show in a moment, but the way I
want to use it (generic with TMDA defined variables) fails.  The way I
want to use 'from-sql' is to include the %(recipient)s variable.  And
according to the website this is possible
(http://wiki.tmda.net/FilterSources).  But whenever I try it never
works.  Finally I found out why, and I need your help figuring out how
to fix it.

In my filters/incoming filter file I have this line (and this one fails):
from-sql -addr_column=sender "SELECT sender FROM
vpopmail.tmda_whitelist WHERE %(criteria)s AND recipient=%(recipient)s
LIMIT 1" ok

And according to the above URL, that should work fine.  I know I have
a different -addr-column, but the reason they have that argument is so
that you can use your own addr-column name, so please don't think
that's the issue.  Now I want to use the query above so I don't have
to use a unique query for each user (like below).

If I change the 'from-sql' line to this customized query, it works great:
from-sql -addr_column=sender "SELECT sender FROM
vpopmail.tmda_whitelist WHERE %(criteria)s AND
recipient='[EMAIL PROTECTED]' LIMIT 1" ok

Hopefully you can see that the difference is that instead of using the
variable %(recipient)s, I put in the real email address of my user
account.  But I would prefer to have a more generic SQL query so it
doesn't have to be customized for each user.  And so that I can keep
it on one place (/etc/tmdarc) and not have to include it in each users
.tmda/config file.

So what I found out is, that when I use the %(recipient)s variable,
the sql query putting in "[EMAIL PROTECTED]" (mydomain.com is
substituted for my real domain):
SELECT sender FROM vpopmail.tmda_whitelist WHERE
sender='[EMAIL PROTECTED]' AND
recipient='[EMAIL PROTECTED]' LIMIT 1

Where is %(recipient)s getting "[EMAIL PROTECTED]" for the
recipient?  Is it something in qmail?  If I could find out where
TMDA/Python is getting this, perhaps I can find a way to get it setup
right.  Has anyone ever run into this?

Thanks for your help,
John
_____________________________________________
tmda-users mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to