Am 25.04.2011 15:28, schrieb Victor Duchovni:
> On Mon, Apr 25, 2011 at 03:16:42PM +0200, Reindl Harald wrote:

>> sometimes it would be really useful to build a query
>> depending on sender AND rcpt whis is AFAIK not possible
> 
> Not possible, because Postfix table driven mechanisms (virtual(5),
> generic(5), access(5), ...) are implemented over a key/value table
> abstraction layer that supports multiple implementations:
> 
>     - CDB
>     - Berkeley DB "hash" and "btree"
>     - Legacy DBM
>     - LDAP
>     - PgSQL
>     - MySQL
>     - SQLite
>     ...
> 
> In all cases the table driven mechanisms just see a key/value table, and
> don't know anything about the internal capabilities of the table driver.
> In addition, tables don't know the semantics of the keys or values.

you missunderstand me

what i mean has nothing to do with the table
i mean the options build the query

select transport from table where mydestination='%s' and 
mydestination!='sender_domain';
the AND is not possible to define exceptions

this is a totally other level i think because the result is
the replacement for the hash-table
_______________________

real life example:

cat mysql-sender_relay_hosts.cf
user          = relayhost
password      = ****
dbname        = dbmail
hosts         = inet:10.0.0.15:3306 inet:10.0.0.120:3307
query         = select transport from dbma_sender_relay where email='%s';

cat mysql-sender_relay_hosts_auth.cf
user          = relayhost
password      = ****
dbname        = dbmail
hosts         = inet:10.0.0.15:3306 inet:10.0.0.120:3307
query         = select concat(username, ':', password) from dbma_sender_relay 
where email='%s';

it is no problem to change the sql in "mysql-sender_relay_hosts.cf" with a 
subquery
to exclude local-targets but "mysql-sender_relay_hosts_auth.cf" will 
authenticate
with user/pwd from the relayhost because there is no way to exclude here
too the rcpt



Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to