#
# Initialize
#
smtpd_delay_reject 0
mynetworks 127.0.0.0/8,168.100.3.0/28
relay_domains porcupine.org
smtpd_null_access_lookup_key <> 
#
# Test check_domain_access()
#
helo_restrictions hash:./smtpd_check_access
# Expect: REJECT
helo foo.dunno.com
# Expect: OK
helo bar.dunno.com
# Expect: OK
helo foo.duuno.com
#
# Test check_namadr_access(), domain part
#
client_restrictions hash:./smtpd_check_access
# Expect: REJECT
client foo.dunno.com 131.155.210.17
# Expect: OK
client bar.dunno.com 131.155.210.17
# Expect: OK
client bar.dunno.com 131.155.210.19
#
# Test check_namadr_access(), address part
#
# Expect: OK
client bar.duno.com 131.155.210.17
# Expect: REJECT
client bar.duno.com 131.155.210.19
# Expect: REJECT
client bar.duno.com 44.33.22.11
# Expect: OK
client bar.duno.com 44.33.22.55
# Expect: REJECT
client bar.duno.com 44.33.44.33
#
# Test check_mail_access()
#
sender_restrictions hash:./smtpd_check_access
# Expect: REJECT
mail reject@dunno.domain
# Expect: OK
mail ok@dunno.domain
# Expect: OK
mail anyone@dunno.domain
# Expect: OK
mail bad-sender@dunno.domain
#
# Again, with a domain that rejects by default
#
# Expect: REJECT  
mail reject@reject.domain
# Expect: OK
mail ok@reject.domain
# Expect: REJECT
mail anyone@reject.domain
# Expect: REJECT
mail good-sender@reject.domain
#
# Again, with a domain that accepts by default
#
# Expect: REJECT
mail reject@ok.domain
# Expect: OK
mail ok@ok.domain
# Expect: OK
mail anyone@ok.domain
# Expect: OK
mail bad-sender@ok.domain
#
# Test check_mail_access()
#
recipient_restrictions hash:./smtpd_check_access
# Expect: REJECT
rcpt reject@dunno.domain
# Expect: REJECT
recipient_delimiter +
rcpt reject+ext@dunno.domain
recipient_delimiter |
# Expect: OK
rcpt ok@dunno.domain
# Expect: OK
recipient_delimiter +
rcpt ok+ext@dunno.domain
recipient_delimiter |
# Expect: OK
rcpt anyone@dunno.domain
# Expect: OK
rcpt bad-sender@dunno.domain
#
# Again, with a domain that rejects by default
#
# Expect: REJECT  
rcpt reject@reject.domain
# Expect: OK
rcpt ok@reject.domain
# Expect: REJECT
rcpt anyone@reject.domain
# Expect: REJECT
rcpt good-sender@reject.domain
#
# Again, with a domain that accepts by default
#
# Expect: REJECT
rcpt reject@ok.domain
# Expect: OK
rcpt ok@ok.domain
# Expect: OK
rcpt anyone@ok.domain
# Expect: OK
rcpt bad-sender@ok.domain
#
# check_sender_access specific
#
mail <>
