4 #! ../bin/postmap smtpd_check_access
7 mynetworks 127.0.0.0/8,168.100.189.0/28
8 relay_domains porcupine.org
9 maps_rbl_domains dnsbltest.porcupine.org
11 # Test the client restrictions.
13 client_restrictions permit_mynetworks,reject_unknown_client,check_client_access,hash:./smtpd_check_access
14 client unknown 131.155.210.17
15 client unknown 168.100.189.13
16 client random.bad.domain 123.123.123.123
17 client friend.bad.domain 123.123.123.123
18 client bad.domain 123.123.123.123
19 client wzv.win.tue.nl 131.155.210.17
20 client aa.win.tue.nl 131.155.210.18
21 client_restrictions permit_mynetworks
23 # Test the helo restrictions
25 helo_restrictions permit_mynetworks,reject_unknown_client,reject_invalid_hostname,reject_unknown_hostname,check_helo_access,hash:./smtpd_check_access
26 client unknown 131.155.210.17
28 client foo 123.123.123.123
31 helo spike.porcupine.org
32 helo_restrictions permit_mynetworks,reject_unknown_client,reject_invalid_hostname,check_helo_access,hash:./smtpd_check_access
33 helo random.bad.domain
34 helo friend.bad.domain
36 # Test the sender restrictions
38 sender_restrictions permit_mynetworks,reject_unknown_client
39 client unknown 131.155.210.17
40 mail foo@watson.ibm.com
41 client unknown 168.100.189.13
42 mail foo@watson.ibm.com
43 client foo 123.123.123.123
44 mail foo@watson.ibm.com
45 sender_restrictions reject_unknown_address
46 mail foo@watson.ibm.com
48 sender_restrictions check_sender_access,hash:./smtpd_check_access
49 mail bad-sender@any.domain
50 mail bad-sender@good.domain
51 mail reject@this.address
52 mail Reject@this.address
55 mail foo@random.bad.domain
56 mail foo@friend.bad.domain
58 # Test the recipient restrictions
60 recipient_restrictions permit_mynetworks,reject_unknown_client,check_relay_domains
61 client unknown 131.155.210.17
62 rcpt foo@watson.ibm.com
63 client unknown 168.100.189.13
64 rcpt foo@watson.ibm.com
65 client foo 123.123.123.123
66 rcpt foo@watson.ibm.com
67 rcpt foo@porcupine.org
68 recipient_restrictions check_relay_domains
69 client foo.porcupine.org 168.100.189.13
70 rcpt foo@watson.ibm.com
71 rcpt foo@porcupine.org
72 client foo 123.123.123.123
73 rcpt foo@watson.ibm.com
74 rcpt foo@porcupine.org
75 recipient_restrictions check_recipient_access,hash:./smtpd_check_access
76 mail bad-sender@any.domain
77 mail bad-sender@good.domain
78 mail reject@this.address
80 mail foo@random.bad.domain
81 mail foo@friend.bad.domain
85 client_restrictions reject_maps_rbl
86 client spike.porcupine.org 168.100.189.2
89 # unknown sender/recipient domain
91 unknown_address_reject_code 554
92 recipient_restrictions reject_unknown_recipient_domain,reject_unknown_sender_domain
93 mail wietse@porcupine.org
94 rcpt wietse@porcupine.org
95 rcpt wietse@no.recipient.domain
96 mail wietse@no.sender.domain
97 rcpt wietse@porcupine.org
99 # {permit_auth,reject_unauth}_destination
101 relay_domains foo.com,bar.com
103 recipient_restrictions permit_auth_destination,reject
106 recipient_restrictions reject_unauth_destination,permit
110 # unknown client tests
112 unknown_client_reject_code 550
113 client_restrictions reject_unknown_client
114 client spike.porcupine.org 160.100.189.2 2
115 client unknown 1.1.1.1 4
116 client unknown 1.1.1.1 5