chiark / gitweb /
user-spam.m4: Fix indentation in the output.
[exim-config] / local.m4
1 ### -*-m4-*-
2 ###
3 ### Local senders and recipients for distorted.org.uk Exim configuration
4 ###
5 ### (c) 2012 Mark Wooding
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
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.
14 ###
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.
19 ###
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.
23
24 m4_define(<:FILTER_LOCALUSER:>,
25         <:FILTER_BASE
26         check_local_user
27         ignore_enotdir
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:>}}
32         file = <:$1:>:>)
33
34 ###--------------------------------------------------------------------------
35 ### Be flexible about originator addresses, as long as they probably work.
36
37 SECTION(global, priv)m4_dnl
38 local_from_suffix = CONF_user_suffix_list
39
40 ###--------------------------------------------------------------------------
41 ### Forwarding and redirection for incoming mail.
42
43 SECTION(routers, real)m4_dnl
44 ## A special hack to get mail to a user who has a forward file.  Only for
45 ## special effects.
46 real:
47         driver = accept
48         check_local_user
49         local_part_prefix = real-
50         transport = deliver
51         condition = ${if match_ip {$sender_host_address} \
52                                   {<; ; 127.0.0.1 ; ::1}}
53
54 SECTION(routers, forward)m4_dnl
55 ## Handle user forward files.  Each user is granted an arbitrary number of
56 ## additional mailboxes named USER-SUFFIX.  Such addresses are handled by a
57 ## filter file `~/.mail/forward.suffix' in the USER's home directory.  The
58 ## filter may reject the incoming message (which is reported as an SMTP
59 ## rejection if possible).  Mail sent directly to the user is handled through
60 ## `~/.mail/forward', or `~/.forward', or if neither of those exists, by
61 ## writing the message to `/var/mail/USER'.
62 FILTER_ROUTER(filter_suffix,
63         <:FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix)
64         local_part_suffix = CONF_user_suffix_list:>)
65 FILTER_ROUTER(filter,
66         <:FILTER_LOCALUSER(CONF_userconf_dir/forward):>)
67 FILTER_ROUTER(dot_forward,
68         <:FILTER_LOCALUSER($home/.forward):>)
69
70 SECTION(routers, deliver)m4_dnl
71 ## Deliver mail to a user, in the absence of any other instructions.
72 m4_define(<:DOVECOT_HEADERS:>, <:m4_dnl
73         Content-Length, Status, X-IMAP, X-IMAPbase, m4_dnl
74         X-Keywords, X-Status, X-UID:>)m4_dnl
75 deliver:
76         driver = accept
77         check_local_user
78         transport = deliver
79         cannot_route_message = Unknown local part
80
81         ## Strip headers used by Dovecot for its own purposes.
82         headers_remove = RENAME_HEADERS_REMOVE(<:DOVECOT_HEADERS:>)
83         headers_add = RENAME_HEADERS_ADD(<:DOVECOT_HEADERS:>)
84
85 DIVERT(null)
86 ###----- That's all, folks --------------------------------------------------