~ubuntu-branches/ubuntu/hoary/postfix/hoary-security

« back to all changes in this revision

Viewing changes to README_FILES/MAILDROP_README

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-10-06 11:50:33 UTC
  • Revision ID: james.westby@ubuntu.com-20041006115033-ooo6yfg6kmoteu04
Tags: upstream-2.1.3
ImportĀ upstreamĀ versionĀ 2.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PPoossttffiixx ++ MMaaiillddrroopp HHoowwttoo
 
2
 
 
3
-------------------------------------------------------------------------------
 
4
 
 
5
IInnttrroodduuccttiioonn
 
6
 
 
7
This document discusses various options to plug the maildrop delivery agent
 
8
into Postfix:
 
9
 
 
10
  * Direct delivery without the local delivery agent
 
11
  * Indirect delivery via the local delivery agent
 
12
  * Credits
 
13
 
 
14
DDiirreecctt ddeelliivveerryy wwiitthhoouutt tthhee llooccaall ddeelliivveerryy aaggeenntt
 
15
 
 
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
 
20
directories.
 
21
 
 
22
The following example shows how to use maildrop for some.domain and for
 
23
someother.domain.
 
24
 
 
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
 
31
     7
 
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...
 
36
    12
 
37
    13 /etc/postfix/virtual_alias:
 
38
    14     postmaster@some.domain           postmaster
 
39
    15     postmaster@someother.domain      postmaster
 
40
 
 
41
  * Line 2 is needed so that Postfix will provide one recipient at a time to
 
42
    the maildrop delivery agent.
 
43
 
 
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
 
47
    details.
 
48
 
 
49
  * Line 4 specifies that mail for some.domain and someother.domain should be
 
50
    delivered by the maildrop delivery agent.
 
51
 
 
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.
 
56
 
 
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.
 
59
 
 
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.
 
64
 
 
65
Note: Do not use the postfix user as the maildrop user.
 
66
 
 
67
    /etc/postfix/master.cf:
 
68
        maildrop  unix  -       n       n       -       -       pipe
 
69
          flags=DRhu user=vmail argv=/path/to/maildrop -d ${recipient}
 
70
 
 
71
If you want to support user+extension@domain style addresses, use the following
 
72
instead:
 
73
 
 
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}
 
78
 
 
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.
 
83
 
 
84
IInnddiirreecctt ddeelliivveerryy vviiaa tthhee llooccaall ddeelliivveerryy aaggeenntt
 
85
 
 
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.
 
91
 
 
92
To configure maildrop delivery for all UNIX system accounts:
 
93
 
 
94
    /etc/postfix/main.cf:
 
95
        mailbox_command = /path/to/maildrop -d ${USER}
 
96
 
 
97
Note: ${USER} is spelled in upper case.
 
98
 
 
99
To enable maildrop delivery for specific users only, you can use the Postfix
 
100
local(8) delivery agent's mailbox_command_maps feature:
 
101
 
 
102
    /etc/postfix/main.cf:
 
103
        mailbox_command_maps = /etc/postfix/mailbox_commands
 
104
 
 
105
    /etc/postfix/mailbox_commands:
 
106
        you    /path/to/maildrop -d ${USER}
 
107
 
 
108
Maildrop delivery for specific users is also possible by invoking it from the
 
109
user's $HOME/.forward file:
 
110
 
 
111
    /home/you/.forward:
 
112
        "|/path/to/maildrop -d ${USER}"
 
113
 
 
114
CCrreeddiittss
 
115
 
 
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
 
119
    agent.
 
120