a53407e846c5e46fabb5a07b753516bec899d4b9
[exim-website.git] / config.samples / C010
1 Date: Tue, 22 Sep 1998 23:21:58 -0400
2 From: Peter Radcliffe <pir@pir.net>
3
4 Philip Hazel <ph10@cus.cam.ac.uk> probably said:
5 > On Fri, 18 Sep 1998, Tabor J. Wells wrote:
6 > > One of our customers is looking for us to support addresses of the form
7 > > username+extension@domain.com, primarily for use with procmail.
8
9 > Look up the "prefix" and "suffix" options of directors. A smartuser 
10 > director with options along the lines of
11
12 >   suffix = +extension
13 >   new_address = some kind of lookup to get the rewrite, and then 
14 >                 manipulation involving the use of $local_part_suffix
15 >                 to put the extension back. Depending on your lookup,
16 >                 could be messy...
17
18 Thats what I was doing before I saw this ;)
19 If this isn't clear and you want an explanation, ask ...
20
21 Note to Tabor: I added qualify_preserve_domain to the virtual director.
22 This is not what you have now and will break things, you'll have to remove
23 it and alter the virtual suffix as it says.
24
25 # macros
26
27 EBASE = /usr/local/etc/exim
28 DSUFFIX = -
29 # DSUFFIX = +
30 DBEXT = .db
31 #DBEXT = 
32
33 ## transports
34
35 # delivery by procmail, local users with .procmailrc files only
36 procmail_pipe:
37   driver = pipe
38   delivery_date_add = true
39   envelope_to_add = true
40   return_path_add = true
41   path = "/usr/local/bin:/usr/bin"
42   command = "procmail -a ${substr_1:${local_part_suffix}} -d ${local_part}"
43   from_hack
44   user = ${local_part}
45
46
47 ## directors
48
49 # deal with virtual domains - just for virtual domains, look them up
50 virtual:
51   driver = aliasfile
52   domains = dbm;EBASE/dbm/virtualDBEXT
53   file = EBASE/domains/${lc:${length_1:${domain}}/${domain}}DBEXT
54   search_type = dbm*
55   forbid_file
56   forbid_pipe
57   qualify_preserve_domain
58
59
60 # if the virtual domain has no postmaster or root alias, throw them at
61 # the default domain
62 virtualpostmaster:
63   driver = smartuser
64   domains = dbm;EBASE/dbm/virtualDBEXT
65   local_parts = "postmaster:root"
66   new_address = ${local_part}@${qualify_recipient}
67
68
69 # and if there is a -something suffix, send it to the right place
70 virtualsuffix:
71   driver = smartuser
72   domains = dbm;EBASE/dbm/virtualDBEXT
73   no_more
74   suffix = DSUFFIX*
75 # if you want this to not do qualify_preserve_domain replace ' {$domain} '
76 # with ' {$qualify_recipient} ' in the 7th line.
77   new_address = "\
78     ${lookup{$local_part} dbm \
79       {EBASE/domains/${lc:${length_1:${domain}}/${domain}}DBEXT} \
80       {\
81         ${if !match {$value}{^:(defer|fail|blackhole|include):} \
82           {${local_part:$value}${local_part_suffix}@\
83            ${if eq {${domain:$value}} {} {$domain} {${domain:$value}}}}\
84         fail}\
85       }\
86     fail}"
87
88 .
89 .
90 .
91
92 userforward:
93   driver = forwardfile
94   no_verify
95   check_ancestor
96   file = .forward${local_part_suffix}
97   filter
98   suffix = DSUFFIX*
99   suffix_optional
100
101
102 # Use procmail only if a ~/.procmailrc file exists, and procmail exists.
103 # If sending to a username-suffix and $HOME/.forward-suffix exists,
104 # its valid.
105 procmail:
106   driver = localuser
107   transport = procmail_pipe
108   require_files = "${local_part}:${home}/.procmailrc:+/usr/local/bin/procmail"
109   suffix = DSUFFIX*
110   suffix_optional
111   
112 # I realised that this might pass things to procmail when you have a .forward
113 # file and expect it not to happen (if .forward and .procmailrc exist user-foo
114 # will still get passed to procmail).
115 # To stop this you can change the above to use:
116  
117   require_files = "${local_part}:${home}/.procmailrc:+/usr/local/bin/procmail\
118                     :!${home}/.forward"
119