| 1 | = Project Lancelot HOWTO = |
|---|
| 2 | |
|---|
| 3 | == Overview == |
|---|
| 4 | |
|---|
| 5 | This document gives a brief introduction to installing and operating |
|---|
| 6 | Project Lancelot lists. |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | == Creating a list == |
|---|
| 10 | |
|---|
| 11 | To create a Project Lancelot list, invoke the pl-init(1) command with |
|---|
| 12 | the list address and the list owner's (your) address as its |
|---|
| 13 | arguments. For the purposes of this example, let's assume that the |
|---|
| 14 | list is to be called ''test@example.com'', and that you're Alfred |
|---|
| 15 | E. Newman at ''alfred@example.com'': |
|---|
| 16 | {{{ |
|---|
| 17 | $ pl-init test@example.com alfred@example.com |
|---|
| 18 | }}} |
|---|
| 19 | This will create a ''.pl'' directory inside your home directory (if it |
|---|
| 20 | doesn't already exist) and, within that directory, a directory called |
|---|
| 21 | ''test@example.com'' containing a file called ''list.db''. This file |
|---|
| 22 | is a database that stores the list configuration and (usually) |
|---|
| 23 | subscriber addresses and options. |
|---|
| 24 | |
|---|
| 25 | The next step is to ensure that mail sent to ''test@example.com'' |
|---|
| 26 | actually reaches Project Lancelot. How to do this in general is beyond the |
|---|
| 27 | scope of this document, but one approach might involve setting up an |
|---|
| 28 | ''alias'' such as |
|---|
| 29 | {{{ |
|---|
| 30 | test: "|/usr/local/bin/pl-incoming --user alfred test@example.com" |
|---|
| 31 | }}} |
|---|
| 32 | in your system's alias database (usually /etc/aliases). You will probably |
|---|
| 33 | need system administrator privileges to change this file. |
|---|
| 34 | |
|---|
| 35 | '''Note:''' Project Lancelot will be responsible not just for the |
|---|
| 36 | ''test@example.com'' address, but for all addresses of the form |
|---|
| 37 | ''test+SOMETHING@example.com'', too. You will need to make sure that your |
|---|
| 38 | mail server actually accepts messages to all these addresses (for |
|---|
| 39 | Postfix, check the ''recipient_delimiter'' parameter); Lancelot will |
|---|
| 40 | take care of them. |
|---|
| 41 | |
|---|
| 42 | == Configuring the new list == |
|---|
| 43 | |
|---|
| 44 | The new list should come with a fairly sensible configuration already, but |
|---|
| 45 | it is more than likely that you will want to change this and that. Refer |
|---|
| 46 | to LancelotConfiguration to see the most important parameters that you |
|---|
| 47 | can set. |
|---|
| 48 | |
|---|
| 49 | Use the pl-conf(1) to look at and change configuration parameters. You can |
|---|
| 50 | inspect all of the configuration using |
|---|
| 51 | {{{ |
|---|
| 52 | $ pl-conf -q test@example.com |
|---|
| 53 | digests.enable = 0 |
|---|
| 54 | digests.maxperiod = 0 |
|---|
| 55 | digests.maxsize = 0 |
|---|
| 56 | list.address = test@example.com |
|---|
| 57 | ... |
|---|
| 58 | }}} |
|---|
| 59 | (note that not all parameters in this list are actually used yet). To change |
|---|
| 60 | individual parameters from the command line, use |
|---|
| 61 | {{{ |
|---|
| 62 | $ pl-conf -s test@example.com "list.ownername = Alfred E. Newman" |
|---|
| 63 | }}} |
|---|
| 64 | You can also write the whole configuration to a file and work this over |
|---|
| 65 | using your favourite text editor, then reimport the configuration: |
|---|
| 66 | {{{ |
|---|
| 67 | $ pl-conf -q test@example.com >test.conf |
|---|
| 68 | $ emacs test.conf |
|---|
| 69 | $ pl-conf -i test@example.com <test.conf |
|---|
| 70 | }}} |
|---|
| 71 | Blank lines and comment lines (starting with ''#'') are ignored when |
|---|
| 72 | a configuration is imported, so feel free to add comments to test.conf -- |
|---|
| 73 | you just need to force yourself not to use "pl-conf -s" to change parameters |
|---|
| 74 | behind test.conf's back. |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | == Sending Mail to the List == |
|---|
| 78 | |
|---|
| 79 | You can now send messages to the new mailing list at test@example.com |
|---|
| 80 | (but for the fact that there are no subscribers to receive them). (As |
|---|
| 81 | a matter of fact, the list won't even accept them until you have |
|---|
| 82 | subscribed ''yourself''.) See the next section. |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | == Managing Subscribers == |
|---|
| 86 | |
|---|
| 87 | Like most mailing list management programs, Project Lancelot allows users |
|---|
| 88 | to subscribe or unsubscribe themselves by sending messages to |
|---|
| 89 | addresses such as ''test+subscribe@example.com''. But you can still |
|---|
| 90 | change the subscription database manually. Here's how to add subscribers: |
|---|
| 91 | {{{ |
|---|
| 92 | $ pl-subscribe test@example.com joe.blow@example.org sue.foo@example.net |
|---|
| 93 | }}} |
|---|
| 94 | This will add Joe Blow's and Sue Foo's addresses to the subscriber |
|---|
| 95 | database. Project Lancelot uses the same code to parse the address |
|---|
| 96 | arguments to pl-subscribe(1) that it uses to pass ''From'' headers in |
|---|
| 97 | e-mail, so you can say |
|---|
| 98 | {{{ |
|---|
| 99 | $ pl-subscribe test@example.com "Joe Blow <joe.blow@example.org>" |
|---|
| 100 | }}} |
|---|
| 101 | and "Joe Blow" will be noted as the name going with the address, |
|---|
| 102 | ''joe.blow@example.org''. |
|---|
| 103 | |
|---|
| 104 | pl-subscribe(1) takes arbitrarily many (well almost) |
|---|
| 105 | addresses on the command line, but if you do not give any, pl-subscribe(1) |
|---|
| 106 | will read its standard input instead: |
|---|
| 107 | {{{ |
|---|
| 108 | $ pl-subscribe test@example.com <members-list.txt |
|---|
| 109 | }}} |
|---|
| 110 | Use pl-list(1) to check who's subscribing: |
|---|
| 111 | {{{ |
|---|
| 112 | $ pl-list test@example.com |
|---|
| 113 | sue.foo@example.net |
|---|
| 114 | joe.blow@example.org |
|---|
| 115 | }}} |
|---|
| 116 | If you try to add an address that is already subscribing to the list, |
|---|
| 117 | you will see a nasty message from the database, but the address will |
|---|
| 118 | not be added a second time. |
|---|
| 119 | |
|---|
| 120 | You can remove subscribers again using the pl-unsubscribe(1) command, |
|---|
| 121 | which works essentially like pl-subscribe(1): |
|---|
| 122 | {{{ |
|---|
| 123 | $ pl-unsubscribe test@example.com joe.blow@example.org |
|---|
| 124 | }}} |
|---|
| 125 | |
|---|
| 126 | == List Aliases == |
|---|
| 127 | |
|---|
| 128 | It is extremely tedious to have to type command lines like |
|---|
| 129 | {{{ |
|---|
| 130 | $ pl-subscribe foobar-announce@lists.marketing.example.com ... |
|---|
| 131 | }}} |
|---|
| 132 | so (fortunately) there is a helpful shortcut. A command like |
|---|
| 133 | {{{ |
|---|
| 134 | $ pl-conf --alias foobar-announce@lists.marketing.example.com fba |
|---|
| 135 | }}} |
|---|
| 136 | lets you use ''fba'' in place of the long address in commands: |
|---|
| 137 | {{{ |
|---|
| 138 | $ pl-subscribe fba ... |
|---|
| 139 | }}} |
|---|
| 140 | This form of "aliasing" applies to all Project Lancelot command-line |
|---|
| 141 | tools. The command |
|---|
| 142 | {{{ |
|---|
| 143 | $ pl-conf --alias foobar-announce@lists.marketing.example.com |
|---|
| 144 | }}} |
|---|
| 145 | (without an alias) will enumerate the current alias (or aliases -- |
|---|
| 146 | you can have as many as you like) for that list. If you're ever unsure |
|---|
| 147 | exactly what list an alias points to, use a command like |
|---|
| 148 | {{{ |
|---|
| 149 | $ pl-conf -qh fba list.address |
|---|
| 150 | }}} |
|---|
| 151 | |
|---|
| 152 | Project Lancelot maintains an "automatic" alias to the last list |
|---|
| 153 | address you used in a Project Lancelot command. In |
|---|
| 154 | {{{ |
|---|
| 155 | $ pl-subscribe test@example.org joe.blow@example.org |
|---|
| 156 | $ pl-subscribe . sue.foo@example.net |
|---|
| 157 | }}} |
|---|
| 158 | the second ''pl-subscribe'' command also applies to |
|---|
| 159 | ''test@example.org''. (You will be relieved to hear that this works |
|---|
| 160 | for all Project Lancelot command-line tools except pl-incoming(1), |
|---|
| 161 | which deals with incoming mail, and pl-janitor(1), which performs |
|---|
| 162 | periodic cleanups. These commands will be invoked at various times |
|---|
| 163 | either from the mail system or cron, and it would be confusing for |
|---|
| 164 | them to reset Project Lancelot's notion of the "current list" while |
|---|
| 165 | you may be typing interactive commands. |
|---|
| 166 | |
|---|
| 167 | List aliases are really just symbolic links in the ''.pl'' directory. |
|---|
| 168 | If you want to remove an alias, simply delete the symbolic link in |
|---|
| 169 | question. (The "." alias is really a symbolic link called |
|---|
| 170 | ''.default-list''.) |
|---|
| 171 | |
|---|
| 172 | |
|---|
| 173 | == Incoming Mail == |
|---|
| 174 | |
|---|
| 175 | Here's what happens when Project Lancelot receives a message to the |
|---|
| 176 | list submission address (''test@example.com'', right?). At least this is |
|---|
| 177 | what happens unless you change things completely, which you are |
|---|
| 178 | absolutely free to do but probably shouldn't until you have learned |
|---|
| 179 | more about Project Lancelot's internals. |
|---|
| 180 | |
|---|
| 181 | First of all, Project Lancelot creates a ''workflow'' that governs |
|---|
| 182 | further processing of the message. For mail to the submission address, |
|---|
| 183 | you can look at the value of the lists's '''mail.workflow.submit''' |
|---|
| 184 | parameter in order to see the individual steps. Each step corresponds |
|---|
| 185 | to a Project Lancelot ''processing module'' that does something with |
|---|
| 186 | the message. You can change how a message is processed by deleting or |
|---|
| 187 | inserting processing modules from or into the workflow. |
|---|
| 188 | |
|---|
| 189 | The steps taken for submitted messages include: |
|---|
| 190 | |
|---|
| 191 | * Optionally checking that the message is indeed addressed to the list. |
|---|
| 192 | * Optionally checking that the message sender subscribes to the list. |
|---|
| 193 | * Checking whether the message looks reasonable from a MIME point |
|---|
| 194 | of view, i.e., has significant plain-text content and does not contain |
|---|
| 195 | fishy-looking attachments, which might harbour spam or viruses. |
|---|
| 196 | This step also gets rid of everything that is not plain text. |
|---|
| 197 | * Adding RFC2919 and (optionally) RFC2369 headers to the message. |
|---|
| 198 | * Optionally adding a "tag" to the message's ''Subject:'' header. |
|---|
| 199 | * Adjusting the message's ''Reply-To:'' header if desired (we have heard |
|---|
| 200 | everything about how this will cause the milk in one's fridge to curdle |
|---|
| 201 | but we think the feature has its uses even so, so spare us the |
|---|
| 202 | philosophy). |
|---|
| 203 | * Sending the message out to the subscribers, optionally only if the |
|---|
| 204 | sender is an actual list subscriber. |
|---|
| 205 | |
|---|
| 206 | And here is what happens when someone sends mail to a list's subscribe |
|---|
| 207 | address: |
|---|
| 208 | |
|---|
| 209 | * Project Lancelot checks whether '''subscribe.confirm''' is set for |
|---|
| 210 | this list. If so, the prospective subscriber is sent another |
|---|
| 211 | message containing a ''magic cookie'' -- a long random string that |
|---|
| 212 | is impossible to guess --, and invited to return that cookie to |
|---|
| 213 | Project Lancelot. Once Project Lancelot receives this cookie back, |
|---|
| 214 | the sending address of ''that'' message is added to the subscriber |
|---|
| 215 | database. This feature is used to keep you safe from practical |
|---|
| 216 | jokers who enjoy putting your address on 10.000 different mailing |
|---|
| 217 | lists. |
|---|
| 218 | |
|---|
| 219 | The confirmation mechanism in Project Lancelot is very general and can |
|---|
| 220 | be used to safeguard arbitrary addresses. Project Lancelot uses the |
|---|
| 221 | same code also for unsubscription and configuration requests. |
|---|
| 222 | |
|---|
| 223 | The workflows for the unsubscription, config, owner and help |
|---|
| 224 | addresses are much more boring by far, once you have seen these. |
|---|
| 225 | |
|---|
| 226 | See LancelotModules for more information on Project Lancelot's |
|---|
| 227 | processing modules. |
|---|
| 228 | |
|---|
| 229 | Feel free to come up with new and interesting processing modules that |
|---|
| 230 | do stuff which is not on this list. You may want to check in with the |
|---|
| 231 | Project Lancelot developers' list (see below) to see whether anybody |
|---|
| 232 | else is working on stuff that you have in mind. |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | == Finished == |
|---|
| 236 | |
|---|
| 237 | This concludes our lightning tour of Project Lancelot. Feel free to |
|---|
| 238 | browse the [http://code.anselms.net/projects/lancelot/ Project |
|---|
| 239 | Lancelot web site], and to send mail to the |
|---|
| 240 | [mailto:lancelot-dev@anselms.net Project Lancelot developers' mailing |
|---|
| 241 | list] giving suggestions, encouragement, and helpful feedback. (As far |
|---|
| 242 | as flames are concerned, you know where you can stick those.) |
|---|
| 243 | |
|---|
| 244 | Project Lancelot is very much a work in progress, and we hope that its |
|---|
| 245 | obvious major problems will very shortly be either removed or replaced |
|---|
| 246 | with new major problems. Stay tuned. |
|---|