[Exim] PostgreSQL & Aliassing Again

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Sander Smeenk
Dátum:  
Címzett: exim-users
Tárgy: [Exim] PostgreSQL & Aliassing Again
Hey,

I have this director that handles aliases from my pgsql database:

| system_aliases:
| driver = redirect
| allow_defer
| allow_fail
| data = ${lookup pgsql{SELECT destination FROM exim_user_aliases WHERE lower(localpart) = lower('${quote_pgsql:$local_part}') AND lower(owner) = lower('${quote_pgsql:$domain}') LIMIT 1}}
| file_transport = address_file
| pipe_transport = address_pipe
| retry_use_local_part


This works, as shown here:

| hoho=> select * from exim_aliases;
|  id | localpart |     destination      |    owner
| ----+-----------+----------------------+-------------
|  24 | test      | ssmeenk@??? | domain.tld


| EXPN test@???
| 250 <ssmeenk@???>


But I also want that all email to a $local_part NOT SPECIFIED in the
database goes to 'thisuser@???'. With 'normal' aliases files
and lsearch{} lookups, you can put a line stating:

| *: thisuser@???


in your aliases file and it will match any local_part not specified
before and route all that mail to the specified email address..

Unfortunately, this is not possible with SQL, because '*' doesn't match
'thisuser' in SQL :/

Can someone tell me how I should change my director config that it
queries the database where to send mail that doesn't match any
local_part specified?

I expirimented a bit with 'condition' rules, but it seems to just allow
or disallow delivery.

Any help appreciated!

Kind regards,
Sander.

--
| Waarom worden mensen meteen geloofd als ze zeggen dat er aan de hemel
| 400 biljoen sterren zijn, maar als je ze vertelt dat de deurpost pas
| geverfd is moeten ze voelen!
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D