exim: Completely review the exim configuration.
[matthijs/servers/drsnuggles.git] / etc / exim4 / conf.d / router / 40_local_delivery
1 #################################
2 # The routers that handle the actual local delivery of mail. These routers all
3 # work just on the localhost "domain", so any previous routers that want to
4 # have mail delivered locally should redirect to username@localhost and set
5 # redirect_router to "local_delivery". These routers are not used directly on
6 # incoming messages, the first router guarantees this.
7
8 # These routers support .forward files, procmail and mbox delivery in
9 # /var/mail, each tried in turn.
10 #################################
11
12
13 # Dummy noop router, that ensures that these routers are never called directly
14 # on an incoming message and enforces that they only be called when a previous
15 # router explicitely sets redirect_router to local_delivery.
16 always_fail:
17   debug_print = "R: local_delivery for $local_part@$domain"
18   driver = redirect
19   data =
20   more = false
21   cannot_route_message = "Internal error"
22
23 # Dummy noop router, that can be used by other routers for the value of
24 # redirect_router or pass_router, without being dependent on the (order of)
25 # actual delivery routers below.
26 local_delivery:
27   debug_print = "R: local_delivery for $local_part@$domain"
28   driver = redirect
29   data =
30
31 # This router handles forwarding using traditional .forward files in users'
32 # home directories. It also allows mail filtering with a forward file
33 # starting with the string "# Exim filter" or "# Sieve filter".
34 #
35 # The no_verify setting means that this router is skipped when Exim is
36 # verifying addresses. Similarly, no_expn means that this router is skipped if
37 # Exim is processing an EXPN command.
38 #
39 # The check_ancestor option means that if the forward file generates an
40 # address that is an ancestor of the current one, the current one gets
41 # passed on instead. This covers the case where A is aliased to B and B
42 # has a .forward file pointing to A.
43 #
44 # The four transports specified at the end are those that are used when
45 # forwarding generates a direct delivery to a directory, or a file, or to a
46 # pipe, or sets up an auto-reply, respectively.
47 #
48 # Any syntax errors in the .forward are sent with the real- prefix, which the
49 # real_local router directly delivers through the maildir_home transport,
50 # avoiding the routers in this file.
51 userforward:
52   debug_print = "R: userforward for $local_part@$domain"
53   driver = redirect
54   domains = localhost
55   check_local_user
56   file = $home/.forward
57   require_files = $local_part:$home/.forward
58   no_verify
59   no_expn
60   check_ancestor
61   allow_filter
62   forbid_smtp_code = true
63   directory_transport = address_directory
64   file_transport = address_file
65   pipe_transport = address_pipe
66   reply_transport = address_reply
67   skip_syntax_errors
68   syntax_errors_to = real-$local_part@$domain
69   syntax_errors_text = \
70     This is an automatically generated message. An error has\n\
71     been found in your .forward file. Details of the error are\n\
72     reported below. While this error persists, you will receive\n\
73     a copy of this message for every message that is addressed\n\
74     to you. If your .forward file is a filter file, or if it is\n\
75     a non-filter file containing no valid forwarding addresses,\n\
76     a copy of each incoming message will be put in your normal\n\
77     mailbox. If a non-filter file contains at least one valid\n\
78     forwarding address, forwarding to the valid addresses will\n\
79     happen, and those will be the only deliveries that occur.
80
81 # Let procmail deliver the message if a global or local (in the user's
82 # homedir) procmailrc exists.
83 procmail:
84   debug_print = "R: procmail for $local_part@$domain"
85   driver = accept
86   domains = localhost
87   check_local_user
88   transport = procmail_pipe
89   # emulate OR with "if exists"-expansion
90   require_files = ${local_part}:\
91                   ${if exists{/etc/procmailrc}\
92                     {/etc/procmailrc}{${home}/.procmailrc}}:\
93                   +/usr/bin/procmail
94   no_verify
95   no_expn
96
97 # This router delivers to /var/mail.
98 local_user:
99   debug_print = "R: local_user for $local_part@$domain"
100   driver = accept
101   domains = localhost
102   check_local_user
103   local_parts = ! root
104   transport = maildir_home
105   # If we get here, some previous router redirected to a non-existing user.
106   # That should not happen!
107   cannot_route_message = Unknown user: This should not happen
108
109 # vim: set sts=2 expandtab sw=2 ai: