From: Tollef Fog Heen Date: Sun, 14 Aug 2011 19:26:05 +0000 (+0200) Subject: Add virt_aliases_regex router X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=ad23df284b727f0be56ebd2a5f18bf073ae9e358;p=mirror%2Fdsa-puppet.git Add virt_aliases_regex router This router looks for $directory/aliases.regex and uses nwildlsearch to look for matches there. This allows easy creation of leader-foo@d.o aliases by putting ^leader-.* leader@debian.org into the aliases.regex file. --- diff --git a/modules/exim/templates/eximconf.erb b/modules/exim/templates/eximconf.erb index 73e0109c0..ef324607d 100644 --- a/modules/exim/templates/eximconf.erb +++ b/modules/exim/templates/eximconf.erb @@ -1184,6 +1184,31 @@ virt_aliases: transport_home_directory = ${extract{directory}{VDOMAINDATA}} user = ${extract{user}{VDOMAINDATA}} +# No direct match, so try doing a regex match if there's an +# aliases.regex +virt_aliases_regex: + debug_print = "R: virt_aliases_regex for $local_part$local_part_suffix@$domain" + driver = redirect + allow_defer + allow_fail + data = ${if exists{\ + ${extract{directory}{VDOMAINDATA}{${value}/aliases.regex}}}\ + {${lookup{$local_part}nwildlsearch*{\ + ${extract{directory}{VDOMAINDATA}{$value/aliases.regex}}\ + }}}} + directory_transport = address_directory + domains = +virtual_domains + file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}} + cannot_route_message = Unknown user + group = ${extract{group}{VDOMAINDATA}} + headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}" + pipe_transport = address_pipe + qualify_preserve_domain + retry_use_local_part + transport_current_directory = ${extract{directory}{VDOMAINDATA}} + transport_home_directory = ${extract{directory}{VDOMAINDATA}} + user = ${extract{user}{VDOMAINDATA}} + userforward: debug_print = "R: userforward for $local_part${local_part_suffix}@$domain" driver = redirect