[Exim] A little help with lookups

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Robert Gomulka
Dátum:  
Címzett: exim-users
Tárgy: [Exim] A little help with lookups
Hello !
I have done some things to integrate my system with postgres - I mean to keep
users in database. I'd like to hear your opinion about my exim configuration,
because I am not sure of some things.

#aliasmail - view, which gives domain/alias/name information

hide pgsql_servers = ...

local_domains = localhost:serwis:pgsql;SELECT domain FROM domains

virtual_deliver:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
file = /var/spool/mail/${domain}/${local_part}
# I prefer to deliver to /var/spool/mail/${domain}/$real_user_name, but don't
want to add another postgresql lookup
# Appropriate lookup would be like:
# "${lookup pgsql{select name from aliasmail where domain='$domain' and
alias='$local_part'}{$value}fail}", but I want to avoid another lookup

virtual_alias:
driver=aliasfile
domains="pgsql;select domain from domains where domain='$key'"
search_type=pgsql
query="select name from aliasmail where alias='$local_part' and
domain='$domain'"
transport=virtual_deliver
user=${lookup pgsql{SELECT name FROM aliasmail WHERE domain='$domain' AND
alias='$local_part'}{$value}fail}
#here you can see that I peek twice into database, but have no idea how to
set username in one query

I just want to simplify my configuration. And one important thing - my users
aren't "pure virtual". They all are system users, kept in database, and
extracted from that with nss_pgsql. So I can run delivery process under their
uid/gid.

Thank you in advance
Robert

PS.
Yes, I read posts above, but they are very similar to mine.