3 ### Local senders and recipients 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.
24 m4_define(<:FILTER_LOCALUSER:>,
28 sieve_useraddress = $local_part
29 sieve_subaddress = CONF_user_extaddr_fixup
30 sieve_vacation_directory = CONF_userconf_dir/vacation
31 condition = ${if exists {<:$1:>}}
34 ###--------------------------------------------------------------------------
35 ### Be flexible about originator addresses, as long as they probably work.
37 SECTION(global, priv)m4_dnl
38 local_from_suffix = CONF_user_suffix_list
40 SECTION(global, process)m4_dnl
41 ## Restrict users to plausible envelope sender addresses. This is
42 ## surprisingly fiddly. What I actually want to say is that the local part
43 ## must match ^$sender_ident(\$|-) and the domain part must match an
44 ## appropriate domain; but writing a conjunction is rather tricky. And so we
45 ## must burn some addresslist variables.
46 addresslist wrong_local = ! +user_extaddr
47 addresslist wrong_domain = ! *@+public
48 addresslist wrong_address = +wrong_local : +wrong_domain
49 untrusted_set_sender = : \
50 ${LOOKUP_DOMAIN($sender_address_domain,
51 {${if and {{match_local_part {$sender_ident} {+dom_users}} \
52 {match_local_part {$sender_address_local_part} \
57 ###--------------------------------------------------------------------------
58 ### Forwarding and redirection for incoming mail.
60 SECTION(routers, alias)m4_dnl
61 ## Look up the local part in the address map.
66 user = CONF_filter_user
68 local_parts = nwildlsearch; CONF_alias_file
69 data = ${expand:$local_part_data}
71 SECTION(routers, real)m4_dnl
72 ## A special hack to get mail to a user who has a forward file. Only for
77 local_part_prefix = real-
79 condition = ${if match_ip {$sender_host_address} \
80 {<; ; 127.0.0.1 ; ::1}}
82 SECTION(routers, forward)m4_dnl
83 ## Handle user forward files. Each user is granted an arbitrary number of
84 ## additional mailboxes named USER-SUFFIX. Such addresses are handled by a
85 ## filter file `~/.mail/forward.suffix' in the USER's home directory. The
86 ## filter may reject the incoming message (which is reported as an SMTP
87 ## rejection if possible). Mail sent directly to the user is handled through
88 ## `~/.mail/forward', or `~/.forward', or if neither of those exists, by
89 ## writing the message to `/var/mail/USER'.
90 FILTER_ROUTER(filter_suffix,
91 <:FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix)
92 local_part_suffix = CONF_user_suffix_list:>)
94 <:FILTER_LOCALUSER(CONF_userconf_dir/forward):>)
95 FILTER_ROUTER(dot_forward,
96 <:FILTER_LOCALUSER($home/.forward):>)
98 SECTION(routers, deliver)m4_dnl
99 ## Deliver mail to a user, in the absence of any other instructions.
104 cannot_route_message = Unknown local part
107 ###----- That's all, folks --------------------------------------------------