couriermlm †
名称 †
couriermlm -- Courier メーリングリストマネージャ
書式 †
couriermlm {コマンド} {ディレクトリ} [引数...]
解説 †
couriermlm は、Courierのメーリングリストマネージャです。このコマンドでメーリングリストの立ち上げ・維持・管理ができます。couriermlm は、メンバーの購読・退会のリクエストを自動的に処理し、配送不可能なアドレスを検出して購読者リストから除くこともできます。couriermlm が管理するメーリングリストは、人間による管理上の過ちを防ぎます。couriermlm はダイジェスト、投稿専用エイリアス、モデレーションをサポートします。
メーリングリストを作成する †
システム管理者でなくても、誰でも couriermlm を利用することができます。Courier メールサーバは、list-name@domain というアドレスを、対応する dot-courier(5)? ファイルによって解釈します。つまり、dot-courier(5)? ファイルを設置でき、cron(8)? でスケジュール管理できるユーザであれば、couriermlm によるメーリングリストを運用することができます。
システム管理者が dot-courier(5)? の機能そのものを削除することができるということを覚えておいてください。その場合、couriermlm は動作しません。
メーリングリストの設定は、以下のステップからなります:
- couriermlm create の実行
- このコマンドを使って、couriermlm がメーリングリストに関するファイルを保存するためのディレクトリを作成します。
- メーリングリストの設定
- couriermlm の create コマンドは、メーリングリスト用ディレクトリの作成時にいくつかの返信用テンプレートを保存しますので、あなたが作成したメーリングリストをカスタマイズする必要があります。また、投稿権限やモデレーションの調整など、メーリングリストのオプションを変更するためにさらにコマンドを実行する必要があるかもしれません。
- dot-courier(5)? ファイルの作成
- couriermlm が、メーリングリストのメッセージを配信したりリクエストを処理したりできるようにするために、この作業を行います。
:cron(8)? の設定: cron(8)? のジョブを設定して、couriermlm が1時間ごと・1日ごとに起動してメーリングリストの管理を行うようにします。
- 購読者リストのバックアップ
- メーリングリスト購読者情報をバックアップするために、日々のジョブの一環として export コマンドを実行することもできます。メーリングリストデータベースが壊れたり失われたりしたときに、このバックアップから復旧できます。より詳しい情報はexport コマンドを見てください。
注: メーリングリストをダイジェスト対応にするには、さらに設定が必要です。詳しくは、下の「メーリングリストのダイジェストを設定する」の項目をご覧下さい。
最初のステップは、次のコマンドを実行することです
couriermlm create ディレクトリ ADDRESS=list@domain
ディレクトリは、ouriermlm が管理するメーリングリスト用のディレクトリです。コマンドによってディレクトリが作成され初期化されるので、このディレクトリはあらかじめ作らないでください。
list@domain がメーリングリストのアドレスで、リストにメッセージを送信するためのものです。
couriermlm によって作成されたディレクトリは初期化されて couriermlm が管理コマンドに対する返事として送るためのテキストファイルなどがいくつか作成されます。これらのテンプレートファイルを編集し、メーリングリスト用に調節する必要があります。全てのテンプレートのファイル名は .tmpl がつけられていて、それぞれファイル名から推測できるようになっています。重要なテンプレートファイルを挙げると:
- help.tmpl
- help コマンドへの応答としてこのファイルが送られます。メーリングリストのモデレーション・ダイジェスト機能の有無や、その他のデフォルトで有効になっていない設定などに基づいてこのファイルを編集しなければなりません。
- sub.tmpl
- 購読リクエストに対する応答としてこのファイルが送信されます。同様に購読解除リクエストに対する unsub.tmpl というファイルもありますが、こちらはあまり必要ないかも知れません。
- sub2.tmpl
- 購読の成功の確認メールです。メーリングリストの簡単な説明を書きましょう。
ほかにも、あなたの好みに合わせて編集するべきファイルがいくつかあります:
- headeradd
- このファイルには、メーリングリストのすべてのメッセージに自動的に付け加えられるメールヘッダを含めることができます。このファイルの内容は、送り出されるすべてのメールに単純に付加されます。空行を含めることはできません。
- headerdel
- メーリングリストのすべてのメッセージが送信される前に自動的に削除されるヘッダをこのファイルに列挙します。1行あたり1つのヘッダ (コロン (:) まで) を書いてください。たとえば、すべての Received: ヘッダと Date: ヘッダを扱う全てのメッセージから削除するには、以下の2行が書かれた headerdel ファイルを用意します:
Received:
Date:
headeradd と headerdel ファイルは、メッセージに対する返信がメーリングリストに流れるようにする、最近流行の機能を実装するために使うことができます。これを行うためには、headerdel ファイルに "Reply-To:" を記述してすべての Reply-To: ヘッダを削除するようにし、それから headeradd ファイルに "Reply-To: list@domain" という行を追加して全てのメッセージに Reply-To: ヘッダが付け加えられるようにします。
create コマンドによって、メーリングリスト用のディレクトリ中に、以下のサブディレクトリが作られます:
- sublist
- このサブディレクトリはメーリングリストの購読リストを含みます。
:unsublist: このサブディレクトリはメーリングリストから退会したアドレスの情報が含まれるファイルを保存しています。この情報は古い購読を追いかけるときに役に立つかもしれません。このディレクトリの中身は自動的に消されません、自分自身でこのディレクトリに対する消去メカニズムをセットアップしなければいけません。
- commands, commands.dat
- These directories store temporary files that contain pending (unconfirmed) commands for the mailing list manager. The couriermlm commands hourly and daily must be executed regularly in order to periodically purge stale entries.
- modqueue
- Messages awaiting moderator approval (for moderated lists).
- archive
- Messages received by this mailing list will be stored here, in addition to being forwarded to subscribers. couriermlm does not automatically do any purging on this subdirectory, you must set up your own archiving mechanism that cleans out this subdirectory.
The last step involves installing a couple of dot-courier(5) files that run couriermlm to receive mailing list messages and administrative commands. The mailing list address, list@domain, corresponds to some dot-courier(5) file. For example, if your system account is john, and your mail domain is example.com, then the dot-courier(5) file for the mailing list <john-list@example.com> is $HOME/.courier-list.
Let's say that the dot-courier(5) file is $HOME/.courier-list. To properly support the mailing list, the following dot-courier(5) files will have to be initialized as follows:
- $HOME/.courier-list
- This file should be initialized to contain the following delivery instruction:
| /usr/lib/courier/bin/couriermlm msg directory
directory is the created mailing list directory.
- $HOME/.courier-list-owner
- This file should contain the appropriate delivery instructions for forwarding all mail addressed to <list-owner@domain> to the address of the owner of the mailing list. This can be another E-mail address, or a mailbox specification.
- $HOME/.courier-list-default
- This file should be initialized to contain the following delivery instruction:
| /usr/lib/courier/bin/couriermlm ctlmsg directory
directory is the created mailing list directory. This dot-courier(5) file provides support for all other addresses of the form <list-command@domain>, where command is a mailing list administrative command. Commands are sent to this mailing list manager by sending a message to one of several special addresses, described more fully in "Mailing list commands", below.
手動コマンド †
couriermlm may also be run manually from the command line as follows:
/usr/lib/courier/bin/couriermlm コマンド ディレクトリ [オプション...]
command is a command from the following list. directory is the mailing list directory. The commands are:
- create
- Create a mailing list.
- set
- Set mailing list options.
- sub
- Manually subscribe an address to the mailing list.
- unsub
- Manually unsubscribe an address from the mailing list.
- lsub
- List all the subscribers to this mailing list.
- laliases
- List write-only aliases for this mailing list.
- export
- Export mailing list subscriber information.
- import
- Import mailing list subscriber information.
- ctlmsg
- Receive and interpret a control message.
- info
- Display a subscription record.
- msg
- Post a message to the mailing list.
- hourly
- Perform hourly maintenance. It is necessary to set up a cron(8) job to execute the hourly command once an hour.
- daily
- Perform daily maintenance. It is necessary to set up a cron(8) job to execute the daily command once a day.
- digest
- Create a digest. See "Setting up a mailing list digest" below for more information.
手動の購読管理 †
The sub, unsub, lsub, laliases, export, and import commands allow manual subscription list management. Normally, subscription-related commands are done by sending an appropriate mailing list command, see "Mailing List Commands", below.
couriermlm sub directory user@domain
This command adds the address <user@domain> to the subscription list. couriermlm will now read a free-form comment or a note from standard input, terminated by an end-of-file (usually CTRL-D). The free-form comment is stored in the subscription database, together with the address, and is shown by the "info" command.
couriermlm unsub directory user@domain
This command remove the address <user@domain> from the subscription rolls. couriermlm will also read a free-form comment, which is added to the subscription record. After removing this address from the subscription rolls, its subscription record is archived in the directory/unsublist directory.
couriermlm lsub directory
This command lists all the addresses subscribed to the list, on standard output, one per line.
couriermlm laliases directory
This command lists all write-only aliases that have been subscribed to the list, together with the subscriber address that added each alias. See "Write-Only Aliases" for more information.
couriermlm export directory
The export command lists the contents of the subscription database on standard output. The export command produces the following output format:
address subscription information ... address subscription information ...
"address", is an address subscribed to the mailing list. This is followed by its corresponding subscription information, usually a copy of the subscription request that was used to add the address to the mailing list. The subscription information is terminated by a line containing a single period. Any lines in the subscription information that begin with a period have an extra period prepended to them.
couriermlm import directory
The import command reads on standard input a previously exported mailing list subscription database, and adds those addresses to the indicated mailing list.
It is highly recommended to make a regular backup of subscriber information using the export command, in the event that the subscription database gets corrupted. In which case the import command can be used to rebuild the subscription database, in absence of any direct backups of the database files.
メーリングリストのオプション設定 †
The set command sets various list options:
couriermlm set directory option=value option=value...
One or more options can be set with the same command. The available options are:
- ADDRESS=address
- The base E-mail address for this mailing list.
:DIGEST=directory: Enable digests. directory is the pathname to the previously-createddigest list directory. See "Setting up a mailing list digest" below for more information.
- KEYWORD=keyword
- Set the subject line keyword for mailing list messages. If set, couriermlm inserts "[keyword]" into the subject of every mailing list message, to aid sorting by the recipients.
- MAXBOUNCES=n
- Maximum number of bounce notifications sent by the hourly command, in order to prevent the mail system from being overloaded. The default is 20 bounce notifications. Any unsent notifications will be carried over to the next hourly job.
- MAXMODNOTICES=n
- Maximum number of moderation reminders sent by the hourly command, in order to prevent the mail system from being overloaded. The default is 20 moderation reminders. Any unsent reminders will be carried over to the next hourly job.
- MAXFETCHSIZE=K
- Maximum size, in kilobytes, of a response to the fetch command. The default is 100Kb. This option is used to minimize the impact of abusive requests for the entire archive, with a forged return address.
- NAME=name
- The name that's listed on the return address of administrative messages. Note that if name contains spaces, you should quote this argument in the shell. The default value is "Courier Mailing List Manager".
- NOBOZOS=flag
- If flag is "0" couriermlm will not attempt to block misdirected subscribes and unsubscribes that are sent to the mailing list's posting address. If flag is "1" (the default), those kinds of messages will be bounced appropriately.
- POST=option
- Set posting options. option is one of three values: "subscribers" - only subscribers may post messages to this mailing list (this is the default); "all" - anyone can post messages to this mailing list; "mod" - only subscribers may post, and messages are sent to the list owner for approval (moderation).
- POSTARCHIVE=option
- Set access to archived messages. option is either: "all" - Anyone can access the mailing list archive; or "subscribers" - only subscribers can access the archive. The default is "all".
- PURGEARCHIVE=d
- Purge archived mailing list messages after d days. The default is 0 days - messages are never removed from the archive subdirectory.
- PURGEBOUNCE=d
- Wait d days for the probe message, that automatically unsubscribes undeliverable addresses, to bounce (default: 14 days). Probe messages are sent three days (default) after the first message to an address bounces.
- PURGECMD=h
- Purge unconfirmed subscribe/unsubscribe requests after h hours (default: 48 hours).
- REMODERATE=h
- Resend a moderation reminder after h hours (default: 12 hours).
- REPORTADDR=address
- Mail daily reports of new and removed subscribers to this address. Must be set in order to receive reports. Provide an empty address to stop reporting.
- SIMPLECONFIRM=n
- If n is 1, confirmation requests may be acknowledged without adding "yes" to the subject line.
NOTE:
The text in sub.tmpl, unsub.tmpl, and help.tmpl may need adjusting.
- SUBSCRIBE=option
- Set subscription options. option is either "all", meaning that anyone can subscribe, or "mod", meaning moderated subscription requests, where all subscription requests are sent to the mailing list owner for approval. The default is "all".
- STARTPROBE=n
- Send a probe to a bouncing address n days after receiving the first bounce. Basically this means that an address must bounce for at least n days before it gets a probe message. The default is 3 days.
Option names and settings are case sensitive.
NOTE:
If you set up a digest list, you MUST set identical POSTARCHIVE option for both the main list and the digest list.
購読の履歴の表示 †
The info command displays the subscription record for the requested address:
couriermlm info directory user@domain
This displays the subscription record for "user@domain", which typically consists of a copy of the initial subscription request, and confirmation.
メーリングリストにメッセージを送信する †
The msg commands reads an E-mail message on standard input, and mails the contents of the message to the mailing list's subscribers.
If the POST option is set to "subscribers", the message is rejected unless the address in its From: header is a subscriber to this mailing list.
Control files headeradd and headerdel are read, and are applied to the message, as described previously.
メーリングリストのコマンド †
メーリングリストのコマンドは、E-mail によって couriermlm に送ることができます。その形式は<list-command@domain> の形になります。そのメーリングリストの default dot-courier(5) ファイルがこれを受け取り、couriermlm に引き渡すことにより、これらの形式のアドレスが処理されるようになります。
こうしたアドレスを処理するとき、couriermlm はCourierによって、どのコマンドを実行すべきかを支持するために設定された環境変数「DEFAULT」を読み込んで処理を行います。有効なコマンドは以下の通りです:
- help
- 簡単な自動返信コマンドです。couriermlm は送信者に対してhelp.html の内容を返します。
- subscribe
- メーリングリストにサブすくライブします。Couriermlm は送信者のメールアドレスを読み込んで、そのアドレスをメーリングリストに登録します。
- subscribe-name=domain
- 明示的にどのアドレスをそのメーリングリストに登録すべきかを提示します。この場合、送信者のメールアドレスは登録されません。前の例であれば、<my-widgets-subscribe-john=domain.com@example.com> にメールを送ると、<john@domain.com>がメーリングリスト「my-widgets@domain.com」に登録されます。数字とアルファベット以外の記号は「+」に引き続いて16進のASCIIコードであらわす必要があります。
- unsubscribe
- メーリングリストからの退会コマンドです。
- unsubscribe-name=domain
- 退会するメールアドレスを明示的に指定します。
- alias-subscribe
- 書き込みOnlyのエリアスを設定します。
- alias-subscribe-name=domain
- 書き込みOnlyのエリアスのメールアドレスを明示的に指定して設定します。
これらの他に、内部的に使用されるコマンドがいくつかあります。
投稿専用エイリアス †
Write-only E-mail aliases can send messages to the mailing list, but they do not receive any mailing list messages themselves. A write-only alias can be set up by any subscriber. Only one write-only alias is allowed per subscribed E-mail address. Write-only aliases are not needed for mailing list that has the POST=all option set.
To set up a write-only alias, the subscriber sends a couriermlm alias-subscribe command. The subscriber's E-mail address can be explicitly specified in a similar manner as the subscribe command.
The subject line of the E-mail message must contain the E-mail write-only alias to be set up, and nothing else. couriermlm responds with a confirmation request, just like when subscribing to the list. This request must be acknowledged in the same way.
A subscriber's write-only alias can be changed at any time by repeating this procedure. The new alias replaces the previous one. To prevent abuse, there's a limit of at most one alias-subscribe command every 30 minutes.
Leave the subject of the E-mail message blank in order to remove an existing write-only alias,
メーリングリストのダイジェストのセットアップ †
couriermlm supports mailing list digests. Mailing list digests are created as a second, separate, mailing list. The create command initializes a second mailing list directory, and then additional configuration takes place which ties links the main mailing list toe the digest list.
If the mailing list address is list-address@example.com, the address of the digest version of the mailing list is usually list-address-digest@example.com, but it doesn't have to be this address. The only requirement is that the directory for the digest version of the mailing list must reside on the same filesystem as the directory for the mailing list itself, and both must be owned by the same userid.
To set up a mailing list digest, first proceed with the steps to create the mailing list itself. After the mailing list is created and configured, proceed as follows:
:Create the digest list directory: Execute the create command to create the digest version of the list:
/usr/lib/courier/bin/couriermlm create \ /path/to/digest/list/directory \ ADDRESS=list-address-digest@example.com
- Use the full pathname to the mailing list directory, and the address of the digest version of the mailing list.
- Configure the digest list
- Execute the set command to set any appropriate options for the digest list. There one important differences to note: messages are not posted to the digest list directly, so there is no moderation option, however the digest version of the list can have moderated subscription requests.
- Link the two lists
- Set the DIGEST option for the main mailing list, specifying the directory of the digest list. This keyword lets couriermlm know that a digest version is available.
NOTE:
You MUST set identical POSTARCHIVE option for both the main list, and the digest list.
- Create dot-courier(5)? files
- It is necessary to create dot-courier(5) files for the digest list just like the main list, except for some important differences, which are noted below.
- Create cron(8)? jobs
- It is also necessary to create cron jobs for the digest list exactly like the main list, to run the hourly and daily cleanup. It's possible to set up one set of cron jobs to run hourly and daily cleanups consecutively for both lists.
- Create a digest cron(8)? job
- The digest creates and distributes the digest version of the list. It can be executed by a cron(8) job, or the command can be executed manually.
The main mailing list is supported by three dot-courier(5) files, as previously described: the posting address, the owner forwarding address, and the default address that handles administrative control messages. In the following example, the names $HOME/.courier-list, $HOME/.courier-list-owner, and $HOME/.courier-list-default are used to represent each one of these files, and the following names are used to represent the dot-courier(5) files that correspond to the digest version of the mailing list: $HOME/.courier-list-digest, $HOME/.courier-list-digest-owner, and $HOME/.courier-list-digest-default. Note, however, that the digest version of the mailing list can have any name, not necessary the name of the list, followed by "digest".
The contents of both $HOME/.courier-list $HOME/.courier-list-digest must be the same. Sending a message to the digest address should really end up sending a message to the main mailing list. Do not put the address of the digest mailing list directory in $HOME/.courier-list-digest, instead specify the address of the main mailing list directory. Just copy $HOME/.courier-list to $HOME/.courier-list-digest.
However, the contents of $HOME/.courier-list-digest-default must specify the directory of the digest version of the mailing list. The digest list is managed separately from the main list, it has its own subscriber list that is separate from the list of subscribers to the main list. $HOME/.courier-list-default can simply be copied to $HOME/.courier-list-digest-default, then the directory can be changed in the latter.
$HOME/.courier-list-owner may use the same mailing list owner address as $HOME/.courier-list-digest-owner, or it can specify a different address. The both the digest and the main mailing list can have the same mailing list owner/moderator, or have a different owner/moderator.
The following command must be executed in order to link the two lists together:
/usr/lib/courier/bin/couriermlm set \ /path/to/main/list/directory \ DIGEST=/path/to/digest/list/directory
Setting the DIGEST option on the main list lets couriermlm know that a digest version is available. The DIGEST option must either use an absolute pathname, or a pathname that's relative to the main list directory (NOT the current directory).
When the DIGEST option is set, messages are simultaneously distributed to the mailing list's subscribers, saved in the archive subdirectory of the main list, then placed in the modqueue subdirectory of the digest list. Digest list do not employ moderation -- any moderation must take place on the main list -- so the modqueue subdirectory is recycled to compile individual messages for the digest.
Finally, something needs to be done in order to actually distribute the digest to the digest list's subscribers. This is done by running the following command:
/usr/lib/courier/bin/couriermlm digest /path/to/digest/directory N H
This command creates a digest, and sends it out. The N and H arguments are optional. The digest is created only if there's at least N messages that are waiting to be sent in the digest list, or if the oldest message is at least H hours old. Both options default to 0, so the default behavior is to send a digest with all unsent messages.
Note that when the digest is created, ALL unsent messages are packaged into the digest, even if some messages are more recent than the time interval specified by the H option. A cron(8) job can be set up to run the digest command, or run it manually.
couriermlm automatically provides the From:, To: headers on a message digest. Additional headers may be specified by the headeradd file in the digest list directory. The headerdel file has no effect. Note that the individual messages in the digest are copies of the messages from the main mailing list, and thus have the headeradd and headerdel headers processed from the main mailing list directory.
バグ †
Courierのdot-courier(5)?拡張機能がオフになっていると、couriermlmは使用できません。
関連項目 †
Last-modified: Sat, 07 May 2005 22:59:16 JST (2939d)

