Thanks. I was able to create a python module and install it which sets up 2 new styles, and I have one of those now set as the default list style in Postorius.
I needed to include a few more interfaces but otherwise kept to the example plugin file (just made another file for the other list).
from public import public
from mailman.interfaces.styles import IStyle
from mailman.styles.default import LegacyDefaultStyle
from zope.interface import implementer
from mailman.interfaces.action import Action, FilterAction
from mailman.interfaces.archiver import ArchivePolicy
from mailman.interfaces.autorespond import ResponseAction
from mailman.interfaces.bounce import UnrecognizedBounceDisposition
from mailman.interfaces.digests import DigestFrequency
from mailman.interfaces.mailinglist import (
DMARCMitigateAction, Personalization, ReplyToMunging, SubscriptionPolicy, ArchiveRenderingMode)
from mailman.interfaces.nntp import NewsgroupModeration
from mailman.model.roster import RosterVisibility
# Documentation on List styles
# https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/styles/docs/styles.html
# also some was worked out from src/mailman/styles/base.py
@public
@implementer(IStyle)
class MyPrivateStyle(LegacyDefaultStyle):
# Provide a unique name to this style so it doesn't clash with the ones
# defined by default.
name = 'my-announce-style'
# Provide a usable description that will be shown to the users in Web
# Interface.
description = 'My Announce mailing list style.'
def apply(self, mailing_list):
"""See `IStyle`."""
# Set settings from super class.
super().apply(mailing_list)
# Make modifications on top.
mailing_list.admin_immed_notify = True
mailing_list.admin_notify_mchanges = True
mailing_list.advertised = True
mailing_list.allow_list_posts = False
mailing_list.anonymous_list = False
mailing_list.archive_policy = ArchivePolicy.private
mailing_list.archive_rendering_mode = ArchiveRenderingMode.markdown
mailing_list.collapse_alternatives = False
mailing_list.convert_html_to_plaintext = False
mailing_list.default_member_action = Action.defer
mailing_list.default_nonmember_action = Action.hold
mailing_list.digest_send_periodic = False
mailing_list.digests_enabled = False
mailing_list.include_rfc2369_headers = True
mailing_list.max_message_size = "40000"
mailing_list.max_num_recipients = "30"
mailing_list.member_roster_visibility = RosterVisibility.moderators
mailing_list.send_goodbye_message = True
mailing_list.send_welcome_message = True
mailing_list.subscription_policy = SubscriptionPolicy.moderate
mailing_list.unsubscription_policy = SubscriptionPolicy.moderate
Having a docker-mailman setup means needing to install this any time that the mailmail-core container is rebuilt (not all that often), however the source code for the module can live in a host volume such as /opt/mailman/core/var/plugins , it is simply an execution of the install which is need after a container is rebuilt.
eg: docker exec mailman-core pip install -E /opt/mailman/var/plugins/yourplugin
I currently need to pip install django-allauth[saml] and apk add openldap-dev (this one should be in a new version of the container) on any new mailman-core container anyway so I'm not too worried.