lol

nixos/mailman: convert manual chapter to MD

pennae 5320b4cf a553f57c

+141 -45
+82
nixos/modules/services/mail/mailman.md
··· 1 + # Mailman {#module-services-mailman} 2 + 3 + [Mailman](https://www.list.org) is free 4 + software for managing electronic mail discussion and e-newsletter 5 + lists. Mailman and its web interface can be configured using the 6 + corresponding NixOS module. Note that this service is best used with 7 + an existing, securely configured Postfix setup, as it does not automatically configure this. 8 + 9 + ## Basic usage with Postfix {#module-services-mailman-basic-usage} 10 + 11 + For a basic configuration with Postfix as the MTA, the following settings are suggested: 12 + ``` 13 + { config, ... }: { 14 + services.postfix = { 15 + enable = true; 16 + relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"]; 17 + sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem"; 18 + sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem"; 19 + config = { 20 + transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; 21 + local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; 22 + }; 23 + }; 24 + services.mailman = { 25 + enable = true; 26 + serve.enable = true; 27 + hyperkitty.enable = true; 28 + webHosts = ["lists.example.org"]; 29 + siteOwner = "mailman@example.org"; 30 + }; 31 + services.nginx.virtualHosts."lists.example.org".enableACME = true; 32 + networking.firewall.allowedTCPPorts = [ 25 80 443 ]; 33 + } 34 + ``` 35 + 36 + DNS records will also be required: 37 + 38 + - `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; 39 + - 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. 40 + 41 + After this has been done and appropriate DNS records have been 42 + set up, the Postorius mailing list manager and the Hyperkitty 43 + archive browser will be available at 44 + https://lists.example.org/. Note that this setup is not 45 + sufficient to deliver emails to most email providers nor to 46 + avoid spam -- a number of additional measures for authenticating 47 + incoming and outgoing mails, such as SPF, DMARC and DKIM are 48 + necessary, but outside the scope of the Mailman module. 49 + 50 + ## Using with other MTAs {#module-services-mailman-other-mtas} 51 + 52 + 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: 53 + ``` 54 + { config, ... }: { 55 + services = { 56 + mailman = { 57 + enable = true; 58 + siteOwner = "mailman@example.org"; 59 + enablePostfix = false; 60 + settings.mta = { 61 + incoming = "mailman.mta.exim4.LMTP"; 62 + outgoing = "mailman.mta.deliver.deliver"; 63 + lmtp_host = "localhost"; 64 + lmtp_port = "8024"; 65 + smtp_host = "localhost"; 66 + smtp_port = "25"; 67 + configuration = "python:mailman.config.exim4"; 68 + }; 69 + }; 70 + exim = { 71 + enable = true; 72 + # You can configure Exim in a separate file to reduce configuration.nix clutter 73 + config = builtins.readFile ./exim.conf; 74 + }; 75 + }; 76 + } 77 + ``` 78 + 79 + The exim config needs some special additions to work with Mailman. Currently 80 + NixOS can't manage Exim config with such granularity. Please refer to 81 + [Mailman documentation](https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html) 82 + for more info on configuring Mailman for working with Exim.
+2
nixos/modules/services/mail/mailman.nix
··· 642 642 643 643 meta = { 644 644 maintainers = with lib.maintainers; [ lheckemann qyliss ma27 ]; 645 + # Don't edit the docbook xml directly, edit the md and generate it: 646 + # `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` 645 647 doc = ./mailman.xml; 646 648 }; 647 649
+57 -45
nixos/modules/services/mail/mailman.xml
··· 1 - <chapter xmlns="http://docbook.org/ns/docbook" 2 - xmlns:xlink="http://www.w3.org/1999/xlink" 3 - xmlns:xi="http://www.w3.org/2001/XInclude" 4 - version="5.0" 5 - xml:id="module-services-mailman"> 1 + <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-mailman"> 6 2 <title>Mailman</title> 7 3 <para> 8 4 <link xlink:href="https://www.list.org">Mailman</link> is free 9 5 software for managing electronic mail discussion and e-newsletter 10 6 lists. Mailman and its web interface can be configured using the 11 7 corresponding NixOS module. Note that this service is best used with 12 - an existing, securely configured Postfix setup, as it does not automatically configure this. 8 + an existing, securely configured Postfix setup, as it does not 9 + automatically configure this. 13 10 </para> 14 - 15 11 <section xml:id="module-services-mailman-basic-usage"> 16 12 <title>Basic usage with Postfix</title> 17 13 <para> 18 - For a basic configuration with Postfix as the MTA, the following settings are suggested: 19 - <programlisting> 14 + For a basic configuration with Postfix as the MTA, the following 15 + settings are suggested: 16 + </para> 17 + <programlisting> 20 18 { config, ... }: { 21 19 services.postfix = { 22 20 enable = true; 23 - relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"]; 24 - sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem"; 25 - sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem"; 21 + relayDomains = [&quot;hash:/var/lib/mailman/data/postfix_domains&quot;]; 22 + sslCert = config.security.acme.certs.&quot;lists.example.org&quot;.directory + &quot;/full.pem&quot;; 23 + sslKey = config.security.acme.certs.&quot;lists.example.org&quot;.directory + &quot;/key.pem&quot;; 26 24 config = { 27 - transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; 28 - local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; 25 + transport_maps = [&quot;hash:/var/lib/mailman/data/postfix_lmtp&quot;]; 26 + local_recipient_maps = [&quot;hash:/var/lib/mailman/data/postfix_lmtp&quot;]; 29 27 }; 30 28 }; 31 29 services.mailman = { 32 30 enable = true; 33 31 serve.enable = true; 34 32 hyperkitty.enable = true; 35 - webHosts = ["lists.example.org"]; 36 - siteOwner = "mailman@example.org"; 33 + webHosts = [&quot;lists.example.org&quot;]; 34 + siteOwner = &quot;mailman@example.org&quot;; 37 35 }; 38 - services.nginx.virtualHosts."lists.example.org".enableACME = true; 36 + services.nginx.virtualHosts.&quot;lists.example.org&quot;.enableACME = true; 39 37 networking.firewall.allowedTCPPorts = [ 25 80 443 ]; 40 38 } 41 39 </programlisting> 42 - </para> 43 40 <para> 44 41 DNS records will also be required: 45 - <itemizedlist> 46 - <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> 47 - <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> 48 - </itemizedlist> 49 42 </para> 43 + <itemizedlist spacing="compact"> 44 + <listitem> 45 + <para> 46 + <literal>AAAA</literal> and <literal>A</literal> records 47 + pointing to the host in question, in order for browsers to be 48 + able to discover the address of the web server; 49 + </para> 50 + </listitem> 51 + <listitem> 52 + <para> 53 + An <literal>MX</literal> record pointing to a domain name at 54 + which the host is reachable, in order for other mail servers 55 + to be able to deliver emails to the mailing lists it hosts. 56 + </para> 57 + </listitem> 58 + </itemizedlist> 50 59 <para> 51 - After this has been done and appropriate DNS records have been 52 - set up, the Postorius mailing list manager and the Hyperkitty 53 - archive browser will be available at 54 - https://lists.example.org/. Note that this setup is not 55 - sufficient to deliver emails to most email providers nor to 56 - avoid spam -- a number of additional measures for authenticating 57 - incoming and outgoing mails, such as SPF, DMARC and DKIM are 58 - necessary, but outside the scope of the Mailman module. 60 + After this has been done and appropriate DNS records have been set 61 + up, the Postorius mailing list manager and the Hyperkitty archive 62 + browser will be available at https://lists.example.org/. Note that 63 + this setup is not sufficient to deliver emails to most email 64 + providers nor to avoid spam -- a number of additional measures for 65 + authenticating incoming and outgoing mails, such as SPF, DMARC and 66 + DKIM are necessary, but outside the scope of the Mailman module. 59 67 </para> 60 68 </section> 61 69 <section xml:id="module-services-mailman-other-mtas"> 62 70 <title>Using with other MTAs</title> 63 71 <para> 64 - 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: 65 - <programlisting> 72 + Mailman also supports other MTA, though with a little bit more 73 + configuration. For example, to use Mailman with Exim, you can use 74 + the following settings: 75 + </para> 76 + <programlisting> 66 77 { config, ... }: { 67 78 services = { 68 79 mailman = { 69 80 enable = true; 70 - siteOwner = "mailman@example.org"; 81 + siteOwner = &quot;mailman@example.org&quot;; 71 82 enablePostfix = false; 72 83 settings.mta = { 73 - incoming = "mailman.mta.exim4.LMTP"; 74 - outgoing = "mailman.mta.deliver.deliver"; 75 - lmtp_host = "localhost"; 76 - lmtp_port = "8024"; 77 - smtp_host = "localhost"; 78 - smtp_port = "25"; 79 - configuration = "python:mailman.config.exim4"; 84 + incoming = &quot;mailman.mta.exim4.LMTP&quot;; 85 + outgoing = &quot;mailman.mta.deliver.deliver&quot;; 86 + lmtp_host = &quot;localhost&quot;; 87 + lmtp_port = &quot;8024&quot;; 88 + smtp_host = &quot;localhost&quot;; 89 + smtp_port = &quot;25&quot;; 90 + configuration = &quot;python:mailman.config.exim4&quot;; 80 91 }; 81 92 }; 82 93 exim = { ··· 87 98 }; 88 99 } 89 100 </programlisting> 90 - </para> 91 101 <para> 92 - The exim config needs some special additions to work with Mailman. Currently 93 - NixOS can't manage Exim config with such granularity. Please refer to 94 - <link xlink:href="https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html">Mailman documentation</link> 95 - for more info on configuring Mailman for working with Exim. 102 + The exim config needs some special additions to work with Mailman. 103 + Currently NixOS can't manage Exim config with such granularity. 104 + Please refer to 105 + <link xlink:href="https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html">Mailman 106 + documentation</link> for more info on configuring Mailman for 107 + working with Exim. 96 108 </para> 97 109 </section> 98 110 </chapter>