Import ezmlm-idx 0.40
[ezmlm] / ezmlm-split.1
CommitLineData
f8beb284
MW
1.de Vb
2.ft CW
3.nf
4.ne \\$1
5..
6.de Ve
7.ft R
8
9.fi
10..
11.TH ezmlm-split 1
12.SH NAME
13ezmlm-split \- distribute (un)subscribe requests to sublists
14.SH SYNOPSIS
15.B ezmlm-split
16.I dir
17[
18.B \-dD
19][
20.I splitfile
21]
22.SH DESCRIPTION
23If the action is
24.I \-subscribe
25or
26.IR \-unsubscribe ,
27.B ezmlm-split
28analyzes the target of the request,
29 computing a hash in the range 0-52 from
30the address, and determines the ``domain key'', i.e.
31the two top levels of the host address in reverse order.
32Thus, the domain entry for ``d@a.b.c'' becomes ``c.b''
33and the one for ``d@a'' becomes ``a''.
34
35The hash and domain parts are then tested against successive lines of
36.I splitfile
37(default is
38.IR dir\fB/split ).
39If a match is found, the request is forwarded to the corresponding
40sublist, and
41.B ezmlm-split
42exits 99. If a match is not found or action is not
43.I \-subscribe
44or
45.IR \-unsubscribe ,
46.B ezmlm-split
47exits 0.
48
49In
50.IR splitfile ,
51blank lines and lines with ``#'' in position 1 are ignored. Other lines are
52expected to be of the format ``dom:low:hi:list@host'', where ``dom'' is
53the top level domain, ``low''-``hi'' the range of the hash (defaults 0 and 52),
54and ``list@host'' the name of the corresponding list (default is the
55local list). A line is considered to match if the address hash is
56between ``low'' and ``hi'' inclusive and ``dom'' is empty,
57or if the ``domain key'' matches ``dom'' for the full length of ``dom''. Thus,
58the address ``user@aol.com'' would match ``com'' and ``aol.com'',
59but not ``host.com''.
60
61If the domain
62specified is the top level domain up to 3 characters, the split is identical
63as that used by the SQL subscriber interface. This is recommended.
64There can be several entries for a given sublist.
65
66.B ezmlm-split
67can be used also for list with SQL-based sublisting. In this case,
68addresses matching the
69.I splitfile
70are forwarded to the respective non-SQL sublist, and non-matching addresses
71are handed by the SQL sublist.
72
73.SH OPTIONS
74.TP
75.B \-d
76(Default.)
77Do. Forward requests to the appropriate list.
78.TP
79.B \-D
80Do not process messages. Rather, read addresses, one per line from stdin, and
81print ``sublist@host: address'' where ``sublist@host'' is the address to which
82the request would have been forwarded in normal operation. This is used to
83process a set of existing addresses into a set of address collections, one
84per sublist. The output can be sorted and easily processed into a set of files,
85one per sublist containing the addresses that sublist handles.
86.SH "SPLIT LIST SETUP"
87To use a hierarchy of sublists, set up the master list and add a
88.B ezmlm-split
89line before the
90.B ezmlm-manage(1)
91line in
92.IR dir\fB/manager .
93Create any number of sublists of the main list on other local or
94distant hosts. Ideally, these should be non-archived, to point to the correct
95message numbers of the main list archive (see
96.BR ezmlm-send(1) .
97You can use
98.B ezmlm-make -C\fIezmlmsubrc
99for this. If you don't, use the text files from the main list, except
100.IR bounce-bottom .
101Next, create
102.I split
103in the main list directory to achieve an appropriate split. Load splitting
104between several local hosts is best achieved by hash, with a blank domain.
105Geographical splitting with hosts in different countries is best done
106via ``domain'' and naturally, a large domain can be subdivided by hash.
107
108Subscribers will receive all messages 'From:' the main list. When they
109subscribe or unsubscribe, the request will be forwarded to the appropriate
110sublist, which will handle the confirmation. All information, except
111.I bounce-bottom
112refers the user to the main list. Thus, to the user the list appears as
113a single list with the address of the main list, and distribution among
114sublists is at the discretion of the administrator of the main list.
115
116.SH "ADDING/REMOVING SUBLISTS"
117In general, the main list should be disabled, while changing the sublist
118split. This can be done by changing the mode of
119.I dir\fB/lock
120to 0 or by setting the sticky bit for the home directory of the user
121controlling the list.
122
123To remove a sublist, edit the lines for that sublist in the splitfile to
124point to another list, and add the existing subscribers of the removed
125sublist to the sublist taking the load.
126When splitting a sublist into several sublists, create the new sublists,
127and edit the split file to distribute the load
128between them (usually by hash). Process the subscribers of the old list
129with:
130
131.Vb 1
132 | ezmlm-split -D dir | sort | program
133.Ve
134where to get one file of addresses per new sublist, ``program'' could be:
135
136.Vb 12
137\&#!/usr/bin/perl
138\&while (<>) {
139\& ($f,$t) = split (':');
140\& $t =~ s/^\ //;
141\& if ($f ne $of) {
142\& $of = $f;
143\& close(OUT) if ($of);
144\& open(OUT,">$f") or die("Unable to open $f");
145\& }
146\& print OUT $t;
147\&}
148\&close(OUT) if ($of);
149.Ve
150
151Remove all subscribers from the old list,
152and add the respective subscribers to each list.
153
154For any more drastic reorganizations, collect all the subscribes of the
155affected sublists, create the new subscriber lists, and update the
156subscribers of the affected lists.
157
158Reorganizations are easier done when lists use SQL support. By
159temporarily using SQL support, reorganizations can be done on running
160lists even when normally using
161.B ezmlm-split
162and local subscriber databases.
163.SH "SEE ALSO"
164ezmlm-list(1),
165ezmlm-make(1),
166ezmlm-manage(1),
167ezmlm-sub(1)
168ezmlm-unsub(1),
169ezmlm(5),
170ezmlmrc(5),
171ezmlmsubrc(5)