134bc6ee7ab0210f36ebb1e87e219c1aaedfd6b4
[eoc.git] / enemies-of-carlotta.1
1 .TH ENEMIES\-OF\-CARLOTTA 1
2 .SH NAME
3 enemies\-of\-carlotta \- a simple mailing list manager
4 .SH SYNOPSIS
5 .B enemies\-of\-carlotta 
6 .IR "" [ options "] [" addresses ]
7 .SH "DESCRIPTION"
8 .B enemies\-of\-carlotta
9 is a simple mailing list manager.
10 If you don't know what a mailing list manager is, you should learn
11 what they are before trying to use one.
12 A manual page is unfortunately too short to explain it.
13 .PP
14 Enemies of Carlotta keeps all data about the lists in the
15 .I ~/.enemies\-of\-carlotta
16 directory.
17 It will be created automatically when you create your first list.
18 You need to arrange manually for the mails to be processed by the
19 list manager.
20 The details differ from mail system to another.
21 For QMail and Postfix, see below.
22 .PP
23 Each list has one or more owners, who also moderate subscriptions or
24 moderate some or all postings.
25 On completely unmoderated lists the list owners are responsible for
26 answering questions about the list.
27 On completely moderated lists, they have to approve each message before
28 it is sent to the list.
29 On lists with 
30 .IR posting=auto ,
31 messages from subscribers are sent automatically to the list, and the
32 moderators have to approve the rest.
33 .SH OPTIONS
34 .TP
35 .BR \-\-name= foo@example.com
36 Specify the list the command is to operate on.
37 Most of the remaining options require you to set the list name with this
38 option.
39 With the \-\-edit, \-\-subscribe, \-\-unsubscribe, and \-\-list options,
40 the name can be abbreviated to by leaving out the @ sign and domain.
41 .TP
42 .BI \-\-create
43 Create a new list.
44 You must specify at least one owner with
45 .BR \-\-owner .
46 .TP
47 .BI \-\-owner= address
48 Specify a list owner when creating or editing a list.
49 .TP
50 .BI \-\-moderator= address
51 Specificy a list moderator when creating or editing a list.
52 .TP
53 .BI \-\-language= language\-code
54 Set the language code used for looking up template files.
55 The code should be empty (the default, meaning English), or a two\-letter
56 code such as 
57 .B fi
58 or
59 .BR es .
60 .TP
61 .B \-\-cleaning\-woman
62 Deal with bouncing addresses and do other cleanup.
63 You must run
64 .B "enemies\-of\-carlotta \-\-cleaning\-woman"
65 periodically, such as once per hour.
66 It will clean up all your lists.
67 .TP
68 .BI \-\-destroy
69 Destroy the list.
70 .TP
71 .BI \-\-edit
72 Modify the list configuration.
73 .TP
74 .BI \-\-subscription= type
75 When creating a list, set its subscription mode to
76 .I free
77 or
78 .IR moderated .
79 Use with
80 .BR \-\-edit ,
81 or
82 .BR \-\-create .
83 .TP
84 .BI \-\-posting= type
85 When creating a list, set its posting mode to
86 .IR free ,
87 .IR auto ,
88 or
89 .IR moderated .
90 Use with
91 .BR \-\-edit ,
92 or
93 .BR \-\-create .
94 .TP
95 .BI \-\-archived= yes\-or\-no
96 Should list messages be archived to the
97 .B archive\-box
98 directory in the list directory under the
99 .B "~/.enemies\-of\-carlotta"
100 directory.
101 Use
102 .I yes
103 or
104 .IR no .
105 .TP
106 .BI \-\-mail\-on\-subscription\-changes= yes\-or\-no
107 Should the list owners be notified when someone subscribes to or
108 unsubscribes from the list?
109 Use
110 .I yes
111 or
112 .IR no .
113 Default is no.
114 .TP
115 .BI \-\-mail\-on\-forced\-unsubscription= yes\-or\-no
116 Should list owners be notified when someone is forcibly dropped from
117 the list due to too much bouncing?
118 Use
119 .I yes
120 or
121 .IR no .
122 Default is no.
123 .TP
124 .BI \-\-ignore\-bounce= yes\-or\-no
125 Should bounces be ignored?
126 Use
127 .I yes
128 or
129 .IR no .
130 Default is no.
131 .TP
132 .BI \-\-list
133 List the subscribers of a list.
134 .TP
135 .BI \-\-subscribe
136 Add subscribers to a list.
137 The non\-option arguments are the addresses to be subscribed.
138 Note that addresses added this way won't be sent confirmation requests.
139 .TP
140 .BI \-\-unsubscribe
141 Remove subscribers from a list.
142 The non\-option arguments are the addresses to be unsubscribed.
143 Note that addresses removed this way won't be sent confirmation requests.
144 .TP
145 .B \-\-incoming
146 Deal with an incoming message in the standard input.
147 The SMTP envelope sender address must be given in the 
148 .I SENDER
149 environment variable, and the SMTP envelope recipient address in the
150 .I RECIPIENT
151 environment variable.
152 (QMail and Postfix do this automatically.)
153 .TP
154 .BI \-\-skip\-prefix= string
155 Before analyzing the recipient address to see which list it refers, remove 
156 .I string
157 from its beginning.
158 This helps deal with QMail and Postfix virtual domains, see above.
159 .TP
160 .BI \-\-domain= domain.name
161 Before analyzing the recipient address to see which list it refers, replace
162 the domain name part with
163 .IR domain.name .
164 This helps deal with Postfix virtual domains.
165 .TP
166 .BI \-\-is\-list
167 Does the address specified with
168 .B \-\-name
169 refer to a valid list?
170 This sets the exit code to zero (success) if it does, or one (failure)
171 if it does not.
172 .TP
173 .BI \-\-sendmail= pathname
174 Use 
175 .I pathname
176 instead of
177 .B /usr/sbin/sendmail
178 for sending mail via a command line interface.
179 Note that the command must obey the sendmail command line interface.
180 .TP
181 .BI \-\-smtp\-server= hostname
182 Send mail using the SMTP server at
183 .I hostname
184 (port 25).
185 The server must be configured to allow the list host to relay mail
186 through it.
187 Note that a command line interface is used by default;
188 SMTP sending is used only if you use this option.
189 .TP
190 .BI \-\-qmqp\-server= hostname
191 Send mail using the QMQP server at
192 .I hostname
193 (port 628).
194 The server must be configured to allow the list host to relay mail
195 through it.
196 Note that a command line interface is used by default;
197 QMQP sending is used only if you use this option.
198 .TP
199 .BI \-\-moderate
200 Force an incoming message to be moderated, even if it is going to a list
201 where posting is free.
202 This can be used for spam filtering: 
203 you pipe incoming messages through whatever spam filter you choose to use
204 and if the mssage looks like spam, you ask it to be moderated by a human.
205 .TP
206 .BI \-\-post
207 Force an incoming message to be posted, even if it is going to a list
208 where posting is moderated.
209 This can be used when there is an external check for whether a mail
210 is acceptable to the list, e.g., by checking digital signatures.
211 .TP
212 .BI \-\-quiet
213 By default, debugging log messages are sent to the standard error output
214 stream.
215 With this option, they aren't.
216 .TP
217 .BI \-\-sender= foo@example.com
218 .TP
219 .BI \-\-recipient= foo@example.com
220 These two options are used with 
221 .B \-\-incoming 
222 and
223 .B \-\-is\-list
224 to override the environment variables 
225 .B SENDER
226 and
227 .BR RECIPIENT ,
228 respectively.
229 .TP
230 .BI \-\-get
231 Get the values of one or more configuration variables.
232 The name of the variables are given on the command line after the options.
233 Each value is printed on a separate line.
234 .TP
235 .BI \-\-set 
236 Set the values of one or more configuration variables.
237 The names and values are given on the command line after the options
238 and separated by an equals sign ("=").
239 For example, the following would set the language of a list to Finnish:
240 .B "enemies\-of\-carlotta \-\-name=foo@bar \-\-set language=fi"
241 .TP
242 .BI \-\-version
243 Print out the version of the program.
244 .TP
245 .BI \-\-show\-lists
246 List the lists enemies\-of\-carlotta knows about.
247 .SH CONFIGURATION
248 Each list is represented by a directory, named after the list, in 
249 .IR ~/.enemies\-of\-carlotta .
250 That directory contains several files and directories, described below.
251 In general, it is not necessary to touch these at all.
252 However, some esoteric configuration can only be done by hand editing
253 of the list configuration file.
254 .TP
255 .B config
256 The list configuration file.
257 Contents are described below.
258 .TP
259 .B subscribers
260 Subscriber database.
261 Each line contains a subscriber group, with the first five space 
262 delimited fields being group identifier, status, timestamp for when
263 the group was created, timestamp for the bounce that made it switch
264 from status 'ok' to 'bounced', and the bounce identifier.
265 .TP
266 .B archive\-box
267 Archived messages.
268 .TP
269 .B bounce\-box
270 Bounce messages groups not in state 'ok'.
271 .TP
272 .B headers\-to\-add
273 These headers are added to the mails sent to the list.
274 They are copied to the beginning of the existing headers exactly as they
275 are in the file, after list headers ("List\-ID" and such) have been added
276 and those mentioned in 
277 .B headers\-to\-remove
278 have been removed.
279 .TP
280 .B headers\-to\-remove
281 These headers are removed from mails sent to the list.
282 .TP
283 .B moderation\-box
284 Messages waiting for moderator approval.
285 .TP
286 .B subscription\-box
287 Subscription and unsubscription requests waiting to be confirmed by the user.
288 .TP
289 .B templates
290 Directory containing list specific templates (optional). If this
291 directory exists, templates are searched from it before going for
292 system wide templates. An empty file here means the
293 corresponding message is not sent at all. This can, for example, to
294 be used to turn off the "please wait for moderator" mails on a per\-list
295 basis.
296 .TP
297 .B plugins
298 Directory containing plugins, Python source files that are loaded 
299 automatically by EoC upon startup.
300 The plugins may change how EoC operates.
301 .PP
302 The 
303 .B config
304 file has a 
305 .IR keyword = value
306 format:
307 .PP
308 .RS
309 .nf
310 [list]
311 owners = liw@liw.iki.fi
312 archived = no
313 posting = free
314 subscription = free
315 mail\-on\-subscription\-changes = yes
316 mail\-on\-forced\-unsubscribe = yes
317 language = fi
318 .fi
319 .RE
320 .PP
321 The keywords 
322 .BR archived , 
323 .BR posting ,
324 and
325 .B subscription 
326 correspond to the options with the same names.
327 Other keywords are:
328 .TP
329 .B owners
330 List of addresses for the owners. Set with the
331 .I \-\-owner
332 option.
333 .TP
334 .B moderators
335 List of addresses for the moderators. Set with the
336 .I \-\-moderator
337 option.
338 .TP
339 .B mail\-on\-subscription\-changes
340 Should the owners be mailed when users subscribe or unsubscribe?
341 .TP
342 .B mail\-on\-forced\-unsubscribe
343 Should the owners be mailed when people are removed from the list due to
344 excessive bouncing?
345 .TP
346 .B ignore_bounce
347 Bounce messages are ignored on this list. Useful for example if
348 list should have static subscriber list.
349 .TP
350 .B language
351 Suffix for templates, to allow support for multiple languages.
352 (If 
353 .I language
354 is set to "fi", then the template named "foo" is first searched as
355 "foo.fi".)
356 .TP
357 .B pristine\-headers
358 Do not MIME encode the headers. Set to "yes" to not encode, anything
359 else (including empty or unset) means encoding will happen.
360 .SH EXAMPLES
361 To create a list called 
362 .IR moviefans@example.com ,
363 owned by
364 .IR ding@example.com ,
365 use the following command (all on one line):
366 .sp 1
367 .nf
368 .RS
369 enemies\-of\-carlotta \-\-name=moviefans@example.com
370 \-\-owner=ding@example.com \-\-create
371 .RE
372 .fi
373 .PP
374 Note that you need to arrange mail to arrive at the list (and its
375 command addresses) by configuring your mail system.
376 For Qmail and Postfix, see below.
377 .PP
378 To see the subscribers on that list:
379 .sp 1
380 .nf
381 .RS
382 enemies\-of\-carlotta \-\-name=moviefans@example.com \-\-list
383 .RE
384 .fi
385 .PP
386 People wanting to subscribe to the list should mail
387 .sp 1
388 .nf
389 .RS
390 moviefans\-subscribe@example.com
391 .RE
392 .fi
393 .SH QMAIL
394 With QMail, to arrange for incoming mail to be processed by Enemies of
395 Carlotta, you need to create a couple of
396 .I .qmail\-extension
397 files per list.
398 For example, if your username is joe and you wish to run the
399 joe\-fans mailing list, you need to create two files,
400 .I .qmail\-fans
401 and
402 .IR .qmail\-fans\-default ,
403 containing
404 .sp 1
405 .RS
406 |enemies\-of\-carlotta \-\-incoming
407 .RE
408 .PP
409 If you're running a virtual domain, example.com, and the mails are
410 being delivered to via 
411 .I /var/qmail/control/virtualdomains
412 to
413 .IR joe\-exampledotcom ,
414 the files would be called
415 .I .qmail\-exampledotcom\-fans
416 and
417 .I .qmail\-exampledotcom\-fans\-default
418 and would contain
419 .sp 1
420 .RS
421 |enemies\-of\-carlotta \-\-incoming \-\-skip\-prefix=joe\-exampledotcom\-
422 .RE
423 .sp 1
424 (all on one line, of course, in case the manual page formatter breaks it
425 on several lines).
426 .SH POSTFIX
427 With Postfix, you need to set up a
428 .I .forward
429 file containing
430 .sp 1
431 .RS
432 "|procmail \-p"
433 .RE
434 .sp 1
435 and then a
436 .I .procmailrc
437 file containing
438 .sp 1
439 .RS
440 :0
441 .br
442 * ? enemies\-of\-carlotta \-\-name=$RECIPIENT \-\-is\-list
443 .br
444 | enemies\-of\-carlotta \-\-incoming
445 .RE
446 .PP
447 To use Enemies of Carlotta with a Postfix virtual domain, you need to
448 set up a 
449 .IR "virtual regular expression map" ,
450 typically called
451 .I /etc/postfix/virtual_regexp
452 (add 
453 .I "virtual_maps = regexp:/etc/postfix/virtual_regexp"
454 to your 
455 .I /etc/postfix/main.cf
456 file to enable it).
457 The regexp file needs to do ugly things to preserve the recipient
458 address.
459 Add the following to the regexp file:
460 .sp 1
461 .RS
462 /^your\.virtual\.domain$/ dummy
463 .br
464 /^(yourlist|yourlist\-.*)@(your\.virtual\.domain)$/ joe+virtual\-$1
465 .RE
466 .sp 1
467 That's two lines. Use
468 .B joe-virtual
469 instead, if
470 .I recipient_delimiter
471 for your Postfix is configured to a minus instead of a plus..
472 Then, in your
473 .I .procmailrc
474 file, add the
475 .I "\-\-skip\-prefix=joe\-virtual\-"
476 and 
477 .I \-\-domain=your.virtual.domain
478 options to both calls to 
479 .BR enemies\-of\-carlotta .
480 .PP
481 (Yes, I think these things are much too complicated, too.)
482 .SH "MAIL COMMANDS"
483 Users and list owners use Enemies of Carlotta via e\-mail using
484 command addresses such as
485 .BR foo\-subscribe@example.com .
486 Here is a list of all command addresses list users and owners can give.
487 In all these examples, the name of the mailing list is
488 .BR foo@example.com .
489 .SS "Mail commands anyone can use"
490 These commands are meant for everyone's use.
491 They don't require any special priviledges.
492 .TP
493 .BR foo@example.com
494 Send mail to all list subscribers.
495 The message may have to be manually approved by the list moderators first,
496 and they have the power to reject a message.
497 .TP
498 .BR foo\-owner@example.com
499 Send mail to the list owner or owners instead.
500 .TP
501 .BR foo\-help@example.com
502 Sending mail to this address makes the list manager reply with
503 the help message for the list.
504 .TP
505 .BR foo\-subscribe@example.com
506 Send mail to this address to subscribe to a list.
507 The list manager will respond with a confirmation request.
508 You won't be subscribed unless you reply to the confirmation request.
509 This way, malicious people can't put your address on a mailing list,
510 or many mailing lists.
511 .TP
512 .BR foo\-subscribe\-joe=example.com@example.com
513 This is a second form of the subscription address.
514 If you want to subscribe to the list with another address than the
515 one you're sending mail from, use this one.
516 In this case, the address to be subscribed is joe@example.com.
517 Note that the confirmation request is sent to Joe, since it is
518 his address that is to be added to the list.
519 .TP
520 .BR foo\-unsubscribe@example.com
521 To unsubscribe from a list, send mail to this address from the address
522 that is subscribed to the list.
523 Again, you will receive a confirmation request, to prevent malicious
524 people from unsubscribing you against your will.
525 .TP
526 .BR foo\-unsubscribe\-joe=example.com@example.com
527 To unsubscribe Joe, use this address.
528 Again, it is Joe who gets to confirm.
529 .SS "Mail commands for the list owners"
530 These are commands that list owners can use to administer their list.
531 .TP
532 .BR foo\-subscribe\-joe=example.com@example.com
533 If a list owner sends mail like this, it is they who get the confirmation
534 request, not Joe.
535 It is generally better for people to subscribe themselves, but sometimes
536 list owners want to do it, when they have permission from the person
537 and feel helpful.
538 .TP
539 .BR foo\-unsubscribe\-joe=example.com@example.com
540 List owners can also unsubscribe other people.
541 .TP
542 .BR foo\-list@example.com
543 To see who are on the list, this is the address to use.
544 It only works if the sender address is one of the list owners.
545 The sender address is the one used on the SMTP level,
546 not the one in the From: header.
547 .TP
548 .BR foo\-setlist@example.com
549 This lets a list owner set the whole subscriber list at once.
550 This is similar to using lots and lots and lots of \-subscribe and
551 \-unsubscribe commands, only less painful.
552 Everyone who is added to the list gets a welcome message, and
553 everyone who is removed from the list gets a goodbye message.
554 .TP
555 .BR foo\-setlistsilently@example.com
556 This is similar to \-setlist, but no welcome and goodbye messages are sent.
557 .SH PLUGINS
558 Enemies of Carlotta supports plugins.
559 If you don't know what Python programming is, you may want to skip this
560 section.
561 .PP
562 A plugin is a Python module (file named with a 
563 .B .py
564 suffix), placed in the
565 .B ~/.enemies\-of\-carlotta/plugins
566 directory.
567 The plugins are loaded automatically upon startup, if their declared
568 interface version matches the one implemented by Enemies of Carlotta.
569 The interface version is declared by the module global variable
570 .BR PLUGIN_INTERFACE_VERSION .
571 .PP
572 Plugins can define hook functions that are called by appropriate places in
573 the EoC code.
574 At the moment, the only hook function is 
575 .BR send_mail_to_subscribers_hook ,
576 which can manipulate a mail message before it is sent to the subscribers.
577 The function must look like this:
578 .PP
579 .ti +5
580 def send_mail_to_subscribers_hook(list, text):
581 .PP
582 The
583 .I list
584 argument is a reference to the
585 .I MailingList
586 object that corresponds to the list in question, and 
587 .I text
588 is the complete text of the mail message as it exists.
589 The function must return the new contents of the mail message.
590 .SH FILES
591 .TP
592 .I ~/.enemies\-of\-carlotta
593 All files related to your mailing lists.
594 .TP
595 .I ~/.enemies\-of\-carlotta/secret
596 Secret password used to generate signed addresses for bounce checking
597 and subscription verification.
598 .TP
599 .I ~/.enemies\-of\-carlotta/foo@example.com
600 Directory containing data pertaining to the foo@example.com list.
601 Except for the 
602 .I config
603 file in this directory, you shouldn't edit anything by hand.
604 .TP
605 .I ~/.enemies\-of\-carlotta/foo@example.com/config
606 Configuration file for the mailing list.
607 You may need to edit this file by hand if you wish to change moderation
608 status or list owners.
609 .SH "SEE ALSO"
610 You may want to visit the 
611 .I "Enemies of Carlotta"
612 home page at
613 .IR http://www.iki.fi/liw/eoc/ .