1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
8 <title>Postfix + Maildrop Howto
</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=
"">Postfix + Maildrop Howto
</h1>
20 <h2> Introduction
</h2>
22 <p> This document discusses various options to plug the maildrop
23 delivery agent into Postfix:
</p>
27 <li><a href=
"#direct">Direct delivery without the local delivery agent
</a>
29 <li><a href=
"#indirect">Indirect delivery via the local delivery agent
</a>
31 <li><a href=
"#credits">Credits
</a>
35 <h2><a name=
"direct">Direct delivery without the local delivery agent
</a></h2>
37 <p> Postfix can be configured to deliver mail directly to
<a href=
"QSHAPE_README.html#maildrop_queue">maildrop
</a>,
38 without using the
<a href=
"local.8.html">local(
8)
</a> delivery agent as an intermediate. This
39 means that you do not get local
<a href=
"aliases.5.html">aliases(
5)
</a> expansion or $HOME/.forward
40 file processing. You would typically do this for
<a href=
"VIRTUAL_README.html#canonical">hosted domains
</a> with
41 recipients that don't have UNIX home directories.
</p>
43 <p> The following example shows how to use maildrop for some.domain
44 and for someother.domain. The example comes in two parts.
</p>
46 <p> Part
1 describes changes to the
<a href=
"postconf.5.html">main.cf
</a> file:
</p>
50 1 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>:
51 2 maildrop_destination_recipient_limit =
1
52 3 <a href=
"postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains
</a> = some.domain someother.domain
53 4 <a href=
"postconf.5.html#virtual_transport">virtual_transport
</a> = maildrop
54 5 <a href=
"postconf.5.html#virtual_mailbox_maps">virtual_mailbox_maps
</a> = hash:/etc/postfix/virtual_mailbox
55 6 <a href=
"postconf.5.html#virtual_alias_maps">virtual_alias_maps
</a> = hash:/etc/postfix/virtual_alias
57 8 /etc/postfix/virtual_mailbox:
58 9 user1@some.domain
<i>...text here does not matter...
</i>
59 10 user2@some.domain
<i>...text here does not matter...
</i>
60 11 user3@someother.domain
<i>...text here does not matter...
</i>
62 13 /etc/postfix/virtual_alias:
63 14 postmaster@some.domain postmaster
64 15 postmaster@someother.domain postmaster
70 <li> <p> Line
2 is needed so that Postfix will provide one recipient
71 at a time to the maildrop delivery agent.
</p>
73 <li> <p> Line
3 informs Postfix that some.domain and someother.domain
74 are so-called
<a href=
"ADDRESS_CLASS_README.html#virtual_mailbox_class">virtual mailbox domains
</a>.
75 Instead of listing the names in
<a href=
"postconf.5.html">main.cf
</a> you can also
76 list them in a file; see the
<a href=
"postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains
</a> documentation for
79 <li> <p> Line
4 specifies that mail for some.domain and someother.domain
80 should be delivered by the maildrop delivery agent.
</p>
82 <li> <p> Lines
5 and
8-
11 specify what recipients the Postfix SMTP
83 server should receive mail for. This prevents the mail queue from
84 becoming clogged with undeliverable messages. Specify an empty
85 value (
"<a href="postconf
.5.html#virtual_mailbox_maps
">virtual_mailbox_maps</a> =") to disable this feature.
</p>
87 <li> <p> Lines
6 and
13-
15 redirect mail for postmaster to the
88 local postmaster.
<a href=
"http://tools.ietf.org/html/rfc821">RFC
821</a> requires that every domain has a postmaster
93 <p> The vmail userid as used below is the user that maildrop should
94 run as. This would be the owner of the virtual mailboxes if they
95 all have the same owner. If maildrop is suid (see maildrop
96 documentation), then maildrop will change to the appropriate owner
97 to deliver the mail.
</p>
99 <p> Note: Do not use the postfix user as the maildrop user.
</p>
101 <p> Part
2 describes changes to the
<a href=
"master.5.html">master.cf
</a> file:
</p>
105 /etc/postfix/
<a href=
"master.5.html">master.cf
</a>:
106 maildrop unix - n n - - pipe
107 flags=ODRhu user=vmail argv=/path/to/maildrop -d ${recipient}
111 <p> The
<a href=
"pipe.8.html">pipe(
8)
</a> manual page gives a detailed description of the
112 above command line arguments, and more.
</p>
114 <p> If you want to support user+extension@domain style addresses,
115 use the following instead:
</p>
119 /etc/postfix/
<a href=
"master.5.html">master.cf
</a>:
120 maildrop unix - n n - - pipe
121 flags=ODRhu user=vmail argv=/path/to/maildrop
122 -d ${user}@${domain} ${extension} ${recipient} ${user} ${nexthop}
126 <p> The mail is delivered to ${user}@${domain} (search key for
127 maildrop userdb lookup). The ${extension} and the other address
128 components are available to maildrop rules as $
1, $
2, $
3, ... and
129 can be omitted from
<a href=
"master.5.html">master.cf
</a> or ignored by maildrop when not
132 <p> With Postfix
2.4 and earlier, use ${nexthop} instead of ${domain}.
135 <h2><a name=
"indirect">Indirect delivery via the local delivery agent
</a></h2>
137 <p> Postfix can be configured to deliver mail to maildrop via the
138 local delivery agent. This is slightly less efficient than the
139 "direct" approach discussed above, but gives you the convenience
140 of local
<a href=
"aliases.5.html">aliases(
5)
</a> expansion and $HOME/.forward file processing.
141 You would typically use this for domains that are listed in
142 <a href=
"postconf.5.html#mydestination">mydestination
</a> and that have users with a UNIX system account.
</p>
144 <p> To configure maildrop delivery for all UNIX system accounts:
</p>
148 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>:
149 <a href=
"postconf.5.html#mailbox_command">mailbox_command
</a> = /path/to/maildrop -d ${USER}
153 <p> Note: ${USER} is spelled in upper case.
</p>
155 <p> To enable maildrop delivery for specific users only, you can
156 use the Postfix
<a href=
"local.8.html">local(
8)
</a> delivery agent's
<a href=
"postconf.5.html#mailbox_command_maps">mailbox_command_maps
</a> feature:
161 /etc/postfix/
<a href=
"postconf.5.html">main.cf
</a>:
162 <a href=
"postconf.5.html#mailbox_command_maps">mailbox_command_maps
</a> = hash:/etc/postfix/mailbox_commands
164 /etc/postfix/mailbox_commands:
165 you /path/to/maildrop -d ${USER}
169 <p> Maildrop delivery for specific users is also possible by
170 invoking it from the user's $HOME/.forward file:
</p>
175 "|/path/to/maildrop -d ${USER}"
179 <h2><a name=
"credits">Credits
</a></h2>
183 <li> The original text was kindly provided by Russell Mosemann.
185 <li> Victor Duchovni provided tips for supporting user+foo@domain
188 <li> Tonni Earnshaw contributed text about delivery via the
<a href=
"local.8.html">local(
8)
</a>