Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / proto / MAILDROP_README.html
blob97a424ec07f6740c6b1461a61f3b8ca0e7872d09
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>Postfix + Maildrop Howto</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="">Postfix + Maildrop Howto</h1>
18 <hr>
20 <h2> Introduction </h2>
22 <p> This document discusses various options to plug the maildrop
23 delivery agent into Postfix: </p>
25 <ul>
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>
33 </ul>
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 maildrop,
38 without using the local(8) delivery agent as an intermediate. This
39 means that you do not get local aliases(5) expansion or $HOME/.forward
40 file processing. You would typically do this for hosted domains 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 main.cf file: </p>
48 <blockquote>
49 <pre>
50 1 /etc/postfix/main.cf:
51 2 maildrop_destination_recipient_limit = 1
52 3 virtual_mailbox_domains = some.domain someother.domain
53 4 virtual_transport = maildrop
54 5 virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
55 6 virtual_alias_maps = 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>
61 12
62 13 /etc/postfix/virtual_alias:
63 14 postmaster@some.domain postmaster
64 15 postmaster@someother.domain postmaster
65 </pre>
66 </blockquote>
68 <ul>
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 virtual mailbox domains.
75 Instead of listing the names in main.cf you can also
76 list them in a file; see the virtual_mailbox_domains documentation for
77 details. </p>
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 ("virtual_mailbox_maps =") to disable this feature. </p>
87 <li> <p> Lines 6 and 13-15 redirect mail for postmaster to the
88 local postmaster. RFC 821 requires that every domain has a postmaster
89 address. </p>
91 </ul>
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 master.cf file: </p>
103 <blockquote>
104 <pre>
105 /etc/postfix/master.cf:
106 maildrop unix - n n - - pipe
107 flags=ODRhu user=vmail argv=/path/to/maildrop -d ${recipient}
108 </pre>
109 </blockquote>
111 <p> The pipe(8) 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>
117 <blockquote>
118 <pre>
119 /etc/postfix/master.cf:
120 maildrop unix - n n - - pipe
121 flags=ODRhu user=vmail argv=/path/to/maildrop
122 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}
123 </pre>
124 </blockquote>
126 <p> The mail is delivered to ${user}@${nexthop} (match 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 master.cf or ignored by maildrop when not
130 needed. </p>
132 <h2><a name="indirect">Indirect delivery via the local delivery agent</a></h2>
134 <p> Postfix can be configured to deliver mail to maildrop via the
135 local delivery agent. This is slightly less efficient than the
136 "direct" approach discussed above, but gives you the convenience
137 of local aliases(5) expansion and $HOME/.forward file processing.
138 You would typically use this for domains that are listed in
139 mydestination and that have users with a UNIX system account. </p>
141 <p> To configure maildrop delivery for all UNIX system accounts: </p>
143 <blockquote>
144 <pre>
145 /etc/postfix/main.cf:
146 mailbox_command = /path/to/maildrop -d ${USER}
147 </pre>
148 </blockquote>
150 <p> Note: ${USER} is spelled in upper case. </p>
152 <p> To enable maildrop delivery for specific users only, you can
153 use the Postfix local(8) delivery agent's mailbox_command_maps feature:
154 </p>
156 <blockquote>
157 <pre>
158 /etc/postfix/main.cf:
159 mailbox_command_maps = hash:/etc/postfix/mailbox_commands
161 /etc/postfix/mailbox_commands:
162 you /path/to/maildrop -d ${USER}
163 </pre>
164 </blockquote>
166 <p> Maildrop delivery for specific users is also possible by
167 invoking it from the user's $HOME/.forward file: </p>
169 <blockquote>
170 <pre>
171 /home/you/.forward:
172 "|/path/to/maildrop -d ${USER}"
173 </pre>
174 </blockquote>
176 <h2><a name="credits">Credits</a></h2>
178 <ul>
180 <li> The original text was kindly provided by Russell Mosemann.
182 <li> Victor Duchovni provided tips for supporting user+foo@domain
183 addresses.
185 <li> Tonni Earnshaw contributed text about delivery via the local(8)
186 delivery agent.
188 </ul>
190 </body>
192 </html>