1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
8 <title>Rejecting Unknown Local Recipients with Postfix
</title>
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
16 <h1><img src=
"postfix-logo.jpg" width=
"203" height=
"98" ALT=
"">Rejecting Unknown Local Recipients with Postfix
</h1>
22 <p> As of Postfix version
2.0, the Postfix SMTP server rejects mail
23 for unknown recipients in local domains (domains that match
24 $mydestination or the IP addresses in $inet_interfaces or
25 $proxy_interfaces) with
"User unknown in local recipient table".
26 This feature was optional with earlier Postfix versions.
</p>
28 <p> The good news is that this keeps undeliverable mail out of your
29 queue, so that your mail queue is not clogged up with undeliverable
30 MAILER-DAEMON messages.
</p>
32 <p> The bad news is that it may cause mail to be rejected when you
33 upgrade from a Postfix system that was not configured to reject
34 mail for unknown local recipients.
</p>
36 <p> This document describes what steps are needed in order to reject
37 unknown local recipients correctly.
</p>
41 <li><a href=
"#main_config">Configuring local_recipient_maps
44 <li><a href=
"#change">When you need to change the local_recipient_maps
45 setting in main.cf
</a>
47 <li><a href=
"#format">Local recipient table format
</a>
51 <h2><a name=
"main_config">Configuring local_recipient_maps
54 <p> The local_recipient_maps parameter specifies lookup tables with
55 all names or addresses of local recipients. A recipient address is
56 local when its domain matches $mydestination, $inet_interfaces or
57 $proxy_interfaces. If a local username or address is not listed in
58 $local_recipient_maps, then the Postfix SMTP server will reject
59 the address with
"User unknown in local recipient table".
</p>
61 <p> The default setting, shown below, assumes that you use the
62 default Postfix local(
8) delivery agent for local delivery, where
63 recipients are either UNIX accounts or local aliases:
</p>
68 local_recipient_maps = proxy:unix:passwd.byname $alias_maps
72 <p> To turn off unknown local recipient rejects by the SMTP server,
78 local_recipient_maps =
82 <p> That is, an empty value. With this setting, the Postfix SMTP
83 server will not reject mail with
"User unknown in local recipient
84 table".
<b> Don't do this on systems that receive mail directly
85 from the Internet. With today's worms and viruses, Postfix will
86 become a backscatter source: it accepts mail for non-existent
87 recipients and then tries to return that mail as
"undeliverable"
88 to the often forged sender address
</b>.
</p>
90 <h2><a name=
"change">When you need to change the local_recipient_maps
91 setting in main.cf
</a></h2>
95 <li> <p> Problem: you don't use the default Postfix local(
8)
96 delivery agent for domains matching $mydestination, $inet_interfaces,
97 or $proxy_interfaces. For example, you redefined the
98 "local_transport" setting in main.cf.
</p>
100 <p> Solution: your local_recipient_maps setting needs to specify
101 a database that lists all the known user names or addresses
102 for that delivery agent. For example, if you deliver users in
103 $mydestination etc. domains via the virtual(
8) delivery agent,
108 mydestination = $myhostname localhost.$mydomain localhost ...
109 local_transport = virtual
110 local_recipient_maps = $virtual_mailbox_maps
113 <p> If you use a different delivery agent for $mydestination
114 etc. domains, see the section
"<a href="#format
">Local recipient
115 table format</a>" below for a description of how the table
116 should be populated.
</p>
118 <li> <p> Problem: you use the mailbox_transport or fallback_transport
119 feature of the Postfix local(
8) delivery agent in order to
120 deliver mail to non-UNIX accounts.
</p>
122 <p> Solution: you need to add the database that lists the
127 local_recipient_maps = proxy:unix:passwd.byname, $alias_maps,
128 <the database with non-UNIX accounts
>
131 <p> See the section
"<a href="#format
">Local recipient table
132 format</a>" below for a description of how the table should be
135 <li> <p> Problem: you use the luser_relay feature of the Postfix
136 local delivery agent.
</p>
138 <p> Solution: you must disable the local_recipient_maps feature
139 completely, so that Postfix accepts mail for all local addresses:
144 local_recipient_maps =
149 <h2><a name=
"format">Local recipient table format
</a> </h2>
151 <p> If you use local files in postmap(
1) format, then
152 local_recipient_maps expects the following table format:
</p>
156 <li> <p> In the left-hand side, specify a bare username, an
157 "@domain.tld" wild-card, or specify a complete
"user@domain.tld"
160 <li> <p> You have to specify something on the right-hand side of
161 the table, but the value is ignored by local_recipient_maps.
165 <p> If you use lookup tables based on NIS, LDAP, MYSQL, or PGSQL,
166 then local_recipient_maps does the same queries as for local files
167 in postmap(
1) format, and expects the same results.
</p>
169 <p> With regular expression tables, Postfix only queries with the
170 full recipient address, and not with the bare username or the
171 "@domain.tld" wild-card.
</p>
173 <p> NOTE: a lookup table should always return a result when the address
174 exists, and should always return
"not found" when the address does
175 not exist. In particular, a zero-length result does not count as
176 a
"not found" result.
</p>