Prev: relay help
Next: From: header correctness
From: Victor Duchovni on 29 Jan 2010 12:49 On Fri, Jan 29, 2010 at 06:41:48PM +0100, Robert Schetterer wrote: > >> smtpd_sender_login_maps = hash:/etc/postfix/sasl_senders > >> > >> pico /etc/postfix/sasl_senders > >> > >> @domain.de username > >> > >> which works as desired > > > > As documented, in indexed files the first non-whitespace token is the > > lookup *key*, and the remainder of the (possibly "folded") line is > > the *value*. > > > > $ postmap -q "@domain.de" hash:/etc/postfix/sasl_senders > > username > > sorry viktor, i dont understand, perhaps my english leaks here > would you like to say that this cannot be done with sql? Nothing of the sort. Just create an SQL query that returns ONLY the lookup value and NOT the key. $ postmap -q "key" mysql:/etc/postfix/mumble.cf value This is equivalent to a source file for indexing via postmap for "hash", "btree", "cdb", ... containing: # Lookup key Lookup value key value Postfix uses the key to retrieve the value. You have royally confused yourself into a misguided belief that the lookup key needs to be returned by the query, just because that's what you see in the *source* files used by postmap(1) to construct simple indexed tables. In those tables too, the lookup result is just the value. -- Viktor. P.S. Morgan Stanley is looking for a New York City based, Senior Unix system/email administrator to architect and sustain our perimeter email environment. If you are interested, please drop me a note.
From: Robert Schetterer on 29 Jan 2010 13:37
Am 29.01.2010 18:49, schrieb Victor Duchovni: > On Fri, Jan 29, 2010 at 06:41:48PM +0100, Robert Schetterer wrote: > >>>> smtpd_sender_login_maps = hash:/etc/postfix/sasl_senders >>>> >>>> pico /etc/postfix/sasl_senders >>>> >>>> @domain.de username >>>> >>>> which works as desired >>> >>> As documented, in indexed files the first non-whitespace token is the >>> lookup *key*, and the remainder of the (possibly "folded") line is >>> the *value*. >>> >>> $ postmap -q "@domain.de" hash:/etc/postfix/sasl_senders >>> username >> >> sorry viktor, i dont understand, perhaps my english leaks here >> would you like to say that this cannot be done with sql? > > Nothing of the sort. Just create an SQL query that returns ONLY the > lookup value and NOT the key. > > $ postmap -q "key" mysql:/etc/postfix/mumble.cf > value > > This is equivalent to a source file for indexing via postmap for "hash", > "btree", "cdb", ... containing: > > # Lookup key Lookup value > key value > > Postfix uses the key to retrieve the value. You have royally confused > yourself into a misguided belief that the lookup key needs to be returned > by the query, just because that's what you see in the *source* files used > by postmap(1) to construct simple indexed tables. In those tables too, > the lookup result is just the value. > Hi Viktor, what i wanna goal is having a sql query that matches the username ( which in my case is equal to sasl_auth and email address ) and allready works, and a special look up in case the username is in another table called domain_admins to allow these users send mail for all mail adresses in their domain this is for some dummy customers which have broken boxes need to relay all addresses of their domain only by the one authed domain admin user the layout sql superadmin,domainadmin,user are from postfixadmin i tried to use an additional hash table to the norme user sql query , but this fails with existing user as all queries are honored, so an overide of the normal user sql query with hash table isnt possible, therefor i came up with the idea to build same table with sql query as in hash table i now understand whats your meaning with key so i will try to fix the query but as iam now sql guru i dont know if i cant goal this -- Best Regards MfG Robert Schetterer Germany/Munich/Bavaria |