1>>> # 2>>> # Initialize 3>>> # 4>>> smtpd_delay_reject 0 5OK 6>>> mynetworks 127.0.0.0/8,168.100.3.0/28 7OK 8>>> relay_domains porcupine.org 9OK 10>>> smtpd_null_access_lookup_key <> 11OK 12>>> # 13>>> # Test check_domain_access() 14>>> # 15>>> helo_restrictions hash:./smtpd_check_access 16OK 17>>> # Expect: REJECT 18>>> helo foo.dunno.com 19./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> 20554 5.7.1 <foo.dunno.com>: Helo command rejected: Access denied 21>>> # Expect: OK 22>>> helo bar.dunno.com 23OK 24>>> # Expect: OK 25>>> helo foo.duuno.com 26OK 27>>> # 28>>> # Test check_namadr_access(), domain part 29>>> # 30>>> client_restrictions hash:./smtpd_check_access 31OK 32>>> # Expect: REJECT 33>>> client foo.dunno.com 131.155.210.17 34./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> 35554 5.7.1 <foo.dunno.com[131.155.210.17]>: Client host rejected: Access denied 36>>> # Expect: OK 37>>> client bar.dunno.com 131.155.210.17 38OK 39>>> # Expect: OK 40>>> client bar.dunno.com 131.155.210.19 41OK 42>>> # 43>>> # Test check_namadr_access(), address part 44>>> # 45>>> # Expect: OK 46>>> client bar.duno.com 131.155.210.17 47OK 48>>> # Expect: REJECT 49>>> client bar.duno.com 131.155.210.19 50./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> 51554 5.7.1 <bar.duno.com[131.155.210.19]>: Client host rejected: Access denied 52>>> # Expect: REJECT 53>>> client bar.duno.com 44.33.22.11 54./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> 55554 5.7.1 <bar.duno.com[44.33.22.11]>: Client host rejected: Access denied 56>>> # Expect: OK 57>>> client bar.duno.com 44.33.22.55 58OK 59>>> # Expect: REJECT 60>>> client bar.duno.com 44.33.44.33 61./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> 62554 5.7.1 <bar.duno.com[44.33.44.33]>: Client host rejected: Access denied 63>>> # 64>>> # Test check_mail_access() 65>>> # 66>>> sender_restrictions hash:./smtpd_check_access 67OK 68>>> # Expect: REJECT 69>>> mail reject@dunno.domain 70./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> 71554 5.7.1 <reject@dunno.domain>: Sender address rejected: Access denied 72>>> # Expect: OK 73>>> mail ok@dunno.domain 74OK 75>>> # Expect: OK 76>>> mail anyone@dunno.domain 77OK 78>>> # Expect: OK 79>>> mail bad-sender@dunno.domain 80OK 81>>> # 82>>> # Again, with a domain that rejects by default 83>>> # 84>>> # Expect: REJECT 85>>> mail reject@reject.domain 86./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> 87554 5.7.1 <reject@reject.domain>: Sender address rejected: Access denied 88>>> # Expect: OK 89>>> mail ok@reject.domain 90OK 91>>> # Expect: REJECT 92>>> mail anyone@reject.domain 93./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> 94554 5.7.1 <anyone@reject.domain>: Sender address rejected: Access denied 95>>> # Expect: REJECT 96>>> mail good-sender@reject.domain 97./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> 98554 5.7.1 <good-sender@reject.domain>: Sender address rejected: Access denied 99>>> # 100>>> # Again, with a domain that accepts by default 101>>> # 102>>> # Expect: REJECT 103>>> mail reject@ok.domain 104./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> 105554 5.7.1 <reject@ok.domain>: Sender address rejected: Access denied 106>>> # Expect: OK 107>>> mail ok@ok.domain 108OK 109>>> # Expect: OK 110>>> mail anyone@ok.domain 111OK 112>>> # Expect: OK 113>>> mail bad-sender@ok.domain 114OK 115>>> # 116>>> # Test check_mail_access() 117>>> # 118>>> recipient_restrictions hash:./smtpd_check_access 119OK 120>>> # Expect: REJECT 121>>> rcpt reject@dunno.domain 122./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> 123554 5.7.1 <reject@dunno.domain>: Recipient address rejected: Access denied 124>>> # Expect: REJECT 125>>> recipient_delimiter + 126OK 127>>> rcpt reject+ext@dunno.domain 128./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> 129554 5.7.1 <reject+ext@dunno.domain>: Recipient address rejected: Access denied 130>>> recipient_delimiter | 131OK 132>>> # Expect: OK 133>>> rcpt ok@dunno.domain 134OK 135>>> # Expect: OK 136>>> recipient_delimiter + 137OK 138>>> rcpt ok+ext@dunno.domain 139OK 140>>> recipient_delimiter | 141OK 142>>> # Expect: OK 143>>> rcpt anyone@dunno.domain 144OK 145>>> # Expect: OK 146>>> rcpt bad-sender@dunno.domain 147OK 148>>> # 149>>> # Again, with a domain that rejects by default 150>>> # 151>>> # Expect: REJECT 152>>> rcpt reject@reject.domain 153./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> 154554 5.7.1 <reject@reject.domain>: Recipient address rejected: Access denied 155>>> # Expect: OK 156>>> rcpt ok@reject.domain 157OK 158>>> # Expect: REJECT 159>>> rcpt anyone@reject.domain 160./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> 161554 5.7.1 <anyone@reject.domain>: Recipient address rejected: Access denied 162>>> # Expect: REJECT 163>>> rcpt good-sender@reject.domain 164./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> 165554 5.7.1 <good-sender@reject.domain>: Recipient address rejected: Access denied 166>>> # 167>>> # Again, with a domain that accepts by default 168>>> # 169>>> # Expect: REJECT 170>>> rcpt reject@ok.domain 171./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> 172554 5.7.1 <reject@ok.domain>: Recipient address rejected: Access denied 173>>> # Expect: OK 174>>> rcpt ok@ok.domain 175OK 176>>> # Expect: OK 177>>> rcpt anyone@ok.domain 178OK 179>>> # Expect: OK 180>>> rcpt bad-sender@ok.domain 181OK 182>>> # 183>>> # check_sender_access specific 184>>> # 185>>> mail <> 186./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> 187550 5.7.1 <>: Sender address rejected: Go away postmaster 188