| 1 | # Exim test configuration 0023 |
| 2 | |
| 3 | LOG_SELECTOR= |
| 4 | |
| 5 | exim_path = EXIM_PATH |
| 6 | host_lookup_order = bydns |
| 7 | primary_hostname = myhost.test.ex |
| 8 | spool_directory = DIR/spool |
| 9 | log_file_path = DIR/spool/log/%slog |
| 10 | gecos_pattern = "" |
| 11 | gecos_name = CALLER_NAME |
| 12 | |
| 13 | # ----- Main settings ----- |
| 14 | |
| 15 | addresslist ok_senders = ok@ok.ok |
| 16 | |
| 17 | domainlist local_domains = test.ex : *.test.ex |
| 18 | domainlist relay_domains = relay.test.ex |
| 19 | |
| 20 | hostlist ok9_hosts = 9.9.9.9 |
| 21 | |
| 22 | LOG_SELECTOR |
| 23 | |
| 24 | qualify_domain = test.ex |
| 25 | trusted_users = CALLER |
| 26 | |
| 27 | # Use first three components of address to select ACL |
| 28 | acl_smtp_rcpt = acl_${sg{${tr{$sender_host_address}{.}{_}}}{^(.*)_.*\$}{\$1}} |
| 29 | acl_smtp_data = data_acl |
| 30 | |
| 31 | # ----- ACLs ----- |
| 32 | |
| 33 | begin acl |
| 34 | |
| 35 | data_acl: |
| 36 | warn condition = ${if def:h_x-rcpt-added:{yes}{no}} |
| 37 | message = X-data-added: Header added at data time |
| 38 | warn senders = rcpttest@test.ex |
| 39 | message = X-data-rcpt-count: $rcpt_count\n\ |
| 40 | X-data-rcpt-defer-count: $rcpt_defer_count\n\ |
| 41 | X-data-rcpt-fail-count: $rcpt_fail_count |
| 42 | warn message = X-message-body-size: $message_body_size |
| 43 | accept |
| 44 | |
| 45 | acl_1_2_3: |
| 46 | require domains = !nopass |
| 47 | |
| 48 | require message = $local_part@$domain shall not pass |
| 49 | domains = !wontpass |
| 50 | |
| 51 | deny message = domain explicitly denied |
| 52 | log_message = DOMAIN EXPLICITLY DENIED |
| 53 | continue = this value is not used |
| 54 | domains = deny.test.ex |
| 55 | |
| 56 | accept domains = +local_domains |
| 57 | endpass |
| 58 | message = $domain gets refused |
| 59 | domains = !refuse.test.ex |
| 60 | |
| 61 | # Double to check caching |
| 62 | accept domains = +relay_domains |
| 63 | accept domains = +relay_domains |
| 64 | |
| 65 | acl_5_6_7: |
| 66 | accept domains = lsearch;DIR/aux-fixed/TESTNUM.doms |
| 67 | local_parts = $domain_data |
| 68 | |
| 69 | acl_5_6_8: |
| 70 | accept senders = user1@domain1 : domain2 : +ok_senders |
| 71 | |
| 72 | acl_5_6_11: |
| 73 | accept condition = ${if match{$local_part}{^x}{yes}{no}} |
| 74 | deny message = "local part of wrong type\n(quotes are literal) |
| 75 | |
| 76 | acl_5_6_12: |
| 77 | accept hosts = 5.6.12.1 |
| 78 | endpass |
| 79 | message = failed nested acl |
| 80 | acl = acl_5_6_12A |
| 81 | accept |
| 82 | |
| 83 | acl_5_6_12A: |
| 84 | accept domains = ok |
| 85 | |
| 86 | acl_5_6_13: |
| 87 | accept acl = DIR/aux-fixed/TESTNUM.acl1 |
| 88 | |
| 89 | acl_8_8_8: |
| 90 | accept acl = acl_8_8_8 |
| 91 | |
| 92 | acl_9_9_9: |
| 93 | accept hosts = +ok9_hosts |
| 94 | deny message = don't like this host |
| 95 | hosts = 9.9.9.0/26 |
| 96 | accept hosts = 9.9.9.0/24 |
| 97 | |
| 98 | acl_V4NET_0_0: |
| 99 | require verify = reverse_host_lookup |
| 100 | accept |
| 101 | acl_V4NET_99_99: |
| 102 | accept local_parts = defer_ok |
| 103 | verify = reverse_host_lookup/defer_ok |
| 104 | accept verify = reverse_host_lookup |
| 105 | |
| 106 | acl_V4NET_11_12: |
| 107 | deny message = host in DNS list $dnslist_domain: $dnslist_text |
| 108 | log_message = DNSLIST ($dnslist_domain: $dnslist_text) |
| 109 | dnslists = rbl.test.ex |
| 110 | accept |
| 111 | |
| 112 | acl_20_20_20: |
| 113 | accept endpass |
| 114 | message = sender verify failure |
| 115 | verify = sender |
| 116 | message = recipient verify failure |
| 117 | verify = recipient |
| 118 | |
| 119 | acl_21_21_21: |
| 120 | accept |
| 121 | verify = sender |
| 122 | verify = recipient |
| 123 | |
| 124 | acl_22_22_22: |
| 125 | accept recipients = x@y |
| 126 | |
| 127 | acl_23_23_23: |
| 128 | deny hosts = 23.23.23.0 |
| 129 | message = sender must verify |
| 130 | !verify = sender |
| 131 | accept |
| 132 | |
| 133 | acl_24_24_24: |
| 134 | warn message = X-Warn: sender didn't verify |
| 135 | condition = yes |
| 136 | |
| 137 | acl_25_25_25: |
| 138 | deny message = denying domains=x |
| 139 | domains = x |
| 140 | |
| 141 | acl_26_26_26: |
| 142 | deny senders = : |
| 143 | message = bounce messages can have only one recipient |
| 144 | condition = ${if > {$recipients_count}{0}{yes}{no}} |
| 145 | accept |
| 146 | |
| 147 | # Force host list expansion failure |
| 148 | acl_27_27_27: |
| 149 | deny hosts = ${if eq {1}{0}{}fail} |
| 150 | accept |
| 151 | |
| 152 | acl_28_28_28: |
| 153 | accept sender_domains = : okdomain |
| 154 | |
| 155 | acl_29_29_29: |
| 156 | deny dnslists = test.ex/$sender_address_domain |
| 157 | accept |
| 158 | |
| 159 | acl_30_30_30: |
| 160 | deny message = domain=$dnslist_domain\n\ |
| 161 | value=$dnslist_value\n\ |
| 162 | matched=$dnslist_matched\n\ |
| 163 | text="$dnslist_text" |
| 164 | dnslists = test.ex=V4NET.0.0.1,127.0.0.2/$sender_address_domain |
| 165 | accept |
| 166 | |
| 167 | # This one tests what happens when a lookup key gets too long |
| 168 | acl_31_31_31: |
| 169 | deny dnslists = test.ex/$sender_address_domain+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+END |
| 170 | accept |
| 171 | |
| 172 | # Settings of $domain and $local_part |
| 173 | acl_32_32_32: |
| 174 | warn message = Start: domain=$domain local_part=$local_part |
| 175 | |
| 176 | warn local_parts = userx-vs |
| 177 | message = Vs: domain=$domain local_part=$local_part |
| 178 | verify = sender |
| 179 | |
| 180 | warn message = Vr: domain=$domain local_part=$local_part |
| 181 | verify = recipient |
| 182 | |
| 183 | accept |
| 184 | |
| 185 | acl_33_33_33: |
| 186 | accept endpass |
| 187 | message = sender verify failure |
| 188 | verify = sender/no_details |
| 189 | message = recipient verify failure |
| 190 | verify = recipient |
| 191 | |
| 192 | # Incomplete DNS lookups |
| 193 | acl_44_44_44: |
| 194 | warn dnslists = test.again.dns |
| 195 | warn dnslists = +include_unknown : test.again.dns |
| 196 | warn dnslists = +exclude_unknown : test.again.dns |
| 197 | warn dnslists = +defer_unknown : test.again.dns |
| 198 | accept |
| 199 | |
| 200 | # Adding header at RCPT time and testing at DATA time |
| 201 | acl_55_55_55: |
| 202 | warn message = X-rcpt-added: An added header at RCPT time |
| 203 | accept |
| 204 | |
| 205 | acl_56_56_56: |
| 206 | warn message = X-Warn: $local_part |
| 207 | condition = ${substr_5:$local_part} |
| 208 | accept |
| 209 | |
| 210 | acl_56_56_57: |
| 211 | accept message = accepted by condition |
| 212 | condition = ${substr_5:$local_part} |
| 213 | |
| 214 | acl_56_56_58: |
| 215 | warn message = xx: rcpt_count = $rcpt_count\n \ |
| 216 | rcpt_defer_count = $rcpt_defer_count\n \ |
| 217 | rcpt_fail_count = $rcpt_fail_count\n \ |
| 218 | recipients_count = $recipients_count\n \ |
| 219 | local_part = $local_part |
| 220 | accept local_parts = ^ok |
| 221 | |
| 222 | acl_56_56_59: |
| 223 | accept message = ACL message for verification failure\n \ |
| 224 | Original was >$acl_verify_message< |
| 225 | verify = recipient |
| 226 | |
| 227 | acl_60_60_60: |
| 228 | accept !acl = DIR/aux-fixed/0023.acl2 |
| 229 | |
| 230 | |
| 231 | # ----- Transports ----- |
| 232 | |
| 233 | begin transports |
| 234 | |
| 235 | t1: |
| 236 | driver = appendfile |
| 237 | file = DIR/test-mail/$local_part |
| 238 | user = CALLER |
| 239 | |
| 240 | t2: |
| 241 | driver = appendfile |
| 242 | file = DIR/test-mail/okbatch |
| 243 | user = CALLER |
| 244 | batch_max = 100 |
| 245 | envelope_to_add |
| 246 | |
| 247 | # ----- Routers ----- |
| 248 | |
| 249 | begin routers |
| 250 | |
| 251 | r0: |
| 252 | driver = accept |
| 253 | local_parts = ^ok |
| 254 | transport = t2 |
| 255 | |
| 256 | r1: |
| 257 | driver = accept |
| 258 | local_parts = ^userx : ^cond- |
| 259 | transport = t1 |
| 260 | |
| 261 | r2: |
| 262 | driver = redirect |
| 263 | local_parts = fail |
| 264 | allow_fail |
| 265 | data = :fail: here is a fail message |
| 266 | |
| 267 | # ----- Retry ----- |
| 268 | |
| 269 | begin retry |
| 270 | |
| 271 | * * F,5d,5m |
| 272 | |
| 273 | # End |