Re: [exim] Redirect with mysql

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jeremy Harris
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Redirect with mysql
On 22/03/2022 12:56, Luciano InfoCultura via Exim-users wrote:
> Hi,
> I'm doing an exim install to replace a legacy email system where all subscribers are doing an external redirectI used the following rule as conf.d/router/120_CPD_client_aliases
> client_aliases:    debug_print = "R: client_aliases_XXX for $local_part@$domain"    driver = redirect    domains =  +local_domains    data = ${lookup mysql{SELECT real_address FROM client_aliases2 WHERE local_part='${sg{$local_part}{'}{''}}' AND local_domain='$domain'}}
>
>
> The rule is working but I would like the emails sent to addresses that do not exist in the table to be discarded.
> Does anyone have any ideas?


Extend your lookup expansion to have explicit success and fail clauses.
Use $value for success and :fail: for fail.

http://exim.org/exim-html-current/doc/html/spec_html/ch-the_redirect_router.html#SECTspecitredli
--
Cheers,
Jeremy