「Mailman」の版間の差分
Kusakata.bot2 (トーク | 投稿記録) Pkg/AUR テンプレートの更新 |
Kusanaginoturugi (トーク | 投稿記録) テンプレート:Expansion を削除 |
||
| (同じ利用者による、間の5版が非表示) | |||
| 1行目: | 1行目: | ||
[[Category:メール]] |
[[Category:メール]] |
||
[[Category:メールサーバー]] |
|||
[[en:Mailman]] |
|||
[[en:mailman]] |
|||
{{Note|このページでは Mailman 2 を対象としています。Mailman 3 については [[#Mailman 3]] を見てください。}} |
|||
[https://gitlab.com/mailman/mailman Mailman] はメーリングリスト管理システムです。[[メールサーバー]]と組み合わせて使用します。 |
|||
'''Mailman''' は電子メーリングリストを管理するためのアプリケーションです。基本的に''メールサーバー''や''ウェブサーバー''と合わせて使うことになるため、最初にメールサーバーを [[Postfix]], [[Exim]], [[Sendmail]], Qmail などから選択して (どれが良いかわからないときは、Postfix を選ぶことを推奨します)、それから [[Apache]], [[Lighttpd]], [[Nginx]] などのウェブサーバーを決めて下さい (どのウェブサーバーでもかまいません)。Mailman とメールサーバー、ウェブサーバーは必ずしも同一のコンピュータで実行する必要はありません。 |
|||
== インストール == |
|||
この記事では Mailman のインストールだけを扱います。メールサーバーやウェブサーバーのインストールについてはそれぞれの wiki ページを参照してください。 |
|||
{{Pkg|mailman3}} パッケージを[[インストール]]します。 |
|||
このガイドでは "arch" という名前のマシンを使って "a", "b", "c" という名前の組織のメーリングリストをセットアップすることにします。それぞれサンプルドメイン "a.org", "b.org", "c.org" が存在して "arch" にアクセスできるようになっているとします。各ドメインで以下のように設定します: |
|||
* Mailman の'''ウェブインターフェイス'''に {{ic|lists.''example''.org}} からアクセスできるようにする。 |
|||
* {{ic|lists.''example''.org/archives}} に'''リストのアーカイブ'''を配置する。 |
|||
* '''リストのアドレス'''は {{ic|''list''@''example''.org}} などとする。 |
|||
{{Note|{{Pkg|mailman3}} は近い将来 {{Pkg|mailman}} に置き換わる予定です。両方のアプリケーションが {{ic|/var/lib/mailman}} をステートディレクトリ、{{ic|mailman}} ユーザーとして使うので、現在衝突していて、一緒にインストールすることはできません。}} |
|||
'''注意事項''': Mailman を使うことで複数のドメインのリストを管理することはできますが、たとえドメインが違っていても同じ名前のリストを作ることはできません。 |
|||
Mailman は [[Postorius]] (設定用) と [[Hyperkitty]] (アーカイブ用)と一緒に使うことができます。 |
|||
== Mailman のインストール == |
|||
{{Note|''Mailman'' は専用の {{ic|mailman}} ユーザーとして実行されます。したがって、{{ic|mailman}} 実行ファイルは、{{ic|mailman}} ユーザーとして実行する必要があります。}} |
|||
{{Pkg|mailman}} パッケージを[[インストール]]してください。 |
|||
== |
== 設定 == |
||
Mailman の設定はすべて {{ic|/etc/mailman.cfg}} で行われます。全ての可能な設定オプションとデフォルトの設定を説明するスキーマは {{ic|/usr/lib/python3.8/site-packages/mailman/config/schema.cfg}} に格納されています。 |
|||
デフォルト設定は {{ic|/usr/lib/mailman/Mailman/Defaults.py}} ファイルに全て記述されています。ただしこのファイルを修正してはいけません。代わりに、'''mm_cfg.py''' ({{ic|/etc/mailman/mm_cfg.py}}) ファイルに変更を加えて下さい。Defaults.py のデフォルト設定と異なる値だけを mm_cfg.py に追加してください。Mailman をアップグレードしても mm_cfg.py に勝手に手が加えられることはありません。 |
|||
また、コマンドラインからも設定にアクセスすることができます。{{ic|mailman}} ユーザーとして (例: [[sudo]] や [[su]] を使って) 以下のコマンドを実行します。 |
|||
=== ウェブサーバーの統合 === |
|||
[mailman]$ mailman conf |
|||
{{bc|<nowiki> |
|||
DEFAULT_URL_HOST = 'lists.a.org' |
|||
=== データベース === |
|||
VIRTUAL_HOSTS.clear() |
|||
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) |
|||
add_virtualhost('lists.b.org', 'b.org') |
|||
add_virtualhost('lists.c.org', 'c.org') |
|||
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]]. |
|||
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['a.org', 'b.org', 'c.org'] |
|||
==== SQLite ==== |
|||
DEFAULT_URL_PATTERN = 'http://%s/' |
|||
PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/archives/%(listname)s' |
|||
</nowiki>}} |
|||
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. |
|||
Apache の場合を以下のように変更してください: |
|||
{{bc|<nowiki> |
|||
DEFAULT_URL_PATTERN = 'http://%s/lists/' |
|||
</nowiki>}} |
|||
{{hc|/etc/mailman.cfg| |
|||
=== MTA の統合 === |
|||
[database] |
|||
url: sqlite:////var/lib/mailman/data/mailman.db |
|||
}} |
|||
==== MariaDB ==== |
|||
選択したメールサーバーに合わせて {{ic|/etc/mailman/mm_cfg.py}} の中身を変更します。 |
|||
[[インストール]] the {{Pkg|python-pymysql}} package and configure a database on [[MariaDB]]. |
|||
=== Postfix の統合 === |
|||
{{hc|/etc/mailman.cfg|2= |
|||
{{bc|<nowiki> |
|||
[database] |
|||
DEFAULT_EMAIL_HOST = 'a.org' |
|||
class: mailman.database.mysql.MySQLDatabase |
|||
MTA = 'Postfix' |
|||
url: mysql+pymysql://''myuser'':''mypassword''@''mymysqlhost''/mailman?charset=utf8&use_unicode=1 |
|||
</nowiki>}} |
|||
}} |
|||
==== PostgreSQL ==== |
|||
{{ic|mm_cfg.py}} を編集したら、以下を実行して Postfix が必要とする aliases ファイルを作成してください: |
|||
# /usr/lib/mailman/bin/genaliases |
|||
[[インストール]] the {{Pkg|python-psycopg2}} package and create a database using [[PostgreSQL]]. |
|||
=== Exim の統合 === |
|||
{{hc|/etc/mailman.cfg| |
|||
{{bc|<nowiki> |
|||
[database] |
|||
DEFAULT_EMAIL_HOST = 'a.org' |
|||
class: mailman.database.postgresql.PostgreSQLDatabase |
|||
MTA = None |
|||
url: postgres://''myuser'':''mypassword''@''mypghost''/mailman |
|||
</nowiki>}} |
|||
}} |
|||
=== REST API === |
|||
== メールサーバーの設定 == |
|||
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). |
|||
{{Note|ドメインネームサーバー (DNS) の設定を確認してください。インターネット上でメールを送るには、DNS が正しくないといけません。MX レコードがメールホストに設定されている必要があります。DNS に関する情報はこのドキュメントでは扱いません。}} |
|||
{{hc|/etc/mailman.cfg| |
|||
=== Postfix === |
|||
[webservice] |
|||
admin_user: my_new_admin_user_name |
|||
admin_pass: my_new_admin_user_password |
|||
}} |
|||
=== ARC === |
|||
Postfix のインストールと設定については、[[Postfix]] を見て下さい (Mailman 用にのみ Postfix を使う場合は設定はとてもシンプルです: ''mailbox'' や ''database'' などは無視してかまいません)。 |
|||
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. |
|||
{{ic|/etc/postfix/main.cf}} に以下のフィールドと値を記述してください: |
|||
{{hc|/etc/mailman.cfg| |
|||
{{bc|1= |
|||
[ARC] |
|||
myhostname = arch.a.org |
|||
enabled: yes |
|||
mydomain = a.org |
|||
authserv_id: mailserver.tld |
|||
myorigin = $mydomain |
|||
trusted_authserv_ids: subdomain.mailserver.tld, other.mailserver.tld |
|||
mydestination = localhost, a.org, b.org, c.org |
|||
privkey: /path/to/privatekey.pem |
|||
mynetworks_style = host |
|||
selector: test |
|||
domain: mailserver.tld |
|||
}} |
|||
=== MTA === |
|||
alias_maps = hash:/etc/postfix/aliases, hash:/var/lib/mailman/data/aliases |
|||
alias_database = $alias_maps |
|||
virtual_alias_maps = hash:/etc/postfix/virtual, hash:/var/lib/mailman/data/virtual-mailman |
|||
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. |
|||
recipient_delimiter = + |
|||
}} |
|||
=== |
==== Postfix ==== |
||
To connect to a local [[postfix]] instance the following configuration section can be used: |
|||
{{ic|/etc/mail/exim.conf}} を編集して以下のセクションにエントリを追加してください: |
|||
{{hc|/etc/mailman.cfg| |
|||
{{ic|routers}} セクション: |
|||
[mta] |
|||
incoming: mailman.mta.postfix.LMTP |
|||
{{bc|1= |
|||
outgoing: mailman.mta.deliver.deliver |
|||
local_mailman_list: |
|||
lmtp_host: mail.example.com |
|||
driver = accept |
|||
lmtp_port: 8024 |
|||
require_files = /var/lib/mailman/lists/${lc::$local_part}/config.pck |
|||
smtp_host: mail.example.com |
|||
local_part_suffix = -admin : -bounces : -bounces+* : -confirm : -confirm+* : -join : -leave : -owner : -request : -subscribe : -unsubscribe |
|||
smtp_port: 25 |
|||
local_part_suffix_optional |
|||
transport = mailman_transport |
|||
}} |
}} |
||
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]). |
|||
{{ic|transports}} セクション: |
|||
{{hc|/etc/postfix/main.cf| |
|||
{{bc|1= |
|||
<nowiki> |
|||
mailman_transport: |
|||
[..] |
|||
driver = pipe |
|||
recipient_delimiter = + |
|||
user = mailman |
|||
unknown_local_recipient_reject_code = 550 |
|||
group = mailman |
|||
owner_request_special = no |
|||
home_directory = /usr/lib/mailman |
|||
[..] |
|||
current_directory = /usr/lib/mailman |
|||
</nowiki> |
|||
command = /usr/lib/mailman/mail/mailman '${if def:local_part_suffix {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}}{post}}' $local_part |
|||
}} |
}} |
||
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. |
|||
== ウェブサーバーの設定 == |
|||
{{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.}} |
|||
=== Nginx === |
|||
{{hc|/etc/postfix/main.cf| |
|||
Nginx のインストールと設定については、[[Nginx]] を見て下さい。Mailman のウェブインターフェイスは CGI を使います。以下の設定では Nginx と {{Ic|fcgiwrap}} を使います。詳しくは [[Nginx#CGI を動かす]] を参照。 |
|||
<nowiki> |
|||
[..] |
|||
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 |
|||
[..] |
|||
</nowiki> |
|||
}} |
|||
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. |
|||
ドメインごとに {{ic|/etc/nginx/nginx.conf}} に以下の設定を記述 (例: ''a.org''): |
|||
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| |
|||
{{bc|1= |
|||
[postfix] |
|||
server { |
|||
postmap_command: /usr/bin/postmap |
|||
server_name lists.a.org; |
|||
transport_file_type: regex |
|||
root /usr/lib/mailman/cgi-bin; |
|||
}} |
|||
Add the file to the {{ic|[mta]}} section in mailman's configuration file. |
|||
location = / { |
|||
rewrite ^ /listinfo permanent; |
|||
} |
|||
{{hc|/etc/mailman.cfg| |
|||
location / { |
|||
[mta] |
|||
fastcgi_split_path_info ^(/[^/]*)(.*)$; |
|||
''[..]'' |
|||
fastcgi_pass unix:/run/fcgiwrap.sock; |
|||
configuration: /etc/postfix-mailman.cfg |
|||
include fastcgi.conf; |
|||
}} |
|||
fastcgi_param PATH_INFO $fastcgi_path_info; |
|||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; |
|||
} |
|||
Afterwards the {{ic|regexp}} based exports can then be used in the [[postfix]] configuration. |
|||
location /icons { |
|||
alias /usr/lib/mailman/icons; |
|||
} |
|||
{{hc|/etc/postfix/main.cf| |
|||
location /archives { |
|||
<nowiki> |
|||
alias /var/lib/mailman/archives/public; |
|||
[..] |
|||
autoindex on; |
|||
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 |
|||
} |
|||
[..] |
|||
</nowiki> |
|||
}} |
}} |
||
{{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|Nginx は {{ic|user}} http と {{ic|group}} http で動作させないと Mailman はエラーを吐きます。{{ic|/etc/nginx/conf/nginx.conf}} の {{ic|user}} ディレクティブを次のように定義されていることを確認してください ({{Ic|html}} ブロックの外側): {{ic|user http http;}}。}} |
|||
=== Lighttpd === |
|||
server.modules = ("mod_rewrite", |
|||
"mod_cgi") |
|||
url.rewrite = ( "^/$" => "/listinfo" ) |
|||
alias.url = ( |
|||
"/icons" => "/usr/lib/mailman/icons", |
|||
"/archives" => "/var/lib/mailman/archives/public" |
|||
) |
|||
cgi.assign = ( |
|||
"/usr/lib/mailman/cgi-bin/admin" => "", |
|||
"/usr/lib/mailman/cgi-bin/admin/" => "", |
|||
"/usr/lib/mailman/cgi-bin/admindb" => "", |
|||
"/usr/lib/mailman/cgi-bin/admindb/" => "", |
|||
"/usr/lib/mailman/cgi-bin/confirm" => "", |
|||
"/usr/lib/mailman/cgi-bin/confirm/" => "", |
|||
"/usr/lib/mailman/cgi-bin/create" => "", |
|||
"/usr/lib/mailman/cgi-bin/create/" => "", |
|||
"/usr/lib/mailman/cgi-bin/edithtml" => "", |
|||
"/usr/lib/mailman/cgi-bin/edithtml/" => "", |
|||
"/usr/lib/mailman/cgi-bin/listinfo" => "", |
|||
"/usr/lib/mailman/cgi-bin/listinfo/" => "", |
|||
"/usr/lib/mailman/cgi-bin/options" => "", |
|||
"/usr/lib/mailman/cgi-bin/options/" => "", |
|||
"/usr/lib/mailman/cgi-bin/private" => "", |
|||
"/usr/lib/mailman/cgi-bin/private/" => "", |
|||
"/usr/lib/mailman/cgi-bin/rmlist" => "", |
|||
"/usr/lib/mailman/cgi-bin/rmlist/" => "", |
|||
"/usr/lib/mailman/cgi-bin/roster" => "", |
|||
"/usr/lib/mailman/cgi-bin/roster/" => "", |
|||
"/usr/lib/mailman/cgi-bin/subscribe" => "", |
|||
"/usr/lib/mailman/cgi-bin/subscribe/" => "" |
|||
) |
|||
$HTTP["host"] =~ "(^|\.)lists.a.org$" { |
|||
server.document-root = "/usr/lib/mailman/cgi-bin/" |
|||
server.errorlog = "/var/log/lighttpd/lists.a.org_error.log" |
|||
accesslog.filename = "/var/log/lighttpd/lists.a.org_access.log" |
|||
} |
|||
=== Apache === |
|||
以下の行を {{ic|/etc/mailman/mm_cfg.py}} に追加してください: |
|||
{{ic|IMAGE_LOGOS = '/mailman-icons/'}} |
|||
lists.a.org の作成にはバーチャルホストの作成も含まれます。{{ic|httpd.conf}} を編集するかわりに以下の設定をバーチャルホストの定義に移動すると良いでしょう。 |
|||
{{ic|/etc/httpd/conf/httpd.conf}} を編集して以下のスニペットを追加してください: |
|||
{{bc| |
|||
<IfModule alias_module> |
|||
Alias /mailman-icons/ "/usr/lib/mailman/icons/" |
|||
Alias /archives/ "/var/lib/mailman/archives/public/" |
|||
ScriptAlias /lists/ "/usr/lib/mailman/cgi-bin/" |
|||
ScriptAlias / "/usr/lib/mailman/cgi-bin/listinfo" |
|||
</IfModule> |
|||
<Directory "/usr/lib/mailman/cgi-bin/"> |
|||
AllowOverride None |
|||
Options Indexes FollowSymlinks ExecCGI |
|||
Require all granted |
|||
</Directory> |
|||
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. |
|||
<Directory "/usr/lib/mailman/icons/"> |
|||
Require all granted |
|||
</Directory> |
|||
{{hc|/etc/postfix/main.cf| |
|||
<Directory "/var/lib/mailman/archives/public/"> |
|||
<nowiki> |
|||
Require all granted |
|||
[..] |
|||
</Directory> |
|||
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 |
|||
[..] |
|||
</nowiki> |
|||
}} |
}} |
||
== 起動 == |
|||
httpd [[systemd]] サービスを再起動してください。 |
|||
[[Enable]] and [[start]] {{ic|mailman3.service}}. |
|||
== その後の設定 == |
|||
Several [[systemd]] services with timers exist, taking care of various aspects of the list management: |
|||
=== Site-wide メーリングリスト === |
|||
* {{ic|mailman3-digests.timer}}: for sending out daily digests to subscribers |
|||
Mailman が正しく動作するために必要なリストを作成するために、以下のコマンドを実行 (パスワードリマインダーなどに使われます): |
|||
* {{ic|mailman3-gatenews.timer}}: for hourly polling of [[Wikipedia:Network News Transfer Protocol|NNTP]] servers for news |
|||
# /usr/lib/mailman/bin/newlist mailman |
|||
* {{ic|mailman3-notify.timer}}: for sending out daily notifications to admins about pending requests |
|||
デフォルトドメインで "mailman" という名前のリストが作成されます (例: ''mailman@a.org'')。他のドメインでも作成する必要はありません (''b.org'' や ''c.org'')。 |
|||
== セットアップ == |
|||
後でサイトリストを購読するようにしてください。 |
|||
=== |
=== メールサーバとの統合 === |
||
=== Integrate with Hyperkitty === |
|||
定期的に実行される Mailman の機能があるため、[[systemd/タイマー|タイマー]]を設定して適切なプログラムを適切な時に実行させる必要があります: |
|||
# cd /usr/lib/systemd/system |
|||
# for X in mailman-*.timer ; do systemctl enable $X && systemctl start $X ; done |
|||
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. |
|||
=== Mailman の起動 === |
|||
[[インストール]] the {{Pkg|mailman3-hyperkitty}} package and configure {{ic|/etc/mailman-hyperkitty.cfg}}. |
|||
[[systemd#ユニットを使う|systemctl]] で {{ic|mailman}} が起動されるまで、Mailman は処理を開始してメールを送ることはありません。 |
|||
{{hc|/etc/mailman-hyperkitty.cfg| |
|||
何か問題が発生したら、より多くの情報を出力させることでトラブルシューティングに役立ちます: |
|||
[general] |
|||
# /usr/lib/mailman/bin/mailmanctl start |
|||
base_url: https://example.tld/hyperkitty/ |
|||
api_key: super_secret_password |
|||
}} |
|||
Afterwards, make mailman aware of the plugin: |
|||
=== パスワードの作成 === |
|||
コマンドラインから作成できるパスワードは2つ存在します。1番目のパスワードはどこでも使えるパスワードであるジェネラルパスワード (サイトパスワード) です。サイトパスワードは全てのリストの管理者ページに入ることができ、どのユーザーでもログインできます。 |
|||
{{hc|/etc/mailman.cfg| |
|||
2番目のパスワードはリストクリエイターパスワードです。サイトパスワードのような全ての権限を与える代わりに、新しいメーリングリストを作成する権限を与えることができます。サイトパスワードを持っていれば新しいメーリングリストを作ることもできますが、リストクリエイターパスワードはリストの作成だけに権限が制限されています。 |
|||
[archiver.hyperkitty] |
|||
class: mailman_hyperkitty.Archiver |
|||
ジェネラルパスワードを設定するには、以下のコマンドを実行: |
|||
enable: yes |
|||
# /usr/lib/mailman/bin/mmsitepass <general-password> |
|||
configuration: /etc/mailman-hyperkitty.cfg |
|||
リストクリエイターパスワードを設定するには、以下のコマンドを実行: |
|||
}} |
|||
# /usr/lib/mailman/bin/mmsitepass -c <list-creator-password> |
|||
リストクリエイターパスワードは必ずしも設定する必要はありませんが、ジェネラルパスワードは設定してください。 |
|||
== Mailman を使う == |
|||
リストを管理 (リストを作成・設定、ユーザーを管理など) するときはウェブインターフェイスを使います。それぞれのドメインごとに別々のインターフェイスが作られます。例えば、組織 "a" の URL は ''http://lists.a.org'' という具合です。 |
|||
コマンドラインから Mailman を管理することもできます。例えばリストを作成するには: |
|||
# newlist --urlhost=lists.b.org --emailhost=b.org list_name |
|||
== Mailman 3 == |
|||
Mailman 3 はモジュール形式で設計されています: |
|||
* {{AUR|mailman-core}}{{Broken package link|置換パッケージ: {{Pkg|mailman3}}}} (または {{AUR|mailman-core-git}}) は Mailman のコアコンポーネントを提供します。 |
|||
* {{AUR|python2-django-postorius}}{{Broken package link|パッケージが存在しません}} (または {{AUR|python2-django-postorius-git}}{{Broken package link|パッケージが存在しません}}) は Mailman の管理インターフェイスを提供します。 |
|||
* {{AUR|python2-django-hyperkitty}}{{Broken package link|パッケージが存在しません}} (または {{AUR|python2-django-hyperkitty-git}}{{Broken package link|パッケージが存在しません}}) はメーリングリストのアーカイブのインターフェイスです。 |
|||
* {{Pkg|python-mailmanclient}} と {{AUR|python2-mailmanclient}}{{Broken package link|パッケージが存在しません}} は Mailman の REST API の python バインディングを提供します。 |
|||
* {{AUR|python-mailman-hyperkitty-plugin}}{{Broken package link|置換パッケージ: {{Pkg|mailman3-hyperkitty}}}} はメールを hyperkitty に転送するのに使われるプラグインです。 |
|||
postorius や hyperkitty をデプロイするには django が必要になります。{{AUR|mailman-suite-git}}{{Broken package link|パッケージが存在しません}} にデプロイするのに使える django のプロジェクトスケルトンが入っています。付属している README.md を読んで postorius や hyperkitty をデプロイしてください。 |
|||
mailman-core は {{ic|/var/lib/mailman/var/etc/mailman.cfg}} で設定でき、次のコマンドで起動できます: |
|||
== ヒントとテクニック == |
|||
# systemctl start mailman.service |
|||
=== 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 import21 ''LISTSPEC'' ''PICKLE_FILE'' |
|||
'''check_perms''' スクリプトを実行してパーミッションがグループの所有権が正しいことを確認してください: |
|||
# /usr/lib/mailman/bin/check_perms |
|||
何か問題が表示される場合、手動で修正するか、同じプログラムを使用して修正してください (後者のほうが簡単です): |
|||
# /usr/lib/mailman/bin/check_perms -f |
|||
エラーが全く表示されなくなるまで上のコマンドを繰り返し実行してください。 |
|||
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. |
|||
=== Postfix === |
|||
{{Note|The mailman2 list to be imported '''must''' already exist on the target mailman instance.}} |
|||
{{ic|/var/lib/mailman/data/}} にある以下のファイルの所有者と所有ユーザーが ''mailman'' となっておりグループに書き込み権限が与えられていることを確認してください: |
|||
* aliases.db |
|||
* aliases |
|||
* virtual-mailman |
|||
* virtual-mailman.db |
|||
=== |
=== 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}}. |
|||
http://www.divideandconquer.se/2009/08/17/convert-mailman-translation-to-utf-8. |
|||
== 参照 == |
== 参照 == |
||
* [https://mailman.readthedocs.io/en/latest/ Mailman Documentation] - The upstream documentation |
|||
* [http://list.org/mailman-install/index.html GNU Mailman インストールマニュアル] |
|||
* [https://mailmanclient.readthedocs.io/en/latest/ Mailmanclient Documentation] - The upstream documentation |
|||
* [https://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman Connecting to Mailman] - The upstream documentation on {{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) |
|||
2023年4月5日 (水) 16:37時点における版
Mailman はメーリングリスト管理システムです。メールサーバーと組み合わせて使用します。
インストール
/var/lib/mailman をステートディレクトリ、mailman ユーザーとして使うので、現在衝突していて、一緒にインストールすることはできません。Mailman は Postorius (設定用) と Hyperkitty (アーカイブ用)と一緒に使うことができます。
mailman ユーザーとして実行されます。したがって、mailman 実行ファイルは、mailman ユーザーとして実行する必要があります。設定
Mailman の設定はすべて /etc/mailman.cfg で行われます。全ての可能な設定オプションとデフォルトの設定を説明するスキーマは /usr/lib/python3.8/site-packages/mailman/config/schema.cfg に格納されています。
また、コマンドラインからも設定にアクセスすることができます。mailman ユーザーとして (例: sudo や su を使って) 以下のコマンドを実行します。
[mailman]$ mailman conf
データベース
Mailman by default uses an SQLite database in /var/lib/mailman/data/, but can be configured to use MariaDB or PostgreSQL.
SQLite
The default location for the SQLite database is already reflected in the schema.cfg and therefore does not have to be set in Mailman's configuration.
/etc/mailman.cfg
[database] url: sqlite:////var/lib/mailman/data/mailman.db
MariaDB
インストール the python-pymysql package and configure a database on MariaDB.
/etc/mailman.cfg
[database] class: mailman.database.mysql.MySQLDatabase url: mysql+pymysql://myuser:mypassword@mymysqlhost/mailman?charset=utf8&use_unicode=1
PostgreSQL
インストール the python-psycopg2 package and create a database using PostgreSQL.
/etc/mailman.cfg
[database] class: mailman.database.postgresql.PostgreSQLDatabase url: postgres://myuser:mypassword@mypghost/mailman
REST API
Mailman exposes its REST API based on the settings in the [webservice] section of the configuration. Make sure to replace the default values for admin_user and admin_pass (do not use the example values below).
/etc/mailman.cfg
[webservice] admin_user: my_new_admin_user_name admin_pass: my_new_admin_user_password
ARC
By default DMARC and DKIM are disabled. The configuration takes place in the [ARC] section of the configuration file. Make sure to set necessary values and read the documentation about the defaults.
/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
To connect a mail-transfer-agent (MTA), it is necessary to configure the [mta] section in the configuration file. Upstream documentation covers examples for postfix, exim and sendmail, but other MTAs are technically possible.
Postfix
To connect to a local postfix instance the following configuration section can be used:
/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
The postfix configuration has to be extended to ensure compatibility (see upstream notes).
/etc/postfix/main.cf
[..] recipient_delimiter = + unknown_local_recipient_reject_code = 550 owner_request_special = no [..]
Additionally, postfix needs to be made aware of mailman's transport maps. Depending on the postfix configuration these may look similar to the following.
transport_maps, local_recipient_maps, relay_domains, virtual_mailbox_domains and virtual_alias_maps are merged with the additional values./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 [..]
If 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.
To overwrite the default Python-class based configuration, mailman allows the use of a configuration file. Create the following file:
/etc/postfix-mailman.cfg
[postfix] postmap_command: /usr/bin/postmap transport_file_type: regex
Add the file to the [mta] section in mailman's configuration file.
/etc/mailman.cfg
[mta] [..] configuration: /etc/postfix-mailman.cfg
Afterwards the regexp based exports can then be used in the postfix configuration.
/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 to regexp): [mailman]$ mailman aliasesTo connect to a local postfix instance with a virtual mail setup, first set an alias domain. Afterwards alter the respective configuration.
/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 [..]
起動
Enable and start mailman3.service.
Several systemd services with timers exist, taking care of various aspects of the list management:
mailman3-digests.timer: for sending out daily digests to subscribersmailman3-gatenews.timer: for hourly polling of NNTP servers for newsmailman3-notify.timer: for sending out daily notifications to admins about pending requests
セットアップ
メールサーバとの統合
Integrate with Hyperkitty
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 mailman3-hyperkitty package and configure /etc/mailman-hyperkitty.cfg.
/etc/mailman-hyperkitty.cfg
[general] base_url: https://example.tld/hyperkitty/ api_key: super_secret_password
Afterwards, make mailman aware of the plugin:
/etc/mailman.cfg
[archiver.hyperkitty] class: mailman_hyperkitty.Archiver enable: yes configuration: /etc/mailman-hyperkitty.cfg
ヒントとテクニック
mailman 3.0 未満からのマイグレート
Mailman offers the possibility of importing mailman < 3.0 based list databases (config.pck). Run the following command as the mailman user (e.g. using sudo or su):
[mailman]$ mailman import21 LISTSPEC PICKLE_FILE
Here, LISTSPEC represents a fully-qualified name of a list to import (e.g. list@example.com) and PICKLE_FILE the path to the list's config.pck file.
REST API
Mailman exposes a REST API, which can be interfaced using custom tooling, based on python-mailmanclient.
参照
- Mailman Documentation - The upstream documentation
- Mailmanclient Documentation - The upstream documentation
- Connecting to Mailman - The upstream documentation on mailman3-hyperkitty
- Mailman Suite Documentation - The (high level) upstream documentation for the entire Mailman Suite (Mailman, Hyperkitty and Postorius)