Hi all
I have installed a brandnew server - ubuntu 21.10, mailman3 version 3.3.3 (Tom Sawyer)
I want to set some default settings to all new lists, as we are creating them through API from another system, i do this (snipped straight from the shell) :
from mailman.interfaces.styles import IStyleManager manager = getUtility(IStyleManager) from zope.interface import implementer from mailman.interfaces.styles import IStyle @implementer(IStyle) ... class EcoStyle: ... name = 'ECOstyle' ... description = 'ECO mailing list style.' ... def apply(self, ml): ... ml.dmarc_mitigate_action = 'munge_from' ... ml.dmarc_mitigate_unconditionally = 'True' ... ml.send_welcome_message = 'True' ... ml.subject_prefix = '' ... ml.subscription_policy = 'moderate' ... ml.max_message_size = '0' ... manager.register(EcoStyle()) commit()
from zope.component import getUtility from mailman.interfaces.styles import IStyleManager manager = getUtility(IStyleManager)
for style in manager.styles: ... print(style.name) ... ECOstyle legacy-announce legacy-default
No error all seem good, i then do this to confirm the style is there: private-default
It shows me its there, then i proceed to quit() and go back in to the shell, and do this:
quit() ecoadmin@list01:/etc/mailman3$ sudo mailman shell Welcome to the GNU Mailman shell
from zope.component import getUtility from mailman.interfaces.styles import IStyleManager manager = getUtility(IStyleManager)
for style in manager.styles: ... print(style.name) ... legacy-announce legacy-default private-default
and now my newly created style is gone again ?
What am i missing here ?
Kind regards Kenneth Karlsson