Import ezmlm-idx 0.40
[ezmlm] / ezmlm-get.1
CommitLineData
f8beb284
MW
1.TH ezmlm-get 1
2.SH NAME
3ezmlm-get \- handles mailing list archive retrieval and digests
4.SH SYNOPSIS
5.B ezmlm-get
6[
7.B \-bBcCpPsSvV
8][
9.B \-f
10.I format
11]
12.I dir
13[
14.I digestcode[f]
15]
16.SH OPTIONS
17.TP
18.B \-b
19(Default.)
20Copy administrative information and the request to the bottom of replies.
21This informs the recipient of other commands, and allows some error tracking
22in case the recipient did not originate the request.
23.TP
24.B \-B
25Suppress the normal administrative information and request copy. This may make
26it harder for the recipient to diagnose problems and learn commands.
27.TP
28.B \-c
29(Default.)
30Process and reply to commands (does not affect digests).
31.TP
32.B \-C
33Ignore all commands except digest.
34.TP
35.B \-f \fIformat
36.B ezmlm-get
37will use
38.I format
39as the default format for all returned message collections. The default
40is 'm' for MIME with a header subset (see below). Format specifiers
41send with individual requests override the default set with the
42.B \-f
43switch.
44.TP
45.B \-p
46\-get, \-index, and \-thread commands are available to all users,
47provided other flags are permissive. This overrides normal behavior,
48which is to allow archive retrieval only to moderators, when
49.I dir\fB/public
50does not exist. This is useful to set up non-public lists that still give
51users archive access.
52.TP
53.B \-P
54\-get, \-index, and \-thread commands are available
55only to moderators, even if
56.I dir\fB/public
57exists. The
58.B \-C
59and
60.B \-s
61flags can restrict this further. This is useful for public lists with
62archive retrieval restricted to a subset of users (moderators).
63.TP
64.B \-s
65\-get, \-index, and \-thread requests are processed only if
66.B SENDER
67is a subscriber.
68.TP
69.B \-S
70(Default.)
71Anyone can issue \-get, \-index, and \-thread requests.
72.TP
73.B \-v
74Print version info.
75.TP
76.B \-V
77Print version info.
78.SH DESCRIPTION
79.B ezmlm-get
80handles archive retrieval and optionally makes and sends out
81digests for the mailing list
82stored in
83.IR dir .
84Subscribers of the digest list are stored in
85.IR dir\fB/digest/subscribers/ .
86
87The contents of
88.I dir\fB/headeradd
89are added to the header of outgoing messages.
90
91.B ezmlm-get
92is normally invoked from a
93.B .qmail(7)
94file.
95
96It reads a mail message from its standard input,
97and a mail envelope from the
98.BR SENDER ,
99.BR LOCAL ,
100and
101.BR HOST
102environment variables.
103
104.B ezmlm-get
105uses
106.B LOCAL
107to determine where it is invoked. If
108.B LOCAL
109is the list local name only,
110.B ezmlm-get
111assumes it is run from
112.I dir\fB/editor
113to produce a digest.
114The digest is sent directly to the digest list subscribers.
115
116If
117.B LOCAL
118is empty or undefined,
119.B ezmlm-get
120assumes it is run from the command line or a script. In this case
121it behaves as if run from
122.I dir\fB/editor
123and sends out a digest to the digest subscribers.
124
125Otherwise,
126.B ezmlm-get
127expects
128.B LOCAL
129to be of the form
130.IR list\fB-\fIaction .
131Here
132.I list
133is the first line of
134.IR dir\fB/inlocal
135and
136.I action
137is a request.
138The output is sent to the envelope sender.
139
140.BR ezmlm-get
141checks
142.I action
143for
144.BR dig\.\fIdigestcode ,
145.BR index ,
146.BR thread ,
147and
148.BR get .
149If
150.I action
151is one of these,
152.B ezmlm-get
153handles the request and sends a reply. If successful, it
154exits 99 (ignore remaining
155.B .qmail(7)
156file entries).
157If
158.I action
159is not one of these,
160.B ezmlm-get
161exits 0 (success) to pass the message on to later handlers,
162such as
163.BR ezmlm-manage(1) .
164
165.B ezmlm-get
166expects
167.B HOST
168to match the first line of
169.IR dir\fB/inhost .
170
171.BR ezmlm-dig\.\fIdigestcode
172returns a digest of messages received since the last digest, unless
173numerical arguments are given.
174.I digestcode
175must be alphanumeric, and match (case-insensitive)
176.I digestcode
177on the
178.B ezmlm-get
179command line. Otherwise, the request will be ignored. This is to restrict
180digest creation. The body of the requesting message up to the first line
181starting with '-' is copied into the
182.I administrivia
183section of the digest. This is followed by the contents of
184.IR dir\fB/text/digest ,
185if this file exists.
186
187.B Note:
188Anyone who can read your
189.I dir\fB/manager
190file, digest-requesting scripts, or mail log knows the
191.I digestcode
192and can trigger digests.
193
194.B ezmlm-get
195copies
196.I dir\fB/mailinglist
197into a
198.B Mailing-List
199field in its response.
200If the incoming message has a
201.B Mailing-List
202field,
203.B ezmlm-get
204refuses to respond.
205.B ezmlm-get
206also refuses to respond to bounce messages.
207
208If
209.I dir\fB/listid
210exists,
211.B ezmlm-get
212will assume that the format is correct and
213create a ``List-ID:'' header by placing the contents after the
214text ``List-ID: ''.
215
216If
217.I dir\fB/qmqpservers
218exists,
219.B ezmlm-get will use
220.B qmail-qmqp(1)
221to send digests. Other messages are sent by the normal qmail mechanism.
222
223If
224.I dir\fB/public
225does not exist,
226.B ezmlm-get
227rejects all archive retrieval attempts, unless the
228.B \-p
229command line switch is used.
230
231Archive retrieval actions can be of the form
232.BR action[f] ,
233.BR action[f].\fInum
234or
235.BR action[f].\fInum_num2 ,
236where
237.I num
238is the message number for the action or
239.I num_num2
240the range of message numbers for the action.
241
242.B f
243is an optional format specifier for
244.IR \-get ,
245.IR \-thread ,
246and
247.I \-dig
248requests. It is allowed, but ignored for
249.I \-index
250requests. Currently, the following are allowed:
251
252.TP
253.B r
254rfc1153. This is a ``plain'' non-MIME format for dumb clients.
255.TP
256.B m
257(Default.) MIME
258.I multipart/digest
259with a subset of ordered headers sorted.
260Currently, the following headers are
261included in the order listed:
262Date:,
263To:,
264From:,
265Reply-To:,
266Cc:,
267MIME-Version:,
268Content-Type:,
269Message-ID:,
270and Keywords:.
271This can be customized with the optional file
272.IR dir\fB/digheaders ,
273which should contain the desired headers up to but not including the colon.
274
275The format is no longer compliant
276with rfc1153, as the rfc1153 format is incompatible with rfc2046, which
277which the format is (should be) compatible.
278.TP
279.B x
280MIXED: This is the same as the default MIME
281format, except that the Content-Type is
282.IR multipart/mixed .
283This helps circumnavigate a Pine bug: when the digest is
284content-transfer-encoded, Pine will refuse to display the initial
285text/plain part of a
286.I multipart/digest
287message, but display the same part of a
288.I multipart/mixed
289message. Some MUAs for some strange reason treat the two multipart formats
290differently. In some cases, ``x'' works better than ``m''.
291.TP
292.B v
293VIRGIN: This is MIME
294.I multipart/digest
295with messages returned without any header filtering.
296.TP
297.B n
298NATIVE: This is VIRGIN format without threading, i.e. messages are
299presented in numerical order and the message index is suppressed.
300
301.PP
302For flexibility and backwards compatibility, the '.' separating the action from
303the first argument can be replaced by '\-',
304or omitted.
305Any non-alphanumeric character can separate
306.I num2
307from
308.IR num .
309.PP
310
311If
312.I action
313is
314.IR dig.digestcode ,
315.B ezmlm-get
316returns a digest of the messages received since the last digest, and updates
317the digest issue counter.
318
319If
320.I action
321is
322.IR get ,
323.B ezmlm-get
324sends back message(s)
325.I num
326or
327.I num
328through
329.IR num2 .
330from
331.IR dir\fB/archive/ .
332If
333.I num
334is omitted and
335.I dir\fB/dignum
336does not exist or is 0, the latest HISTGET message (default 30) are
337returned. Otherwise,
338the messages since the latest digest are returned including the last
339message in that digest, so that always at least 1 message is send. If the
340number of messages
341exceeds MAXGET (default 100), only the MAXGET last messages are returned.
342if
343.I num
344is greater than the latest message in the archive _and_
345.I num2
346is specified, the latest messages back to HISTGET before the end of the
347latest digest up to MAXGET messages are returned. This is a good way of
348always getting at least the latest 30 messages without knowing the latest
349message number. A link with such a command could be put into e.g.
350.IR dir\fB/text/sub-ok .
351
352.I num
353and
354.I num2
355are adjusted to make both > 0, and
356.I num2
357>=
358.IR num .
359If either is greater than
360the largest message number processed, it is silently
361set to the largest message number.
362At most 100 messages are
363returned.
364
365If
366.I action
367is
368.BI index ,
369.B ezmlm-get
370sends back the subjects and authors of the message(s)
371.I num
372or
373.IR num
374through
375.I num2
376in sets of 100 from
377.IR dir\fB/archive/ .
378.I num
379and
380.I num2
381are reasonable adjusted as for 'get'. No warnings are
382sent. At most 20 sets of 100 message entries are returned per request. If
383.I num
384is omitted,
385.B ezmlm-get
386returns the last 100-200 message entries, which automatically gives
387information about the last message number.
388
389If
390.I action
391is
392.BI thread ,
393.B ezmlm-get
394sends back the message(s) that have an index subject entry identical to
395that of message
396.I num
397from
398.IR dir\fB/archive/ .
399
400If
401.I num2
402is given it is ignored. If
403.I num
404is out of range, and error
405message is returned. The message range scanned for the subject is limited
406to 2000 messages before and after the master message, i.e. the
407.BR thread
408argument.
409This limit protects very large archives.
410Most threads are expected to be considerably more short-lived.
411In the unlikely event that there are further messages,
412these can be retrieved by a second request for the
413highest/lowest message returned in the first request.
414.SH "CHARACTER SETS"
415If
416.I dir\fB/charset
417exists,
418.B ezmlm-get
419will use the character set listed for all messages. Otherwise, the
420default ``us-ascii'' will be used. The character set can be suffixed
421by ``:'' followed by a code. If the code is ``Q'', outgoing messages are
422sent as ``Quoted-Printable'', if it is ``B'' they are sent ``base64'' encoded.
423Otherwise, text is sent as is.
424.SH "FILES"
425.TP
426.I dir\fB/dignum
427The last message included in the latest normal mode digest.
428.TP
429.I dir\fB/digissue
430The issue number of the latest normal mode digest.
431.TP
432.I dir\fB/text/get-bad
433Returned if a/the message cannot be found.
434.TP
435.I dir\fB/text/digest
436Copied into the
437.I Administrivia
438section of digests after the body of the requesting message.
439.TP
440.I dir\fB/charset
441The character set used for all
442.B ezmlm-get
443messages (see above).
444If not present, the default, ``us-ascii'', is used without encoding.
445.SH BUGS
446The digest format per rfc2046
447should (but is not required to) be multipart/mixed
448with the table-of-contents a text/plain part, and the entire remainder of
449the digest a multipart/digest part. The multipart/digest in turn should
450contain all the messages. Many
451MUA's fail to split out the individual messages from such a hierarchy, so the
452format used by
453.B ezmlm-get
454is a simple multipart/digest, explicitly typing the table-of-contents
455to text/plain, with the ``x'' format changing the mail content-type to
456multipart/mixed.
457.SH "SEE ALSO"
458ezmlm-make(1),
459ezmlm-manage(1),
460ezmlm-send(1),
461ezmlm(5),
462qmail-command(8),
463qmail-qmqp(1)
464