Dear Mailman-users list,
I have embarked on project to stand up a Mailman3 instance for general staff email announcements and a small number of adhoc lists.
I have a fair amount up and working using Docker and Postfix, with generally emails to/from lists working well, as well as the web interface.
One of the reasons I've used Mailman3 is the API and mailman shell options which I'm slowly trying to wrap my head around, but having some progress.
I have a question for the moment on something which has stumped me, and whilst I may have more questions as I continue on this implementation, I am hopeful someone can point out where I am going wrong on this.
Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
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
from zope.interface import implementer from mailman.interfaces.styles import IStyle @implementer(IStyle) ... class TestStyle: ... name = 'AB-Announce-Style' ... description = 'AB Announce mailing list style.' ... def apply(self, mailing_list): ... mailing_list.admin_immed_notify = true ... mailing_list.admin_notify_mchanges = true ... mailing_list.advertised = false ... mailing_list.allow_list_posts = false ... mailing_list.anonymous_list = false ... mailing_list.archive_policy = "private" ... mailing_list.archive_rendering_mode = "markdown" ... mailing_list.collapse_alternatives = false ... mailing_list.convert_html_to_plaintext = false ... mailing_list.default_member_action = "defer" ... mailing_list.default_nonmember_action = "hold" ... mailing_list.digest_send_periodic = false ... mailing_list.digests_enabled = false ... mailing_list.emergency = false ... mailing_list.include_rfc2369_headers = true ... mailing_list.max_message_size = 40000 ... mailing_list.max_num_recipients = 30 ... mailing_list.member_roster_visibility = "moderators" ... mailing_list.send_goodbye_message = true ... mailing_list.send_welcome_message = true ... mailing_list.subscription_policy = "moderate" ... mailing_list.unsubscription_policy = "moderate" ... manager.register(TestStyle())
commit()
for style in manager.styles: ... print(style.name) ... AB-Announce-Style legacy-announce legacy-default private-default
So at this point the style has been registered, however it doesn't look to save this permanently.
When I quit the shell and log back in, it only shows the original 3 styles. Nor can I see the style from the web interface.
Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
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
Is there a way to save this style permanently ?
Thank you for any assistance you can provide.
Regards, PerryK