Transports: explicit errno values in returns
[users/heiko/exim.git] / test / aux-fixed / event-logger-acl
1 ev_tcp:
2     accept condition = ${if eq {$event_name}{tcp:connect}}
3            logwrite = . [$host_address]:$host_port
4     accept condition = ${if eq {$event_name}{tcp:close}}
5            logwrite = . [$sending_ip_address] -> \
6                         [$host_address]:$host_port
7     accept logwrite =   UNEXPECTED $event_name
8
9 ev_smtp:
10     warn
11            logwrite = . [$sending_ip_address] -> \
12                         [$host_address]:$host_port
13     accept condition = ${if eq {$event_name}{smtp:connect}}
14            logwrite = . banner <$event_data>
15     accept condition = ${if eq {$event_name}{smtp:ehlo}}
16            logwrite = . ehlo-resp <$event_data>
17     accept logwrite =   UNEXPECTED $event_name
18
19 ev_msg_fail:
20     accept condition = ${if eq {$event_name}{msg:fail:delivery}}
21            logwrite = . \
22             refused by fdqn <$host> \
23             local_part <$local_part> \
24             domain <$domain> \
25             errstr <$event_data> \
26
27     accept logwrite = . \
28             local_part <$local_part> \
29             domain <$domain> \
30             reason <$event_data>
31
32 ev_msg_log:
33     accept logwrite = . \
34             $acl_arg1 \
35             ip <$host_address> \
36             port <$host_port> \
37             fqdn <$host> \
38             local_part <$local_part> \
39             domain <$domain> \
40             $acl_arg2 \
41             router <$router_name> \
42             transport <$transport_name>
43
44 ev_msg:
45     accept condition = ${if eq {fail} {${listextract{2}{$event_name}}}}
46            acl = ev_msg_fail
47
48     accept condition = ${if eq {$event_name}{msg:complete}}
49            logwrite = . finished: $message_exim_id
50
51     accept condition = ${if eq {$domain}{expansionfail}}
52            logwrite = $this_expansion_will_fail
53
54     accept condition = ${if eq {$event_name}{msg:delivery}}
55            acl = ev_msg_log delivery "confirmation <$event_data>"
56
57     accept condition = ${if eq {$event_name}{msg:host:defer}}
58            acl = ev_msg_log "host deferral" \
59                         "errno <$event_defer_errno> errstr <$event_data>"
60
61     accept condition = ${if eq {$event_name}{msg:rcpt:defer}}
62            set acl_m_ev_lkup =  ${eval:$event_defer_errno & 0xff}
63            set acl_m_ev_lkup =  ${if = {$acl_m_ev_lkup}{65} {A} \
64                                 { ${if = {$acl_m_ev_lkup}{77} {MX} \
65                                   {$acl_m_ev_lkup}}}}
66            set acl_m_ev_code =  4${eval:$event_defer_errno >>8}
67            acl = ev_msg_log "rcpt deferral" \
68                         "err <$event_defer_errno>:<$acl_m_ev_lkup:$acl_m_ev_code> \
69                         errstr <$event_data>"
70
71     accept condition = ${if eq {$event_name}{msg:rcpt:host:defer}}
72     accept logwrite =   UNEXPECTED $event_name
73
74 logger:
75     warn   logwrite = event $event_name
76     accept condition = ${if eq {tcp} {${listextract{1}{$event_name}}}}
77            acl = ev_tcp
78     accept condition = ${if eq {smtp} {${listextract{1}{$event_name}}}}
79            acl = ev_smtp
80     accept condition = ${if eq {msg} {${listextract{1}{$event_name}}}}
81            acl = ev_msg
82     accept logwrite =   UNEXPECTED $event_name