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
<a href=
"ADDRESS_CLASS_README.html#local_domain_class">local domains
</a> (domains that match
24 $
<a href=
"postconf.5.html#mydestination">mydestination
</a> or the IP addresses in $
<a href=
"postconf.5.html#inet_interfaces">inet_interfaces
</a> or
25 $
<a href=
"postconf.5.html#proxy_interfaces">proxy_interfaces
</a>) 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
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> parameter specifies lookup tables with
55 all names or addresses of local recipients. A recipient address is
56 local when its domain matches $
<a href=
"postconf.5.html#mydestination">mydestination
</a>, $
<a href=
"postconf.5.html#inet_interfaces">inet_interfaces
</a> or
57 $
<a href=
"postconf.5.html#proxy_interfaces">proxy_interfaces
</a>. If a local username or address is not listed in
58 $
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a>, 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
<a href=
"local.8.html">local(
8)
</a> delivery agent for local delivery, where
63 recipients are either UNIX accounts or local aliases:
</p>
67 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>:
68 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> =
<a href=
"proxymap.8.html">proxy
</a>:unix:passwd.byname $
<a href=
"postconf.5.html#alias_maps">alias_maps
</a>
72 <p> To turn off unknown local recipient rejects by the SMTP server,
77 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>:
78 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> =
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
<a href=
"local.8.html">local(
8)
</a>
96 delivery agent for domains matching $
<a href=
"postconf.5.html#mydestination">mydestination
</a>, $
<a href=
"postconf.5.html#inet_interfaces">inet_interfaces
</a>,
97 or $
<a href=
"postconf.5.html#proxy_interfaces">proxy_interfaces
</a>. For example, you redefined the
98 "<a href="postconf
.5.html#local_transport
">local_transport</a>" setting in
<a href=
"postconf.5.html">main.cf
</a>.
</p>
100 <p> Solution: your
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> 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 $
<a href=
"postconf.5.html#mydestination">mydestination
</a> etc. domains via the
<a href=
"virtual.8.html">virtual(
8)
</a> delivery agent,
107 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>
108 <a href=
"postconf.5.html#mydestination">mydestination
</a> = $
<a href=
"postconf.5.html#myhostname">myhostname
</a> localhost.$
<a href=
"postconf.5.html#mydomain">mydomain
</a> localhost ...
109 <a href=
"postconf.5.html#local_transport">local_transport
</a> = virtual
110 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> = $
<a href=
"postconf.5.html#virtual_mailbox_maps">virtual_mailbox_maps
</a>
113 <p> If you use a different delivery agent for $
<a href=
"postconf.5.html#mydestination">mydestination
</a>
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
<a href=
"postconf.5.html#mailbox_transport">mailbox_transport
</a> or
<a href=
"postconf.5.html#fallback_transport">fallback_transport
</a>
119 feature of the Postfix
<a href=
"local.8.html">local(
8)
</a> 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
126 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>
127 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> =
<a href=
"proxymap.8.html">proxy
</a>:unix:passwd.byname, $
<a href=
"postconf.5.html#alias_maps">alias_maps
</a>,
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
<a href=
"postconf.5.html#luser_relay">luser_relay
</a> feature of the Postfix
136 local delivery agent.
</p>
138 <p> Solution: you must disable the
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> feature
139 completely, so that Postfix accepts mail for all local addresses:
143 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>
144 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> =
149 <h2><a name=
"format">Local recipient table format
</a> </h2>
151 <p> If you use local files in
<a href=
"postmap.1.html">postmap(
1)
</a> format, then
152 <a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> 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
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a>.
165 <p> If you use lookup tables based on NIS, LDAP, MYSQL, or PGSQL,
166 then
<a href=
"postconf.5.html#local_recipient_maps">local_recipient_maps
</a> does the same queries as for local files
167 in
<a href=
"postmap.1.html">postmap(
1)
</a> 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>