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,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,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,hash:./smtpd_check_access
33 helo random.bad.domain
34 helo friend.bad.domain
35 helo_restrictions reject_invalid_hostname,reject_unknown_hostname
37 helo [123.123.123.123]
41 helo_restrictions permit_naked_ip_address,reject_invalid_hostname,reject_unknown_hostname
44 # Test the sender restrictions
46 sender_restrictions permit_mynetworks,reject_unknown_client
47 client unknown 131.155.210.17
48 mail foo@watson.ibm.com
49 client unknown 168.100.189.13
50 mail foo@watson.ibm.com
51 client foo 123.123.123.123
52 mail foo@watson.ibm.com
53 sender_restrictions reject_unknown_address
54 mail foo@watson.ibm.com
56 sender_restrictions hash:./smtpd_check_access
57 mail bad-sender@any.domain
58 mail bad-sender@good.domain
59 mail reject@this.address
60 mail Reject@this.address
63 mail foo@random.bad.domain
64 mail foo@friend.bad.domain
66 # Test the recipient restrictions
68 recipient_restrictions permit_mynetworks,reject_unknown_client,check_relay_domains
69 client unknown 131.155.210.17
70 rcpt foo@watson.ibm.com
71 client unknown 168.100.189.13
72 rcpt foo@watson.ibm.com
73 client foo 123.123.123.123
74 rcpt foo@watson.ibm.com
75 rcpt foo@porcupine.org
76 recipient_restrictions check_relay_domains
77 client foo.porcupine.org 168.100.189.13
78 rcpt foo@watson.ibm.com
79 rcpt foo@porcupine.org
80 client foo 123.123.123.123
81 rcpt foo@watson.ibm.com
82 rcpt foo@porcupine.org
83 recipient_restrictions hash:./smtpd_check_access
84 mail bad-sender@any.domain
85 mail bad-sender@good.domain
86 mail reject@this.address
88 mail foo@random.bad.domain
89 mail foo@friend.bad.domain
93 client_restrictions reject_maps_rbl
94 client spike.porcupine.org 168.100.189.2
99 recipient_restrictions check_relay_domains
100 client foo 131.155.210.17
101 rcpt foo@watson.ibm.com
102 recipient_restrictions check_client_access,hash:./smtpd_check_access,check_relay_domains
103 client foo 131.155.210.17
104 rcpt foo@porcupine.org
105 helo_restrictions permit_mynetworks,reject_unknown_client,reject_invalid_hostname,hash:./smtpd_check_access
106 recipient_restrictions check_helo_access,hash:./smtpd_check_access,check_relay_domains
108 rcpt foo@porcupine.org
110 rcpt foo@porcupine.org
111 recipient_restrictions check_sender_access,hash:./smtpd_check_access,check_relay_domains
113 rcpt foo@porcupine.org
114 mail foo@friend.bad.domain
115 rcpt foo@porcupine.org
119 #mydestination spike.porcupine.org,localhost.porcupine.org
120 #inet_interfaces 168.100.189.2,127.0.0.1
121 #recipient_restrictions permit_mx_backup,reject
122 #rcpt wietse@wzv.win.tue.nl
123 #rcpt wietse@trouble.org
124 #rcpt wietse@porcupine.org
126 # Deferred restrictions
128 client_restrictions permit
129 helo_restrictions permit
130 sender_restrictions permit
131 recipient_restrictions check_helo_access,hash:./smtpd_check_access,check_sender_access,hash:./smtpd_check_access
134 rcpt foo@porcupine.org
137 rcpt foo@porcupine.org
141 helo_restrictions reject_non_fqdn_hostname
142 sender_restrictions reject_non_fqdn_sender
143 recipient_restrictions reject_non_fqdn_recipient
156 # Numerical HELO checks
158 helo_restrictions permit_naked_ip_address,reject_non_fqdn_hostname
160 helo [321.255.255.255]
178 # The defer restriction
181 helo_restrictions defer