summaryrefslogtreecommitdiff
path: root/test/confs/0567
blob: 2675665617ad89efea0581e7d812ab992b48a9d1 (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
# Exim test configuration 0567

CONNECTCOND=

.include DIR/aux-var/std_conf_prefix

primary_hostname = myhost.test.ex

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

acl_smtp_connect = connect
acl_smtp_mail = mail
acl_smtp_rcpt = rcpt
acl_smtp_predata = predata
acl_smtp_data = data
acl_not_smtp = notsmtp

qualify_domain = test.ex
trusted_users = CALLER

hostlist internal_headers = x-mail-2 : x-mail-3


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

begin acl

connect:
  accept CONNECTCOND

mail:
  accept remove_header = x-mail-1
         senders       = mailok@test.ex
         # Won't work because doesn't expand
         remove_header = +internal_headers
  accept

rcpt:
  accept local_parts   = rcptok
         remove_header = x-rcpt-4 : x-rcpt-2
         set acl_m_hdr = x-predata-1
  deny   add_header    = RCPT: denied $local_part


predata:
  warn   remove_header = x-predata-3 : $acl_m_hdr
  # Won't work because doesn't use wildcards
  accept remove_header = x-not-*

data:
  warn   log_message   = Verified previously removed header X-Rcpt-2
         condition     = ${if eq{$h_x-rcpt-2:}{}}
  warn   remove_header = x-data-1 : x-data-4
         condition     = ${if eq{$h_cond:}{accept}}
         remove_header = x-data-3
  # Won't delete this header because condition fails before the modifier
  warn   condition     = ${if eq{$h_cond:}{reject}}
         remove_header = x-data-2
  warn   log_message   = Verified removed header X-Data-3 in this ACL still visible
         condition     = ${if !eq{$h_x-data-3:}{}}
  accept

notsmtp:
  # Will remove a required header (Date) if told to
  accept remove_header = x-notsmtp-1 : date


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

begin routers

r1:
  driver = accept
  transport = t1


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

begin transports

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

# End