1 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx +
\b+ M
\bMa
\bai
\bil
\bld
\bdr
\bro
\bop
\bp H
\bHo
\bow
\bwt
\bto
\bo
3 -------------------------------------------------------------------------------
5 I
\bIn
\bnt
\btr
\bro
\bod
\bdu
\buc
\bct
\bti
\bio
\bon
\bn
7 This document discusses various options to plug the maildrop delivery agent
10 * Direct delivery without the local delivery agent
11 * Indirect delivery via the local delivery agent
14 D
\bDi
\bir
\bre
\bec
\bct
\bt d
\bde
\bel
\bli
\biv
\bve
\ber
\bry
\by w
\bwi
\bit
\bth
\bho
\bou
\but
\bt t
\bth
\bhe
\be l
\blo
\boc
\bca
\bal
\bl d
\bde
\bel
\bli
\biv
\bve
\ber
\bry
\by a
\bag
\bge
\ben
\bnt
\bt
16 Postfix can be configured to deliver mail directly to maildrop, without using
17 the local(8) delivery agent as an intermediate. This means that you do not get
18 local aliases(5) expansion or $HOME/.forward file processing. You would
19 typically do this for hosted domains with recipients that don't have UNIX home
22 The following example shows how to use maildrop for some.domain and for
23 someother.domain. The example comes in two parts.
25 Part 1 describes changes to the main.cf file:
27 1 /etc/postfix/main.cf:
28 2 maildrop_destination_recipient_limit = 1
29 3 virtual_mailbox_domains = some.domain someother.domain
30 4 virtual_transport = maildrop
31 5 virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
32 6 virtual_alias_maps = hash:/etc/postfix/virtual_alias
34 8 /etc/postfix/virtual_mailbox:
35 9 user1@some.domain ...text here does not matter...
36 10 user2@some.domain ...text here does not matter...
37 11 user3@someother.domain ...text here does not matter...
39 13 /etc/postfix/virtual_alias:
40 14 postmaster@some.domain postmaster
41 15 postmaster@someother.domain postmaster
43 * Line 2 is needed so that Postfix will provide one recipient at a time to
44 the maildrop delivery agent.
46 * Line 3 informs Postfix that some.domain and someother.domain are so-called
47 virtual mailbox domains. Instead of listing the names in main.cf you can
48 also list them in a file; see the virtual_mailbox_domains documentation for
51 * Line 4 specifies that mail for some.domain and someother.domain should be
52 delivered by the maildrop delivery agent.
54 * Lines 5 and 8-11 specify what recipients the Postfix SMTP server should
55 receive mail for. This prevents the mail queue from becoming clogged with
56 undeliverable messages. Specify an empty value ("virtual_mailbox_maps =")
57 to disable this feature.
59 * Lines 6 and 13-15 redirect mail for postmaster to the local postmaster. RFC
60 821 requires that every domain has a postmaster address.
62 The vmail userid as used below is the user that maildrop should run as. This
63 would be the owner of the virtual mailboxes if they all have the same owner. If
64 maildrop is suid (see maildrop documentation), then maildrop will change to the
65 appropriate owner to deliver the mail.
67 Note: Do not use the postfix user as the maildrop user.
69 Part 2 describes changes to the master.cf file:
71 /etc/postfix/master.cf:
72 maildrop unix - n n - - pipe
73 flags=ODRhu user=vmail argv=/path/to/maildrop -d ${recipient}
75 The pipe(8) manual page gives a detailed description of the above command line
78 If you want to support user+extension@domain style addresses, use the following
81 /etc/postfix/master.cf:
82 maildrop unix - n n - - pipe
83 flags=ODRhu user=vmail argv=/path/to/maildrop
84 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}
86 The mail is delivered to ${user}@${nexthop} (match key for maildrop userdb
87 lookup). The ${extension} and the other address components are available to
88 maildrop rules as $1, $2, $3, ... and can be omitted from master.cf or ignored
89 by maildrop when not needed.
91 I
\bIn
\bnd
\bdi
\bir
\bre
\bec
\bct
\bt d
\bde
\bel
\bli
\biv
\bve
\ber
\bry
\by v
\bvi
\bia
\ba t
\bth
\bhe
\be l
\blo
\boc
\bca
\bal
\bl d
\bde
\bel
\bli
\biv
\bve
\ber
\bry
\by a
\bag
\bge
\ben
\bnt
\bt
93 Postfix can be configured to deliver mail to maildrop via the local delivery
94 agent. This is slightly less efficient than the "direct" approach discussed
95 above, but gives you the convenience of local aliases(5) expansion and
96 $HOME/.forward file processing. You would typically use this for domains that
97 are listed in mydestination and that have users with a UNIX system account.
99 To configure maildrop delivery for all UNIX system accounts:
101 /etc/postfix/main.cf:
102 mailbox_command = /path/to/maildrop -d ${USER}
104 Note: ${USER} is spelled in upper case.
106 To enable maildrop delivery for specific users only, you can use the Postfix
107 local(8) delivery agent's mailbox_command_maps feature:
109 /etc/postfix/main.cf:
110 mailbox_command_maps = hash:/etc/postfix/mailbox_commands
112 /etc/postfix/mailbox_commands:
113 you /path/to/maildrop -d ${USER}
115 Maildrop delivery for specific users is also possible by invoking it from the
116 user's $HOME/.forward file:
119 "|/path/to/maildrop -d ${USER}"
121 C
\bCr
\bre
\bed
\bdi
\bit
\bts
\bs
123 * The original text was kindly provided by Russell Mosemann.
124 * Victor Duchovni provided tips for supporting user+foo@domain addresses.
125 * Tonni Earnshaw contributed text about delivery via the local(8) delivery