1# Mailman 323Setting up Mailman 3 with maddy involves some additional work as compared to4other MTAs as there is no Python package in Mailman suite that can generate5address lists in format supported by maddy.67We assume you are already familiar with Mailman configuration guidelines and8how stuff works in general/for other MTAs.910## Accepting messages1112First of all, you need to use NullMTA package for mta.incoming so Mailman will13not try to generate any configs. LMTP listener is configured as usual.14```15[mta]16incoming: mailman.mta.null.NullMTA17lmtp_host: 127.0.0.118lmtp_port: 802419```2021After that, you will need to configure maddy to send messages to Mailman.2223The preferable way of doing so is destination_in and table.regexp:24```25msgpipeline local_routing {26 destination_in regexp "first-mailinglist(-(bounces\+.*|confirm\+.*|join|leave|owner|request|subscribe|unsubscribe))?@lists.example.org" {27 deliver_to lmtp tcp://127.0.0.1:802428 }29 destination_in regexp "second-mailinglist(-(bounces\+.*|confirm\+.*|join|leave|owner|request|subscribe|unsubscribe))?@lists.example.org" {30 deliver_to lmtp tcp://127.0.0.1:802431 }3233 ...34}35```3637A more simple option is also meaningful (provided you have a separate domain38for lists):39```40msgpipeline local_routing {41 destination lists.example.org {42 deliver_to lmtp tcp://127.0.0.1:802443 }4445 ...46}47```48But this variant will lead to inefficient handling of non-existing subaddresses.49See [Mailman Core issue 14](https://gitlab.com/mailman/mailman/-/issues/14) for50details. (5 year old issue, sigh...)5152## Sending messages5354It is recommended to configure Mailman to send messages using Submission port55with authentication and TLS as maddy does not allow relay on port 25 for local56clients as some MTAs do:57```58[mta]59# ... incoming configuration here ...60outgoing: mailman.mta.deliver.deliver61smtp_host: mx.example.org62smtp_port: 46563smtp_user: mailman@example.org64smtp_pass: something-very-secret65smtp_secure_mode: smtps66```6768If you do not want to use TLS and/or authentication you can create a separate69endpoint and just point Mailman to it. E.g.70```71smtp tcp://127.0.0.1:2525 {72 destination postmaster $(local_domains) {73 deliver_to &local_routing74 }75 default_destination {76 deliver_to &remote_queue77 }78}79```8081Note that if you use a separate domain for lists, it need to be included in82local_domains macro in default config. This will ensure maddy signs messages83using DKIM for outbound messages. It is also highly recommended to configure84ARC in Mailman 3.