Hi
I known this is First world problem. I have a questions about postfix transport. I have two serwer:
1)smtp-n1 - default
2)smtp-n2

In smtp-nX i have this same query like:
postmap -q u...@domain1.ltd memcache:/etc/postfix/memcache_cache.cf
smtp-out

sql;
query =
SELECT IFNULL((SELECT transport_entity.name FROM domain_entity JOIN transport_entity ON domain_entity.transport_entity_id = transport_entity.id WHERE domain = '%d'), name) as transport_id FROM transport_entity;

what taks query doing
1)if found indywidual transport - send individual transport name
2)if not send default transport - send default transport for users who dont have individual

I use memcache
memcache_cache.cf:
...
backup = mysql:/etc/postfix/mysql.cf
ttl = 600
key_format = "vip:%d"
...

All user who log and send e-mail via smtp-n1 get default transport smtp-out
- thats ok. If admin via webpanel change default to smtp-out1 - all default send via smtp-out1

But if user log and send e-mail via smtp-n2 get default transport smtp-out - And I need to smart change this
like if ged default smtp-out change to smtp-out-backup name

or smething if returned from query smtp-outX - is "mask" to smtp-out-backup

I know I can do all this, it's easier to set the appropriate transport names in master.cf
Or create map pcre like...
/*./ smtp-out-backup

But I need thats in mysql.A poor database administrator is not willing to make any corrections or concessions.

something if SELECT IFNULL((SELECT transport_entity.name FROM domain_entity JOIN transport_entity ON domain_entity.transport_entity_id = transport_entity.id WHERE domain = '%d'), name) as transport_id FROM transport_entity;

change name to smtp-out-backup
I know it's overcomplicated etc but I need it
--

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to