summaryrefslogtreecommitdiffstats
path: root/src/smtpd/smtpd_acl.ref
blob: 4b7f6e9321e9f3a0e7db508d8f79079eb9716d31 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
>>> #
>>> # Initialize
>>> #
>>> smtpd_delay_reject 0
OK
>>> mynetworks 127.0.0.0/8,168.100.3.0/28
OK
>>> relay_domains porcupine.org
OK
>>> smtpd_null_access_lookup_key <> 
OK
>>> #
>>> # Test check_domain_access()
>>> #
>>> helo_restrictions hash:./smtpd_check_access
OK
>>> # Expect: REJECT
>>> helo foo.dunno.com
./smtpd_check: <queue id>: reject: HELO from localhost[127.0.0.1]: 554 5.7.1 <foo.dunno.com>: Helo command rejected: Access denied; proto=SMTP helo=<foo.dunno.com>
554 5.7.1 <foo.dunno.com>: Helo command rejected: Access denied
>>> # Expect: OK
>>> helo bar.dunno.com
OK
>>> # Expect: OK
>>> helo foo.duuno.com
OK
>>> #
>>> # Test check_namadr_access(), domain part
>>> #
>>> client_restrictions hash:./smtpd_check_access
OK
>>> # Expect: REJECT
>>> client foo.dunno.com 131.155.210.17
./smtpd_check: <queue id>: reject: CONNECT from foo.dunno.com[131.155.210.17]: 554 5.7.1 <foo.dunno.com[131.155.210.17]>: Client host rejected: Access denied; proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <foo.dunno.com[131.155.210.17]>: Client host rejected: Access denied
>>> # Expect: OK
>>> client bar.dunno.com 131.155.210.17
OK
>>> # Expect: OK
>>> client bar.dunno.com 131.155.210.19
OK
>>> #
>>> # Test check_namadr_access(), address part
>>> #
>>> # Expect: OK
>>> client bar.duno.com 131.155.210.17
OK
>>> # Expect: REJECT
>>> client bar.duno.com 131.155.210.19
./smtpd_check: <queue id>: reject: CONNECT from bar.duno.com[131.155.210.19]: 554 5.7.1 <bar.duno.com[131.155.210.19]>: Client host rejected: Access denied; proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <bar.duno.com[131.155.210.19]>: Client host rejected: Access denied
>>> # Expect: REJECT
>>> client bar.duno.com 44.33.22.11
./smtpd_check: <queue id>: reject: CONNECT from bar.duno.com[44.33.22.11]: 554 5.7.1 <bar.duno.com[44.33.22.11]>: Client host rejected: Access denied; proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <bar.duno.com[44.33.22.11]>: Client host rejected: Access denied
>>> # Expect: OK
>>> client bar.duno.com 44.33.22.55
OK
>>> # Expect: REJECT
>>> client bar.duno.com 44.33.44.33
./smtpd_check: <queue id>: reject: CONNECT from bar.duno.com[44.33.44.33]: 554 5.7.1 <bar.duno.com[44.33.44.33]>: Client host rejected: Access denied; proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <bar.duno.com[44.33.44.33]>: Client host rejected: Access denied
>>> #
>>> # Test check_mail_access()
>>> #
>>> sender_restrictions hash:./smtpd_check_access
OK
>>> # Expect: REJECT
>>> mail reject@dunno.domain
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@dunno.domain>: Sender address rejected: Access denied; from=<reject@dunno.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@dunno.domain>: Sender address rejected: Access denied
>>> # Expect: OK
>>> mail ok@dunno.domain
OK
>>> # Expect: OK
>>> mail anyone@dunno.domain
OK
>>> # Expect: OK
>>> mail bad-sender@dunno.domain
OK
>>> #
>>> # Again, with a domain that rejects by default
>>> #
>>> # Expect: REJECT  
>>> mail reject@reject.domain
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@reject.domain>: Sender address rejected: Access denied; from=<reject@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@reject.domain>: Sender address rejected: Access denied
>>> # Expect: OK
>>> mail ok@reject.domain
OK
>>> # Expect: REJECT
>>> mail anyone@reject.domain
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 <anyone@reject.domain>: Sender address rejected: Access denied; from=<anyone@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <anyone@reject.domain>: Sender address rejected: Access denied
>>> # Expect: REJECT
>>> mail good-sender@reject.domain
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 <good-sender@reject.domain>: Sender address rejected: Access denied; from=<good-sender@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <good-sender@reject.domain>: Sender address rejected: Access denied
>>> #
>>> # Again, with a domain that accepts by default
>>> #
>>> # Expect: REJECT
>>> mail reject@ok.domain
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@ok.domain>: Sender address rejected: Access denied; from=<reject@ok.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@ok.domain>: Sender address rejected: Access denied
>>> # Expect: OK
>>> mail ok@ok.domain
OK
>>> # Expect: OK
>>> mail anyone@ok.domain
OK
>>> # Expect: OK
>>> mail bad-sender@ok.domain
OK
>>> #
>>> # Test check_mail_access()
>>> #
>>> recipient_restrictions hash:./smtpd_check_access
OK
>>> # Expect: REJECT
>>> rcpt reject@dunno.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@dunno.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject@dunno.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@dunno.domain>: Recipient address rejected: Access denied
>>> # Expect: REJECT
>>> recipient_delimiter +
OK
>>> rcpt reject+ext@dunno.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject+ext@dunno.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject+ext@dunno.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject+ext@dunno.domain>: Recipient address rejected: Access denied
>>> recipient_delimiter |
OK
>>> # Expect: OK
>>> rcpt ok@dunno.domain
OK
>>> # Expect: OK
>>> recipient_delimiter +
OK
>>> rcpt ok+ext@dunno.domain
OK
>>> recipient_delimiter |
OK
>>> # Expect: OK
>>> rcpt anyone@dunno.domain
OK
>>> # Expect: OK
>>> rcpt bad-sender@dunno.domain
OK
>>> #
>>> # Again, with a domain that rejects by default
>>> #
>>> # Expect: REJECT  
>>> rcpt reject@reject.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@reject.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@reject.domain>: Recipient address rejected: Access denied
>>> # Expect: OK
>>> rcpt ok@reject.domain
OK
>>> # Expect: REJECT
>>> rcpt anyone@reject.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <anyone@reject.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<anyone@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <anyone@reject.domain>: Recipient address rejected: Access denied
>>> # Expect: REJECT
>>> rcpt good-sender@reject.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <good-sender@reject.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<good-sender@reject.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <good-sender@reject.domain>: Recipient address rejected: Access denied
>>> #
>>> # Again, with a domain that accepts by default
>>> #
>>> # Expect: REJECT
>>> rcpt reject@ok.domain
./smtpd_check: <queue id>: reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 <reject@ok.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject@ok.domain> proto=SMTP helo=<foo.duuno.com>
554 5.7.1 <reject@ok.domain>: Recipient address rejected: Access denied
>>> # Expect: OK
>>> rcpt ok@ok.domain
OK
>>> # Expect: OK
>>> rcpt anyone@ok.domain
OK
>>> # Expect: OK
>>> rcpt bad-sender@ok.domain
OK
>>> #
>>> # check_sender_access specific
>>> #
>>> mail <>
./smtpd_check: <queue id>: reject: MAIL from bar.duno.com[44.33.44.33]: 550 5.7.1 <>: Sender address rejected: Go away postmaster; from=<> proto=SMTP helo=<foo.duuno.com>
550 5.7.1 <>: Sender address rejected: Go away postmaster