Re: [exim] Redirect with mysql

2022-03-22 Thread Jeremy Harris via Exim-users

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

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Redirect with mysql

2022-03-22 Thread Luciano InfoCultura via Exim-users
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?



really appreciate your help
Luciano,


-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/