1
PPoossttffiixx ++ MMaaiillddrroopp HHoowwttoo
3
-------------------------------------------------------------------------------
5
IInnttrroodduuccttiioonn
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
DDiirreecctt ddeelliivveerryy wwiitthhoouutt tthhee llooccaall ddeelliivveerryy aaggeenntt
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
25
1 /etc/postfix/main.cf:
26
2 maildrop_destination_recipient_limit = 1
27
3 virtual_mailbox_domains = some.domain someother.domain
28
4 virtual_transport = maildrop
29
5 virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
30
6 virtual_alias_maps = hash:/etc/postfix/virtual_alias
32
8 /etc/postfix/virtual_mailbox:
33
9 user1@some.domain ...text here does not matter...
34
10 user2@some.domain ...text here does not matter...
35
11 user3@someother.domain ...text here does not matter...
37
13 /etc/postfix/virtual_alias:
38
14 postmaster@some.domain postmaster
39
15 postmaster@someother.domain postmaster
41
* Line 2 is needed so that Postfix will provide one recipient at a time to
42
the maildrop delivery agent.
44
* Line 3 informs Postfix that some.domain and someother.domain are so-called
45
virtual mailbox domains. Instead of listing the names in main.cf you can
46
also list them in a file; see the virtual_mailbox_domains documentation for
49
* Line 4 specifies that mail for some.domain and someother.domain should be
50
delivered by the maildrop delivery agent.
52
* Lines 5 and 8-11 specify what recipients the Postfix SMTP server should
53
receive mail for. This prevents the mail queue from becoming clogged with
54
undeliverable messages. Specify an empty value ("virtual_mailbox_maps =")
55
to disable this feature.
57
* Lines 6 and 13-15 redirect mail for postmaster to the local postmaster. RFC
58
821 requires that every domain has a postmaster address.
60
The vmail userid as used below is the user that maildrop should run as. This
61
would be the owner of the virtual mailboxes if they all have the same owner. If
62
maildrop is suid (see maildrop documentation), then maildrop will change to the
63
appropriate owner to deliver the mail.
65
Note: Do not use the postfix user as the maildrop user.
67
/etc/postfix/master.cf:
68
maildrop unix - n n - - pipe
69
flags=DRhu user=vmail argv=/path/to/maildrop -d ${recipient}
71
If you want to support user+extension@domain style addresses, use the following
74
/etc/postfix/master.cf:
75
maildrop unix - n n - - pipe
76
flags=DRhu user=vmail argv=/path/to/maildrop
77
-d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}
79
The mail is delivered to ${user}@${nexthop} (match key for maildrop userdb
80
lookup). The ${extension} and the other address components are available to
81
maildrop rules as $1, $2, $3, ... and can be omitted from master.cf or ignored
82
by maildrop when not needed.
84
IInnddiirreecctt ddeelliivveerryy vviiaa tthhee llooccaall ddeelliivveerryy aaggeenntt
86
Postfix can be configured to deliver mail to maildrop via the local delivery
87
agent. This is slightly less efficient than the "direct" approach discussed
88
above, but gives you the convenience of local aliases(5) expansion and
89
$HOME/.forward file processing. You would typically use this for domains that
90
are listed in mydestination and that have users with a UNIX system account.
92
To configure maildrop delivery for all UNIX system accounts:
95
mailbox_command = /path/to/maildrop -d ${USER}
97
Note: ${USER} is spelled in upper case.
99
To enable maildrop delivery for specific users only, you can use the Postfix
100
local(8) delivery agent's mailbox_command_maps feature:
102
/etc/postfix/main.cf:
103
mailbox_command_maps = /etc/postfix/mailbox_commands
105
/etc/postfix/mailbox_commands:
106
you /path/to/maildrop -d ${USER}
108
Maildrop delivery for specific users is also possible by invoking it from the
109
user's $HOME/.forward file:
112
"|/path/to/maildrop -d ${USER}"
116
* The original text was kindly provided by Russell Mosemann.
117
* Victor Duchovni provided tips for supporting user+foo@domain addresses.
118
* Tonni Earnshaw contributed text about delivery via the local(8) delivery