···11+# Mailman {#module-services-mailman}
22+33+[Mailman](https://www.list.org) is free
44+software for managing electronic mail discussion and e-newsletter
55+lists. Mailman and its web interface can be configured using the
66+corresponding NixOS module. Note that this service is best used with
77+an existing, securely configured Postfix setup, as it does not automatically configure this.
88+99+## Basic usage with Postfix {#module-services-mailman-basic-usage}
1010+1111+For a basic configuration with Postfix as the MTA, the following settings are suggested:
1212+```
1313+{ config, ... }: {
1414+ services.postfix = {
1515+ enable = true;
1616+ relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"];
1717+ sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem";
1818+ sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem";
1919+ config = {
2020+ transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2121+ local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2222+ };
2323+ };
2424+ services.mailman = {
2525+ enable = true;
2626+ serve.enable = true;
2727+ hyperkitty.enable = true;
2828+ webHosts = ["lists.example.org"];
2929+ siteOwner = "mailman@example.org";
3030+ };
3131+ services.nginx.virtualHosts."lists.example.org".enableACME = true;
3232+ networking.firewall.allowedTCPPorts = [ 25 80 443 ];
3333+}
3434+```
3535+3636+DNS records will also be required:
3737+3838+ - `AAAA` and `A` records pointing to the host in question, in order for browsers to be able to discover the address of the web server;
3939+ - An `MX` record pointing to a domain name at which the host is reachable, in order for other mail servers to be able to deliver emails to the mailing lists it hosts.
4040+4141+After this has been done and appropriate DNS records have been
4242+set up, the Postorius mailing list manager and the Hyperkitty
4343+archive browser will be available at
4444+https://lists.example.org/. Note that this setup is not
4545+sufficient to deliver emails to most email providers nor to
4646+avoid spam -- a number of additional measures for authenticating
4747+incoming and outgoing mails, such as SPF, DMARC and DKIM are
4848+necessary, but outside the scope of the Mailman module.
4949+5050+## Using with other MTAs {#module-services-mailman-other-mtas}
5151+5252+Mailman also supports other MTA, though with a little bit more configuration. For example, to use Mailman with Exim, you can use the following settings:
5353+```
5454+{ config, ... }: {
5555+ services = {
5656+ mailman = {
5757+ enable = true;
5858+ siteOwner = "mailman@example.org";
5959+ enablePostfix = false;
6060+ settings.mta = {
6161+ incoming = "mailman.mta.exim4.LMTP";
6262+ outgoing = "mailman.mta.deliver.deliver";
6363+ lmtp_host = "localhost";
6464+ lmtp_port = "8024";
6565+ smtp_host = "localhost";
6666+ smtp_port = "25";
6767+ configuration = "python:mailman.config.exim4";
6868+ };
6969+ };
7070+ exim = {
7171+ enable = true;
7272+ # You can configure Exim in a separate file to reduce configuration.nix clutter
7373+ config = builtins.readFile ./exim.conf;
7474+ };
7575+ };
7676+}
7777+```
7878+7979+The exim config needs some special additions to work with Mailman. Currently
8080+NixOS can't manage Exim config with such granularity. Please refer to
8181+[Mailman documentation](https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html)
8282+for more info on configuring Mailman for working with Exim.
+2
nixos/modules/services/mail/mailman.nix
···642642643643 meta = {
644644 maintainers = with lib.maintainers; [ lheckemann qyliss ma27 ];
645645+ # Don't edit the docbook xml directly, edit the md and generate it:
646646+ # `pandoc mailman.md -t docbook --top-level-division=chapter --extract-media=media -f markdown-smart --lua-filter ../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua --lua-filter ../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua > mailman.xml`
645647 doc = ./mailman.xml;
646648 };
647649
+57-45
nixos/modules/services/mail/mailman.xml
···11-<chapter xmlns="http://docbook.org/ns/docbook"
22- xmlns:xlink="http://www.w3.org/1999/xlink"
33- xmlns:xi="http://www.w3.org/2001/XInclude"
44- version="5.0"
55- xml:id="module-services-mailman">
11+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-mailman">
62 <title>Mailman</title>
73 <para>
84 <link xlink:href="https://www.list.org">Mailman</link> is free
95 software for managing electronic mail discussion and e-newsletter
106 lists. Mailman and its web interface can be configured using the
117 corresponding NixOS module. Note that this service is best used with
1212- an existing, securely configured Postfix setup, as it does not automatically configure this.
88+ an existing, securely configured Postfix setup, as it does not
99+ automatically configure this.
1310 </para>
1414-1511 <section xml:id="module-services-mailman-basic-usage">
1612 <title>Basic usage with Postfix</title>
1713 <para>
1818- For a basic configuration with Postfix as the MTA, the following settings are suggested:
1919- <programlisting>
1414+ For a basic configuration with Postfix as the MTA, the following
1515+ settings are suggested:
1616+ </para>
1717+ <programlisting>
2018{ config, ... }: {
2119 services.postfix = {
2220 enable = true;
2323- relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"];
2424- sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem";
2525- sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem";
2121+ relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"];
2222+ sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem";
2323+ sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem";
2624 config = {
2727- transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2828- local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2525+ transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2626+ local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"];
2927 };
3028 };
3129 services.mailman = {
3230 enable = true;
3331 serve.enable = true;
3432 hyperkitty.enable = true;
3535- webHosts = ["lists.example.org"];
3636- siteOwner = "mailman@example.org";
3333+ webHosts = ["lists.example.org"];
3434+ siteOwner = "mailman@example.org";
3735 };
3838- services.nginx.virtualHosts."lists.example.org".enableACME = true;
3636+ services.nginx.virtualHosts."lists.example.org".enableACME = true;
3937 networking.firewall.allowedTCPPorts = [ 25 80 443 ];
4038}
4139</programlisting>
4242- </para>
4340 <para>
4441 DNS records will also be required:
4545- <itemizedlist>
4646- <listitem><para><literal>AAAA</literal> and <literal>A</literal> records pointing to the host in question, in order for browsers to be able to discover the address of the web server;</para></listitem>
4747- <listitem><para>An <literal>MX</literal> record pointing to a domain name at which the host is reachable, in order for other mail servers to be able to deliver emails to the mailing lists it hosts.</para></listitem>
4848- </itemizedlist>
4942 </para>
4343+ <itemizedlist spacing="compact">
4444+ <listitem>
4545+ <para>
4646+ <literal>AAAA</literal> and <literal>A</literal> records
4747+ pointing to the host in question, in order for browsers to be
4848+ able to discover the address of the web server;
4949+ </para>
5050+ </listitem>
5151+ <listitem>
5252+ <para>
5353+ An <literal>MX</literal> record pointing to a domain name at
5454+ which the host is reachable, in order for other mail servers
5555+ to be able to deliver emails to the mailing lists it hosts.
5656+ </para>
5757+ </listitem>
5858+ </itemizedlist>
5059 <para>
5151- After this has been done and appropriate DNS records have been
5252- set up, the Postorius mailing list manager and the Hyperkitty
5353- archive browser will be available at
5454- https://lists.example.org/. Note that this setup is not
5555- sufficient to deliver emails to most email providers nor to
5656- avoid spam -- a number of additional measures for authenticating
5757- incoming and outgoing mails, such as SPF, DMARC and DKIM are
5858- necessary, but outside the scope of the Mailman module.
6060+ After this has been done and appropriate DNS records have been set
6161+ up, the Postorius mailing list manager and the Hyperkitty archive
6262+ browser will be available at https://lists.example.org/. Note that
6363+ this setup is not sufficient to deliver emails to most email
6464+ providers nor to avoid spam -- a number of additional measures for
6565+ authenticating incoming and outgoing mails, such as SPF, DMARC and
6666+ DKIM are necessary, but outside the scope of the Mailman module.
5967 </para>
6068 </section>
6169 <section xml:id="module-services-mailman-other-mtas">
6270 <title>Using with other MTAs</title>
6371 <para>
6464- Mailman also supports other MTA, though with a little bit more configuration. For example, to use Mailman with Exim, you can use the following settings:
6565- <programlisting>
7272+ Mailman also supports other MTA, though with a little bit more
7373+ configuration. For example, to use Mailman with Exim, you can use
7474+ the following settings:
7575+ </para>
7676+ <programlisting>
6677{ config, ... }: {
6778 services = {
6879 mailman = {
6980 enable = true;
7070- siteOwner = "mailman@example.org";
8181+ siteOwner = "mailman@example.org";
7182 enablePostfix = false;
7283 settings.mta = {
7373- incoming = "mailman.mta.exim4.LMTP";
7474- outgoing = "mailman.mta.deliver.deliver";
7575- lmtp_host = "localhost";
7676- lmtp_port = "8024";
7777- smtp_host = "localhost";
7878- smtp_port = "25";
7979- configuration = "python:mailman.config.exim4";
8484+ incoming = "mailman.mta.exim4.LMTP";
8585+ outgoing = "mailman.mta.deliver.deliver";
8686+ lmtp_host = "localhost";
8787+ lmtp_port = "8024";
8888+ smtp_host = "localhost";
8989+ smtp_port = "25";
9090+ configuration = "python:mailman.config.exim4";
8091 };
8192 };
8293 exim = {
···8798 };
8899}
89100</programlisting>
9090- </para>
91101 <para>
9292- The exim config needs some special additions to work with Mailman. Currently
9393- NixOS can't manage Exim config with such granularity. Please refer to
9494- <link xlink:href="https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html">Mailman documentation</link>
9595- for more info on configuring Mailman for working with Exim.
102102+ The exim config needs some special additions to work with Mailman.
103103+ Currently NixOS can't manage Exim config with such granularity.
104104+ Please refer to
105105+ <link xlink:href="https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html">Mailman
106106+ documentation</link> for more info on configuring Mailman for
107107+ working with Exim.
96108 </para>
97109 </section>
98110</chapter>