summaryrefslogtreecommitdiff
path: root/test/confs/0014
blob: c7dbdb804c6387e1520c85f9321216d504f9293e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Exim test configuration 0014

exim_path = EXIM_PATH
host_lookup_order = bydns
primary_hostname = myhost.test.ex
rfc1413_query_timeout = 0s
spool_directory = DIR/spool
log_file_path = DIR/spool/log/%slog
gecos_pattern = ""
gecos_name = CALLER_NAME

# ----- Main settings -----

domainlist local_domains = test.ex : myhost.test.ex
domainlist relay_domains = test.ex

acl_smtp_rcpt = check_recipient

trusted_users = CALLER


# ----- ACL -----

begin acl

check_recipient:
  accept  hosts = :
  require verify = sender
  accept  domains = +local_domains
  accept  domains = +relay_domains
  deny    message = relay not permitted


# ----- Rewrite -----

begin rewrite

*@*.one.two   $1@one.two
abcd@^qu      aaa@bbb
*pqr@^qu(.*)  1=$1@zz$2
hhhh@h.h.h.h  "${if eq {$h_to:}{x@y}{yes}{no}}@j.j.j"

########################################################
# Fancy example of a supposed outgoing gateway rewrite #
########################################################

# No rewrite unless domain is *.plc.example

^(?>.*)(?<!\.plc\.example)  *

# Handle root specially except envelope to

root@*.plc.example "admin@plc.example (root@$1)"  whFq

# Failure in envelope sender is bad - should fail to verify

*@*.plc.example ${lookup{$local_part@$2}lsearch\
  {DIR/aux-fixed/0014.usernames}\
  {$value}{"$1@$2.plc.example-is-not-known"}}@plc.example  Fq

# Use envelope for failing header sender

*@*.plc.example "${lookup{$local_part@$2}lsearch\
  {DIR/aux-fixed/0014.usernames}{$value@plc.example}\
  {$sender_address}}"     fsrq

# Other failures => `unknown'
*@*.plc.example "${lookup{$local_part@$2}lsearch\
  {DIR/aux-fixed/0014.usernames}{$value}{unknown}}@plc.example"


# ----- Routers -----

begin routers

fail:
  driver = manualroute
  domains = *.plc.example
  fail_verify
  route_list = *
  verify_only

fail_remote_domains:
  driver = redirect
  domains = ! +local_domains
  allow_fail
  data = :fail: Unrouteable mail domain "$domain"

userx:
  driver = accept
  local_parts = userx
  retry_use_local_part
  transport = appendfile


# ----- Transports -----

begin transports

appendfile:
  driver = appendfile
  file = DIR/test-mail/$local_part
  message_suffix =
  user = CALLER

# End