| 1 | # Exim test configuration 0014 |
| 2 | |
| 3 | .include DIR/aux-var/std_conf_prefix |
| 4 | |
| 5 | primary_hostname = myhost.test.ex |
| 6 | |
| 7 | # ----- Main settings ----- |
| 8 | |
| 9 | domainlist local_domains = test.ex : myhost.test.ex |
| 10 | domainlist relay_domains = test.ex |
| 11 | |
| 12 | acl_smtp_rcpt = check_recipient |
| 13 | |
| 14 | trusted_users = CALLER |
| 15 | |
| 16 | |
| 17 | # ----- ACL ----- |
| 18 | |
| 19 | begin acl |
| 20 | |
| 21 | check_recipient: |
| 22 | accept hosts = : |
| 23 | require verify = sender |
| 24 | accept domains = +local_domains |
| 25 | accept domains = +relay_domains |
| 26 | deny message = relay not permitted |
| 27 | |
| 28 | |
| 29 | # ----- Rewrite ----- |
| 30 | |
| 31 | begin rewrite |
| 32 | |
| 33 | *@*.one.two $1@one.two |
| 34 | abcd@^qu aaa@bbb |
| 35 | *pqr@^qu(.*) 1=$1@zz$2 |
| 36 | hhhh@h.h.h.h "${if eq {$h_to:}{x@y}{yes}{no}}@j.j.j" |
| 37 | |
| 38 | ######################################################## |
| 39 | # Fancy example of a supposed outgoing gateway rewrite # |
| 40 | ######################################################## |
| 41 | |
| 42 | # No rewrite unless domain is *.plc.example |
| 43 | |
| 44 | ^(?>.*)(?<!\.plc\.example) * |
| 45 | |
| 46 | # Handle root specially except envelope to |
| 47 | |
| 48 | root@*.plc.example "admin@plc.example (root@$1)" whFq |
| 49 | |
| 50 | # Failure in envelope sender is bad - should fail to verify |
| 51 | |
| 52 | *@*.plc.example ${lookup{$local_part@$2}lsearch\ |
| 53 | {DIR/aux-fixed/0014.usernames}\ |
| 54 | {$value}{"$1@$2.plc.example-is-not-known"}}@plc.example Fq |
| 55 | |
| 56 | # Use envelope for failing header sender |
| 57 | |
| 58 | *@*.plc.example "${lookup{$local_part@$2}lsearch\ |
| 59 | {DIR/aux-fixed/0014.usernames}{$value@plc.example}\ |
| 60 | {$sender_address}}" fsrq |
| 61 | |
| 62 | # Other failures => `unknown' |
| 63 | *@*.plc.example "${lookup{$local_part@$2}lsearch\ |
| 64 | {DIR/aux-fixed/0014.usernames}{$value}{unknown}}@plc.example" |
| 65 | |
| 66 | |
| 67 | # ----- Routers ----- |
| 68 | |
| 69 | begin routers |
| 70 | |
| 71 | fail: |
| 72 | driver = manualroute |
| 73 | domains = *.plc.example |
| 74 | fail_verify |
| 75 | route_list = * |
| 76 | verify_only |
| 77 | |
| 78 | fail_remote_domains: |
| 79 | driver = redirect |
| 80 | domains = ! +local_domains |
| 81 | allow_fail |
| 82 | data = :fail: Unrouteable mail domain "$domain" |
| 83 | |
| 84 | userx: |
| 85 | driver = accept |
| 86 | local_parts = userx |
| 87 | retry_use_local_part |
| 88 | transport = appendfile |
| 89 | |
| 90 | |
| 91 | # ----- Transports ----- |
| 92 | |
| 93 | begin transports |
| 94 | |
| 95 | appendfile: |
| 96 | driver = appendfile |
| 97 | file = DIR/test-mail/${bless:$local_part} |
| 98 | message_suffix = |
| 99 | user = CALLER |
| 100 | |
| 101 | # End |