aboutsummaryrefslogtreecommitdiffstats
path: root/admin/www/mailman-install/postfix-virtual.html
blob: cdfc060c85b75c1b1779900410cb9f00ec1bc97a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="mailman-install.css" type='text/css' />
<link rel="first" href="mailman-install.html" title='GNU Mailman - Installation Manual' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node15.html" />
<link rel="prev" href="node13.html" />
<link rel="parent" href="node12.html" />
<link rel="next" href="node15.html" />
<meta name='aesop' content='information' />
<title>6.1.2 Virtual domains</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.1.1 Integrating Postfix and"
  href="node13.html"><img src='previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.1 Using the Postfix"
  href="node12.html"><img src='up.png'
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.1.3 An alternative approach"
  href="node15.html"><img src='next.png'
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">GNU Mailman - Installation Manual</td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node13.html">6.1.1 Integrating Postfix and</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node12.html">6.1 Using the Postfix</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node15.html">6.1.3 An alternative approach</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->

<H3><A NAME="SECTION001612000000000000000"></A><A NAME="postfix-virtual"></A>
<BR>
6.1.2 Virtual domains
</H3>

<P>
Postfix 2.0 supports ``virtual alias domains'', essentially what used to be
called ``Postfix-style virtual domains'' in earlier Postfix versions.  To make
virtual alias domains work with Mailman, you need to do some setup in both
Postfix and Mailman.  Mailman will write all virtual alias mappings to a file
called, by default, <span class="file">/usr/local/mailman/data/virtual-mailman</span>.  It will
also use <b class="program">postmap</b> to create the <b class="program">virtual-mailman.db</b> file
that Postfix will actually use.

<P>
First, you need to set up the Postfix virtual alias domains as described in
the Postfix documentation (see Postfix's <code>virtual(5)</code> manpage).  Note
that it's your responsibility to include the <code>virtual-alias.domain
anything</code> line as described manpage; Mailman will not include this line in
<span class="file">virtual-mailman</span>.  You are highly encouraged to make sure your virtual
alias domains are working properly before integrating with Mailman.

<P>
Next, add a path to Postfix's <var>virtual_alias_maps</var> variable, pointing to
the virtual-mailman file, e.g.:

<P>
<div class="verbatim"><pre>
    virtual_alias_maps = &lt;your normal virtual alias files&gt;,
        hash:/usr/local/mailman/data/virtual-mailman
</pre></div>

<P>
assuming you've installed Mailman in the default location.  If you're using an
older version of Postfix which doesn't have the <var>virtual_alias_maps</var>
variable, use the <var>virtual_maps</var> variable instead.

<P>
Next, in your <span class="file">mm_cfg.py</span> file, you will want to set the variable
<var>POSTFIX_STYLE_VIRTUAL_DOMAINS</var> to the list of virtual domains that Mailman
should update.  This may not be all of the virtual alias domains that your
Postfix installation supports!  The values in this list will be matched
against the <var>host_name</var> attribute of mailing lists objects, and must be an
exact match.

<P>
Here's an example.  Say that Postfix is configured to handle the virtual
domains <code>dom1.ain</code>, <code>dom2.ain</code>, and <code>dom3.ain</code>, and further
that in your <span class="file">main.cf</span> file you've got the following settings:

<P>
<div class="verbatim"><pre>
    myhostname = mail.dom1.ain
    mydomain = dom1.ain
    mydestination = $myhostname, localhost.$mydomain
    virtual_alias_maps =
        hash:/some/path/to/virtual-dom1,
        hash:/some/path/to/virtual-dom2,
        hash:/some/path/to/virtual-dom2
</pre></div>

<P>
If in your <span class="file">virtual-dom1</span> file, you've got the following lines:

<P>
<div class="verbatim"><pre>
    dom1.ain  IGNORE
    @dom1.ain @mail.dom1.ain
</pre></div>

<P>
this tells Postfix to deliver anything addressed to <code>dom1.ain</code> to the
same mailbox at <code>mail.dom1.com</code>, its default destination.

<P>
In this case you would not include <code>dom1.ain</code> in
<var>POSTFIX_STYLE_VIRTUAL_DOMAINS</var> because otherwise Mailman will write
entries for mailing lists in the dom1.ain domain as

<P>
<div class="verbatim"><pre>
    mylist@dom1.ain         mylist
    mylist-request@dom1.ain mylist-request
    # and so on...
</pre></div>

<P>
The more specific entries trump your more general entries, thus breaking the
delivery of any <code>dom1.ain</code> mailing list.

<P>
However, you would include <code>dom2.ain</code> and <code>dom3.ain</code> in
<span class="file">mm_cfg.py</span>:

<P>
<div class="verbatim"><pre>
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['dom2.ain', 'dom3.ain']
</pre></div>

<P>
Now, any list that Mailman creates in either of those two domains, will have
the correct entries written to <span class="file">/usr/local/mailman/data/virtual-mailman</span>.

<P>
As above with the <span class="file">data/aliases*</span> files, you want to make sure that both
<span class="file">data/virtual-mailman</span> and <span class="file">data/virtual-mailman.db</span> are user and
group owned by <code>mailman</code>.

<P>

<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.1.1 Integrating Postfix and"
  href="node13.html"><img src='previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.1 Using the Postfix"
  href="node12.html"><img src='up.png'
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.1.3 An alternative approach"
  href="node15.html"><img src='next.png'
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">GNU Mailman - Installation Manual</td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
  border='0' height='32'  alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node13.html">6.1.1 Integrating Postfix and</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node12.html">6.1 Using the Postfix</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node15.html">6.1.3 An alternative approach</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.1, documentation updated on December 22, 2004.</span>
</DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>