「Mailman」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(一部飜訳)
(→‎参照: 翻訳)
 
(2人の利用者による、間の11版が非表示)
1行目: 1行目:
[[Category:Email]]
+
[[Category:メール]]
 
[[Category:メールサーバー]]
 
[[Category:メールサーバー]]
 
[[en:mailman]]
 
[[en:mailman]]
[https://gitlab.com/mailman/mailman Mailman] はメーリングリスト管理システムです。[[メールサーバー]]と組み合わせて使用します。
+
[https://gitlab.com/mailman/mailman Mailman] はメーリングリスト管理システムです。[[メールサーバー]]と組み合わせて使用します。
   
 
== インストール ==
 
== インストール ==
16行目: 16行目:
 
== 設定 ==
 
== 設定 ==
   
All configuration for Mailman takes place in {{ic|/etc/mailman.cfg}}. The schema explaining all possible configuration options and setting the defaults is stored in {{ic|/usr/lib/python3.8/site-packages/mailman/config/schema.cfg}}.
+
Mailman の設定はすべて {{ic|/etc/mailman.cfg}} で行われます。全ての可能な設定オプションとデフォルトの設定を説明するスキーマは {{ic|/usr/lib/python3.8/site-packages/mailman/config/schema.cfg}} に格納されています。
   
  +
また、コマンドラインからも設定にアクセスすることができます。{{ic|mailman}} ユーザーとして (例: [[sudo]] や [[su]] を使って) 以下のコマンドを実行します。
The configuration is also accessible via the command line. Run the following command as the {{ic|mailman}} user (e.g. using [[sudo]] or [[su]]):
 
   
 
[mailman]$ mailman conf
 
[mailman]$ mailman conf
24行目: 24行目:
 
=== データベース ===
 
=== データベース ===
   
Mailman by default uses an [[SQLite]] [https://mailman.readthedocs.io/en/latest/src/mailman/docs/database.html database] in {{ic|/var/lib/mailman/data/}}, but can be configured to use [[MariaDB]] or [[PostgreSQL]].
+
Mailman はデフォルトで、{{ic|/var/lib/mailman/data/ [[SQLite]] [https://mailman.readthedocs.io/en/latest/src/mailman/docs/database.html データベース] を使用します。}} ですが、[[MariaDB]] または [[PostgreSQL]] を使用するように設定できます。
   
 
==== SQLite ====
 
==== SQLite ====
   
  +
[[SQLite]] データベースのデフォルトの場所はすでに {{ic|schema.cfg}} に反映されているため、Mailman で設定する必要はありません。
The default location for the [[SQLite]] database is already reflected in the {{ic|schema.cfg}} and therefore does not have to be set in Mailman's configuration.
 
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
37行目: 37行目:
 
==== MariaDB ====
 
==== MariaDB ====
   
[[インストール]] the {{Pkg|python-pymysql}} package and configure a database on [[MariaDB]].
+
{{Pkg|python-pymysql}} パッケージを [[インストール]] し、[[MariaDB]] にデータベースを設定します。
   
 
{{hc|/etc/mailman.cfg|2=
 
{{hc|/etc/mailman.cfg|2=
47行目: 47行目:
 
==== PostgreSQL ====
 
==== PostgreSQL ====
   
[[インストール]] the {{Pkg|python-psycopg2}} package and create a database using [[PostgreSQL]].
+
{{Pkg|python-psycopg2}} パッケージを [[インストール]] し、[[PostgreSQL]] を使用してデータベースを作成します。
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
57行目: 57行目:
 
=== REST API ===
 
=== REST API ===
   
  +
Mailman は、設定の {{ic|[webservice]}} セクションの設定に基づいて REST API を公開します。{{ic|admin_user}} と {{ic|admin_pass}} のデフォルト値を必ず置き換えてください (以下の例の値は使用しないでください)
Mailman exposes its REST API based on the settings in the {{ic|[webservice]}} section of the configuration. Make sure to replace the default values for {{ic|admin_user}} and {{ic|admin_pass}} (do '''not''' use the example values below).
 
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
67行目: 67行目:
 
=== ARC ===
 
=== ARC ===
   
By default [[Wikipedia:DMARC|DMARC]] and [[Wikipedia:DKIM|DKIM]] are disabled. The configuration takes place in the {{ic|[ARC]}} section of the configuration file. Make sure to set necessary values and read the documentation about the defaults.
+
デフォルトでは、[[Wikipedia:ja:DMARC|DMARC]] および [[Wikipedia:ja:DKIM|DKIM]] は無効になっています。設定は、設定ファイルの {{ic|[ARC]}} セクションで行われます。必ず必要な値を設定し、デフォルトに関するドキュメントを読んでください。
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
81行目: 81行目:
 
=== MTA ===
 
=== MTA ===
   
To connect a mail-transfer-agent (MTA), it is necessary to configure the {{ic|[mta]}} section in the configuration file. [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html Upstream documentation] covers examples for [[postfix]], [[exim]] and [[sendmail]], but other MTAs are technically possible.
+
メール転送エージェント (MTA) を接続するには、設定ファイルの {{ic|[mta]}} セクションを設定する必要があります。 [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html アップストリームドキュメント] では、[[postfix]][[exim]][[sendmail]] の例について説明していますが、その他の例も説明しています。 MTA は技術的には可能です。
   
 
==== Postfix ====
 
==== Postfix ====
   
  +
ローカル [[postfix]] インスタンスに接続するには、次の構成セクションを使用できます。
To connect to a local [[postfix]] instance the following configuration section can be used:
 
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
97行目: 97行目:
 
}}
 
}}
   
The [[postfix]] configuration has to be extended to ensure compatibility (see [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html#basic-postfix-connections upstream notes]).
+
[[postfix]] 設定は互換性を確保するために拡張する必要があります ([https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html#basic-postfix-connections アップストリームのメモ] を参照)
   
 
{{hc|/etc/postfix/main.cf|
 
{{hc|/etc/postfix/main.cf|
109行目: 109行目:
 
}}
 
}}
   
Additionally, [[postfix]] needs to be made aware of mailman's [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html#transport-maps transport maps]. Depending on the postfix configuration these may look similar to the following.
+
さらに、[[postfix]] mailman [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html#transport-maps トランスポートマップ] を認識する必要があります。postfix の設定に応じて、これらは次のようになります。
   
{{Note| The following examples assume that existing values for {{ic|transport_maps}}, {{ic|local_recipient_maps}}, {{ic|relay_domains}}, {{ic|virtual_mailbox_domains}} and {{ic|virtual_alias_maps}} are merged with the additional values.}}
+
{{Note| 次の例では、{{ic|transport_maps}}{{ic|local_recipient_maps}}{{ic|relay_domains}}{{ic|virtual_mailbox_domains}}、および {{ic|virtual_alias_maps}} の既存の値がマージされることを前提としています。追加の値。}}
   
 
{{hc|/etc/postfix/main.cf|
 
{{hc|/etc/postfix/main.cf|
123行目: 123行目:
 
}}
 
}}
   
  +
デフォルトのハッシュベースのエイリアスマップを作成するために mailman が {{ic|postmap}} に直接アクセスできない場合は、代わりに正規表現ベースのエイリアスマップを生成します。
If {{ic|postmap}} is not directly accessible by mailman for creating the default hash-based alias maps, it is possible to generate regular expression based alias maps instead.
 
  +
デフォルトの Python クラスベースの設定を上書きするために、mailman は設定ファイルの使用を許可します。次のファイルを作成します。
To overwrite the default Python-class based configuration, mailman allows the use of a configuration file. Create the following file:
 
   
 
{{hc|/etc/postfix-mailman.cfg|
 
{{hc|/etc/postfix-mailman.cfg|
132行目: 132行目:
 
}}
 
}}
   
  +
このファイルを mailman の設定ファイルの {{ic|[mta]}} セクションに追加します。
Add the file to the {{ic|[mta]}} section in mailman's configuration file.
 
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
140行目: 140行目:
 
}}
 
}}
   
Afterwards the {{ic|regexp}} based exports can then be used in the [[postfix]] configuration.
+
その後、{{ic|regexp}} ベースのエクスポートを [[postfix]] 設定で使用できるようになります。
   
 
{{hc|/etc/postfix/main.cf|
 
{{hc|/etc/postfix/main.cf|
152行目: 152行目:
 
}}
 
}}
   
{{Note| Make sure to create the new alias maps after changing their type (e.g. from {{ic|hash}} to {{ic|regexp}}): {{ic|[mailman]$ mailman aliases}}}}
+
{{Note| タイプを変更した後(例: {{ic|hash}} から {{ic|regexp}})、必ず新しいエイリアスマップを作成してください: {{ic|[mailman]$ mailman aliases}}}}
   
  +
[[Postfix#Virtual_mail|仮想メール]] セットアップを使用してローカルの [[postfix]] インスタンスに接続するには、まず [[Postorius#Set_an_Alias_Domain|エイリアス ドメインを設定]] します。その後、それぞれの設定を変更します。
To connect to a local [[postfix]] instance with a [[Postfix#Virtual_mail|virtual mail]] setup, first [[Postorius#Set_an_Alias_Domain|set an alias domain]]. Afterwards alter the respective configuration.
 
   
 
{{hc|/etc/postfix/main.cf|
 
{{hc|/etc/postfix/main.cf|
169行目: 169行目:
 
== 起動 ==
 
== 起動 ==
   
  +
{{ic|mailman3.service}} を [[有効化]] して [[起動]] します。
[[Enable]] and [[start]] {{ic|mailman3.service}}.
 
   
  +
タイマーを備えた [[systemd]] サービスがいくつか存在し、リスト管理のさまざまな側面を処理します。
Several [[systemd]] services with timers exist, taking care of various aspects of the list management:
 
   
* {{ic|mailman3-digests.timer}}: for sending out daily digests to subscribers
+
* {{ic|mailman3-digests.timer}}: 毎日のダイジェストを購読者に送信するため
* {{ic|mailman3-gatenews.timer}}: for hourly polling of [[Wikipedia:Network News Transfer Protocol|NNTP]] servers for news
+
* {{ic|mailman3-gatenews.timer}}: ニュースに関する [[Wikipedia:ja:Network News Transfer Protocol|NNTP]] サーバーの時間ごとのポーリング用
* {{ic|mailman3-notify.timer}}: for sending out daily notifications to admins about pending requests
+
* {{ic|mailman3-notify.timer}}: 保留中のリクエストに関する通知を管理者に毎日送信するため
   
 
== セットアップ ==
 
== セットアップ ==
181行目: 181行目:
 
=== メールサーバとの統合 ===
 
=== メールサーバとの統合 ===
   
  +
=== Hyperkitty との統合 ===
{{Expansion|Example for setup with [[mail server]] (based on [https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html upstream documentation]).}}
 
   
  +
Mailman は、それ自体ではメールを自動的にアーカイブしません。[[Hyperkitty]] Web アプリケーションはこの目的に使用されます。 プラグインに基づいて、mailman はアーカイブのために [[Hyperkitty]] インスタンスにメールを送信できます。
=== Integrate with Hyperkitty ===
 
   
  +
{{Pkg|mailman3-hyperkitty}} パッケージを [[インストール]] し、{{ic|/etc/mailman-hyperkitty.cfg}} を設定します。
Mailman does not automatically archive mails on its own. The [[Hyperkitty]] web application is used for this purpose. Based on a plugin, mailman is able to send mails to a [[Hyperkitty]] instance for archival.
 
 
[[インストール]] the {{Pkg|mailman3-hyperkitty}} package and configure {{ic|/etc/mailman-hyperkitty.cfg}}.
 
   
 
{{hc|/etc/mailman-hyperkitty.cfg|
 
{{hc|/etc/mailman-hyperkitty.cfg|
195行目: 193行目:
 
}}
 
}}
   
  +
その後、mailman にプラグインを認識させます。
Afterwards, make mailman aware of the plugin:
 
   
 
{{hc|/etc/mailman.cfg|
 
{{hc|/etc/mailman.cfg|
208行目: 206行目:
 
=== mailman 3.0 未満からのマイグレート ===
 
=== mailman 3.0 未満からのマイグレート ===
   
Mailman offers the possibility of importing mailman < 3.0 based list databases ({{ic|config.pck}}). Run the following command as the {{ic|mailman}} user (e.g. using [[sudo]] or [[su]]):
+
Mailman は、mailman < 3.0 ベースのリストデータベース ({{ic|config.pck}}) をインポートする機能を提供します。 {{ic|mailman}} ユーザーとして次のコマンドを実行します (例: [[sudo]] または [[su]] を使用。)
   
 
[mailman]$ mailman import21 ''LISTSPEC'' ''PICKLE_FILE''
 
[mailman]$ mailman import21 ''LISTSPEC'' ''PICKLE_FILE''
   
Here, {{ic|''LISTSPEC''}} represents a fully-qualified name of a list to import (e.g. {{ic|list@example.com}}) and {{ic|''PICKLE_FILE''}} the path to the list's {{ic|config.pck}} file.
+
ここで、{{ic|''LISTSPEC''}} はインポートするリストの完全修飾名 (例: {{ic|list@example.com}}) を表し、{{ic|''PICKLE_FILE''}} はインポートするリストの完全修飾名を表し、{{ic|config.pck}} は、リストのファイルへのパスを表します。
   
  +
{{Note|インポートされる mailman2 リストは、ターゲットの mailman インスタンスにすでに存在している必要があります。}}
{{Note|The mailman2 list to be imported '''must''' already exist on the target mailman instance.}}
 
   
 
=== REST API ===
 
=== REST API ===
   
Mailman exposes a [https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/rest.html#the-rest-server REST API], which can be interfaced using custom tooling, based on {{Pkg|python-mailmanclient}}.
+
Mailman [https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/rest.html#the-rest-server REST API] を公開しています。これは、{{Pkg|python-mailmanclient}} をベースにしたスタムツールを使用できます。
   
 
== 参照 ==
 
== 参照 ==
   
* [https://mailman.readthedocs.io/en/latest/ Mailman Documentation] - The upstream documentation
+
* [https://mailman.readthedocs.io/en/latest/ Mailman Documentation] - ドキュメント
* [https://mailmanclient.readthedocs.io/en/latest/ Mailmanclient Documentation] - The upstream documentation
+
* [https://mailmanclient.readthedocs.io/en/latest/ Mailmanclient Documentation] - 上流のドキュメント
* [https://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman Connecting to Mailman] - The upstream documentation on {{Pkg|mailman3-hyperkitty}}
+
* [https://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman Connecting to Mailman] - {{Pkg|mailman3-hyperkitty}} に関するアップストリームのドキュメント
* [https://docs.mailman3.org/en/latest/ Mailman Suite Documentation] - The (high level) upstream documentation for the entire Mailman Suite (Mailman, Hyperkitty and Postorius)
+
* [https://docs.mailman3.org/en/latest/ Mailman Suite Documentation] - Mailman スイート全体 (MailmanHyperkitty、Postorius) (高レベルの) アップストリームドキュメント

2023年10月28日 (土) 19:49時点における最新版

Mailman はメーリングリスト管理システムです。メールサーバーと組み合わせて使用します。

インストール

mailman3 パッケージをインストールします。

ノート: mailman3 は近い将来 mailman に置き換わる予定です。両方のアプリケーションが /var/lib/mailman をステートディレクトリ、mailman ユーザーとして使うので、現在衝突していて、一緒にインストールすることはできません。

Mailman は Postorius (設定用) と Hyperkitty (アーカイブ用)と一緒に使うことができます。

ノート: Mailman は専用の mailman ユーザーとして実行されます。したがって、mailman 実行ファイルは、mailman ユーザーとして実行する必要があります。

設定

Mailman の設定はすべて /etc/mailman.cfg で行われます。全ての可能な設定オプションとデフォルトの設定を説明するスキーマは /usr/lib/python3.8/site-packages/mailman/config/schema.cfg に格納されています。

また、コマンドラインからも設定にアクセスすることができます。mailman ユーザーとして (例: sudosu を使って) 以下のコマンドを実行します。

[mailman]$ mailman conf

データベース

Mailman はデフォルトで、/var/lib/mailman/data/ の SQLite データベース を使用します。 ですが、MariaDB または PostgreSQL を使用するように設定できます。

SQLite

SQLite データベースのデフォルトの場所はすでに schema.cfg に反映されているため、Mailman で設定する必要はありません。

/etc/mailman.cfg
[database]
url: sqlite:////var/lib/mailman/data/mailman.db

MariaDB

python-pymysql パッケージを インストール し、MariaDB にデータベースを設定します。

/etc/mailman.cfg
[database]
class: mailman.database.mysql.MySQLDatabase
url: mysql+pymysql://myuser:mypassword@mymysqlhost/mailman?charset=utf8&use_unicode=1

PostgreSQL

python-psycopg2 パッケージを インストール し、PostgreSQL を使用してデータベースを作成します。

/etc/mailman.cfg
[database]
class: mailman.database.postgresql.PostgreSQLDatabase
url: postgres://myuser:mypassword@mypghost/mailman

REST API

Mailman は、設定の [webservice] セクションの設定に基づいて REST API を公開します。admin_useradmin_pass のデフォルト値を必ず置き換えてください (以下の例の値は使用しないでください)

/etc/mailman.cfg
[webservice]
admin_user: my_new_admin_user_name
admin_pass: my_new_admin_user_password

ARC

デフォルトでは、DMARC および DKIM は無効になっています。設定は、設定ファイルの [ARC] セクションで行われます。必ず必要な値を設定し、デフォルトに関するドキュメントを読んでください。

/etc/mailman.cfg
[ARC]
enabled: yes
authserv_id: mailserver.tld
trusted_authserv_ids: subdomain.mailserver.tld, other.mailserver.tld
privkey: /path/to/privatekey.pem
selector: test
domain: mailserver.tld

MTA

メール転送エージェント (MTA) を接続するには、設定ファイルの [mta] セクションを設定する必要があります。 アップストリームドキュメント では、postfixeximsendmail の例について説明していますが、その他の例も説明しています。 MTA は技術的には可能です。

Postfix

ローカル postfix インスタンスに接続するには、次の構成セクションを使用できます。

/etc/mailman.cfg
[mta]
incoming: mailman.mta.postfix.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_host: mail.example.com
lmtp_port: 8024
smtp_host: mail.example.com
smtp_port: 25

postfix 設定は互換性を確保するために拡張する必要があります (アップストリームのメモ を参照)

/etc/postfix/main.cf

[..]
recipient_delimiter = +
unknown_local_recipient_reject_code = 550
owner_request_special = no
[..]

さらに、postfix は mailman の トランスポートマップ を認識する必要があります。postfix の設定に応じて、これらは次のようになります。

ノート: 次の例では、transport_mapslocal_recipient_mapsrelay_domainsvirtual_mailbox_domains、および virtual_alias_maps の既存の値がマージされることを前提としています。追加の値。
/etc/postfix/main.cf

[..]
transport_maps = hash:/var/lib/mailman/data/postfix_lmtp
local_recipient_maps = hash:/var/lib/mailman/data/postfix_lmtp
relay_domains = hash:/var/lib/mailman/data/postfix_domains
[..]

デフォルトのハッシュベースのエイリアスマップを作成するために mailman が postmap に直接アクセスできない場合は、代わりに正規表現ベースのエイリアスマップを生成します。 デフォルトの Python クラスベースの設定を上書きするために、mailman は設定ファイルの使用を許可します。次のファイルを作成します。

/etc/postfix-mailman.cfg
[postfix]
postmap_command: /usr/bin/postmap
transport_file_type: regex

このファイルを mailman の設定ファイルの [mta] セクションに追加します。

/etc/mailman.cfg
[mta]
[..]
configuration: /etc/postfix-mailman.cfg

その後、regexp ベースのエクスポートを postfix 設定で使用できるようになります。

/etc/postfix/main.cf

[..]
transport_maps = regexp:/var/lib/mailman/data/postfix_lmtp
local_recipient_maps = regexp:/var/lib/mailman/data/postfix_lmtp
relay_domains = regexp:/var/lib/mailman/data/postfix_domains
[..]

ノート: タイプを変更した後(例: hash から regexp へ)、必ず新しいエイリアスマップを作成してください: [mailman]$ mailman aliases

仮想メール セットアップを使用してローカルの postfix インスタンスに接続するには、まず エイリアス ドメインを設定 します。その後、それぞれの設定を変更します。

/etc/postfix/main.cf

[..]
local_recipient_maps = regexp:/var/lib/mailman/data/postfix_lmtp
transport_maps = regexp:/var/lib/mailman/data/postfix_lmtp
virtual_mailbox_domains = regexp:/var/lib/mailman/data/postfix_domains
virtual_alias_maps = regexp:/var/lib/mailman/data/postfix_vmap
[..]

起動

mailman3.service有効化 して 起動 します。

タイマーを備えた systemd サービスがいくつか存在し、リスト管理のさまざまな側面を処理します。

  • mailman3-digests.timer: 毎日のダイジェストを購読者に送信するため
  • mailman3-gatenews.timer: ニュースに関する NNTP サーバーの時間ごとのポーリング用
  • mailman3-notify.timer: 保留中のリクエストに関する通知を管理者に毎日送信するため

セットアップ

メールサーバとの統合

Hyperkitty との統合

Mailman は、それ自体ではメールを自動的にアーカイブしません。Hyperkitty Web アプリケーションはこの目的に使用されます。 プラグインに基づいて、mailman はアーカイブのために Hyperkitty インスタンスにメールを送信できます。

mailman3-hyperkitty パッケージを インストール し、/etc/mailman-hyperkitty.cfg を設定します。

/etc/mailman-hyperkitty.cfg
[general]
base_url: https://example.tld/hyperkitty/
api_key: super_secret_password

その後、mailman にプラグインを認識させます。

/etc/mailman.cfg
[archiver.hyperkitty]
class: mailman_hyperkitty.Archiver
enable: yes
configuration: /etc/mailman-hyperkitty.cfg

ヒントとテクニック

mailman 3.0 未満からのマイグレート

Mailman は、mailman < 3.0 ベースのリストデータベース (config.pck) をインポートする機能を提供します。 mailman ユーザーとして次のコマンドを実行します (例: sudo または su を使用。)

[mailman]$ mailman import21 LISTSPEC PICKLE_FILE

ここで、LISTSPEC はインポートするリストの完全修飾名 (例: list@example.com) を表し、PICKLE_FILE はインポートするリストの完全修飾名を表し、config.pck は、リストのファイルへのパスを表します。

ノート: インポートされる mailman2 リストは、ターゲットの mailman インスタンスにすでに存在している必要があります。

REST API

Mailman は REST API を公開しています。これは、python-mailmanclient をベースにしたスタムツールを使用できます。

参照