autoupdate
[postfix-master.git] / postfix-master / LOCAL_RECIPIENT_README.html
blob3f2e0420038c4fab337a729788165dc9dfb9f8b8
1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
6 <head>
8 <title>Rejecting Unknown Local Recipients with Postfix</title>
10 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
12 </head>
14 <body>
16 <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Rejecting Unknown Local Recipients with Postfix</h1>
18 <hr>
20 <h2>Introduction</h2>
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>
39 <ul>
41 <li><a href="#main_config">Configuring local_recipient_maps
42 in main.cf</a>
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>
49 </ul>
51 <h2><a name="main_config">Configuring local_recipient_maps
52 in main.cf</a></h2>
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>
65 <blockquote>
66 <pre>
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>
69 </pre>
70 </blockquote>
72 <p> To turn off unknown local recipient rejects by the SMTP server,
73 specify: </p>
75 <blockquote>
76 <pre>
77 /etc/postfix/<a href="postconf.5.html">main.cf</a>:
78 <a href="postconf.5.html#local_recipient_maps">local_recipient_maps</a> =
79 </pre>
80 </blockquote>
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>
93 <ul>
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,
104 specify: </p>
106 <pre>
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>
111 </pre>
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
123 non-UNIX users: </p>
125 <pre>
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 &lt;the database with non-UNIX accounts&gt;
129 </pre>
131 <p> See the section "<a href="#format">Local recipient table
132 format</a>" below for a description of how the table should be
133 populated. </p>
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:
140 </p>
142 <pre>
143 /etc/postfix/<a href="postconf.5.html">main.cf</a>
144 <a href="postconf.5.html#local_recipient_maps">local_recipient_maps</a> =
145 </pre>
147 </ul>
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>
154 <ul>
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"
158 address. </p>
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>.
163 </ul>
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>
178 </body>
180 </html>