>>> # >>> # Initialize >>> # >>> smtpd_delay_reject 0 OK >>> mynetworks 127.0.0.0/8,168.100.189.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: : reject: HELO from localhost[127.0.0.1]: 554 5.7.1 : Helo command rejected: Access denied; proto=SMTP helo= 554 5.7.1 : 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: : reject: CONNECT from foo.dunno.com[131.155.210.17]: 554 5.7.1 : Client host rejected: Access denied; proto=SMTP helo= 554 5.7.1 : 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: : reject: CONNECT from bar.duno.com[131.155.210.19]: 554 5.7.1 : Client host rejected: Access denied; proto=SMTP helo= 554 5.7.1 : Client host rejected: Access denied >>> # Expect: REJECT >>> client bar.duno.com 44.33.22.11 ./smtpd_check: : reject: CONNECT from bar.duno.com[44.33.22.11]: 554 5.7.1 : Client host rejected: Access denied; proto=SMTP helo= 554 5.7.1 : 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: : reject: CONNECT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Client host rejected: Access denied; proto=SMTP helo= 554 5.7.1 : Client host rejected: Access denied >>> # >>> # Test check_mail_access() >>> # >>> sender_restrictions hash:./smtpd_check_access OK >>> # Expect: REJECT >>> mail reject@dunno.domain ./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 5.7.1 : 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: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 5.7.1 : Sender address rejected: Access denied >>> # Expect: OK >>> mail ok@reject.domain OK >>> # Expect: REJECT >>> mail anyone@reject.domain ./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 5.7.1 : Sender address rejected: Access denied >>> # Expect: REJECT >>> mail good-sender@reject.domain ./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 5.7.1 : Sender address rejected: Access denied >>> # >>> # Again, with a domain that accepts by default >>> # >>> # Expect: REJECT >>> mail reject@ok.domain ./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 5.7.1 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 5.7.1 : 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: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : Recipient address rejected: Access denied >>> # Expect: REJECT >>> recipient_delimiter + OK >>> rcpt reject+ext@dunno.domain ./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : 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: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : Recipient address rejected: Access denied >>> # Expect: OK >>> rcpt ok@reject.domain OK >>> # Expect: REJECT >>> rcpt anyone@reject.domain ./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : Recipient address rejected: Access denied >>> # Expect: REJECT >>> rcpt good-sender@reject.domain ./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : Recipient address rejected: Access denied >>> # >>> # Again, with a domain that accepts by default >>> # >>> # Expect: REJECT >>> rcpt reject@ok.domain ./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 5.7.1 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 5.7.1 : 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: : reject: MAIL from bar.duno.com[44.33.44.33]: 550 5.7.1 <>: Sender address rejected: Go away postmaster; from=<> proto=SMTP helo= 550 5.7.1 <>: Sender address rejected: Go away postmaster