xref: /netbsd-src/external/ibm-public/postfix/dist/src/smtpd/smtpd_addr_valid.ref (revision 4a6720548cbf2e9325ed049c8a675ae86609f654)
1>>> #
2>>> # Initialize
3>>> #
4>>> smtpd_delay_reject 0
5OK
6>>> mynetworks 127.0.0.0/8,168.100.3.0/28
7OK
8>>> local_recipient_maps inline:{foo_canon=whatever,bar_canon=whatever}
9OK
10>>> mydestination example.com
11OK
12>>> myorigin example.com
13OK
14>>>
15>>> sender_canonical_maps inline:{foo@example.com=foo_canon@example.com}
16OK
17>>> recipient_canonical_maps inline:{bar@example.com=bar_canon@example.com}
18OK
19>>>
20>>> sender_restrictions reject_unlisted_sender
21OK
22>>> # Expect accept
23>>> mail bar_canon@example.com
24OK
25>>> # Expect accept
26>>> mail bar@example.com
27OK
28>>> # Expect accept
29>>> mail foo_canon@example.com
30OK
31>>> # Expect accept
32>>> mail foo@example.com
33OK
34>>> # Expect reject
35>>> mail baz@example.com
36./smtpd_check: <queue id>: reject: MAIL from localhost[127.0.0.1]: 550 5.1.0 <baz@example.com>: Sender address rejected: User unknown in local recipient table; from=<baz@example.com> proto=SMTP
37550 5.1.0 <baz@example.com>: Sender address rejected: User unknown in local recipient table
38>>>
39>>> recipient_restrictions reject_unlisted_recipient
40OK
41>>> # Expect accept
42>>> rcpt bar_canon@example.com
43OK
44>>> # Expect accept
45>>> rcpt bar@example.com
46OK
47>>> # Expect accept
48>>> rcpt foo_canon@example.com
49OK
50>>> # Expect reject
51>>> rcpt foo@example.com
52./smtpd_check: <queue id>: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <foo@example.com>: Recipient address rejected: User unknown in local recipient table; from=<baz@example.com> to=<foo@example.com> proto=SMTP
53550 5.1.1 <foo@example.com>: Recipient address rejected: User unknown in local recipient table
54>>> # Expect reject
55>>> mail baz@example.com
56./smtpd_check: <queue id>: reject: MAIL from localhost[127.0.0.1]: 550 5.1.0 <baz@example.com>: Sender address rejected: User unknown in local recipient table; from=<baz@example.com> proto=SMTP
57550 5.1.0 <baz@example.com>: Sender address rejected: User unknown in local recipient table
58