3 ### Virtual host support for distorted.org.uk Exim configuration
5 ### (c) 2012 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This program is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 2 of the License, or
13 ### (at your option) any later version.
15 ### This program is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ### GNU General Public License for more details.
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program; if not, write to the Free Software Foundation,
22 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 <:domains = ${if exists{CONF_sysconf_dir/domains.conf} \
26 {partial0-lsearch; CONF_sysconf_dir/domains.conf} \
28 m4_define(<:VHOST_FILTER:>,
31 condition = DOMKV($2, {true}{false})
32 router_home_directory = DOMKV(home, {$value} fail)
33 $1 = ${expand:DOMKV($2)}:>)
34 m4_define(<:VHOST_USER:>,
35 <:user = DOMKV(owner, {$value}{CONF_filter_user})
36 errors_to = DOMKV(errors_to, {$value} fail):>)
38 ###--------------------------------------------------------------------------
39 ### Routers and transports for virtual hosting.
41 SECTION(routers, route)m4_dnl
42 ## If we're a front-end for some other domain, or we have special information
43 ## about the domain, then pass stuff along as instructed.
48 condition = DOMKV(route, {true}{false})
49 route_data = DOMKV(route)
50 same_domain_copy_routing = true
54 SECTION(routers, virtual)m4_dnl
55 ## Remap recipients according to the virtual host's instructions. This must
56 ## be done in two passes, so that we can identify the correct user's spam
57 ## threshold during address verification.
58 FILTER_ROUTER(virtual_data,
59 <:VHOST_FILTER(data, redirect):>,, <:
61 FILTER_ROUTER(virtual_file,
62 <:VHOST_FILTER(file, filter):>,, <:
65 SECTION(routers, virtual-tail)m4_dnl
66 ## Last ditch effort for required local parts. This is a bit strange because
67 ## we should only try this for `final' domains -- where we're not going to
68 ## route using the system-wide rules -- and we want the router to decline if
69 ## the local part isn't one of our required set so that routing as a whole
73 condition = DOMKV(final, {$value}{true})
76 data = ${if match_local_part{$local_part}{+required} \
85 ###----- That's all, folks --------------------------------------------------