Change config to create a new list with all archives off
Can archiving be changed anywhere in mailman3 configs, so then all new lists created do not archive by default?
On Mon, May 29, 2023 at 2:36 PM Tibor Molnar < tibor.molnar@waltoninstitute.ie> wrote:
Can archiving be changed anywhere in mailman3 configs, so then all new lists created do not archive by default?
Off the top of my head, I think the following can do it:
[archiver.hyperkitty] enable: no
[archiver.prototype] enable: no
I believe the 'enable: no' is the default. Without enabling any of the possible archivers, I believe there will be no archiving, but I could be wrong.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Hi Odhiambo,
I have tried that but the Archive policy stays public archives by default on freshly created lists still.
On Mon, May 29, 2023 at 4:21 PM Tibor Molnar < tibor.molnar@waltoninstitute.ie> wrote:
Hi Odhiambo,
I have tried that but the Archive policy stays public archives by default on freshly created lists still.
Are there any archives created at all? Are they accessible?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Well, there are no archives created after I change them settings but it is not what I'm looking for. If I do this all the lists will stop archiving. I was hoping that there was something already implemented or there is a config that I can change that allows newly created lists to be configured not to archive messages by default, or publicly archive by default....
Tibor Molnar writes:
Can archiving be changed anywhere in mailman3 configs, so then all new lists created do not archive by default?
Unfortunately, no. Once we get last year's GSoC merged, there will be, but that's going to have to wait a few weeks as it's not really ready and I don't have time for a while.
What you can do is create a style in Python and make that the default. In $SITE_PKGS/mailman/styles/default.py, append:
-------------------------------- cut here -------------------------------- from mailman.interfaces.archiver import ArchivePolicy
@public @implementer(IStyle) class ArchivesDefaultDisabledStyle(LegacyDefaultStyle):
"""The legacy default style with archiving disabled."""
name = 'archives-disabled'
description = _('Ordinary discussion mailing list style,'
' with archiving disabled')
def apply(self, mailing_list):
super().apply(self, mailing_list)
mlist.archive_policy = ArchivePolicy.never
-------------------------------- cut here --------------------------------
In mailman.cfg find and modify or create:
-------------------------------- cut here -------------------------------- [styles] default: archives-disabled -------------------------------- cut here --------------------------------
Untested, feel free to ask if it doesn't seem to work.
This really should be implemented as a plug-in so default.py being overwritten in an upgrade won't be a problem, but the plug-in API is annoyingly complicated and the example plug-in over-engineered, and I couldn't get it to work (and in the project where I learned to do this I am not being paid enough to care ;-). The approach above was straightforward.
Eventually I'll get around to doing the plug-in approach, and maybe in the meantime Mark or Abhilash will speak up. If Those Who Know don't show up soon, ask again in the medium term (but before you update Mailman and it gets overwritten :-).
Steve
Hi Steve,
I tried to use your approach today:
On Fri, Jun 2, 2023 at 8:30 AM Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
...
What you can do is create a style in Python and make that the
default. In $SITE_PKGS/mailman/styles/default.py, append:
-------------------------------- cut here -------------------------------- from mailman.interfaces.archiver import ArchivePolicy
@public @implementer(IStyle) class ArchivesDefaultDisabledStyle(LegacyDefaultStyle):
"""The legacy default style with archiving disabled.""" name = 'archives-disabled' description = _('Ordinary discussion mailing list style,' ' with archiving disabled') def apply(self, mailing_list): super().apply(self, mailing_list) mlist.archive_policy = ArchivePolicy.never
-------------------------------- cut here --------------------------------
In mailman.cfg find and modify or create:
-------------------------------- cut here -------------------------------- [styles] default: archives-disabled -------------------------------- cut here --------------------------------
I used it with a different source list - it's PrivateDefaultStyle.
When I try to create a new list using the new custom style I get an error:
2024-04-21 12:16:08 [FALCON] [ERROR] POST /3.1/lists => Traceback (most recent call last): File "falcon/app.py", line 365, in falcon.app.App.__call__ File "/usr/lib/python3.11/site-packages/mailman/rest/lists.py", line 321, in on_post mlist = create_list(**validator(request)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/mailman/app/lifecycle.py", line 100, in create_list style.apply(mlist) File "/usr/lib/python3.11/site-packages/mailman/styles/default.py", line 107, in apply super().apply(self, mailing_list) TypeError: PrivateDefaultStyle.apply() takes 2 positional arguments but 3 were given
Untested, feel free to ask if it doesn't seem to work.
Could you check what's the issue, please?
Danil Smirnov
This really should be implemented as a plug-in so default.py being
overwritten in an upgrade won't be a problem, but the plug-in API is annoyingly complicated and the example plug-in over-engineered, and I couldn't get it to work (and in the project where I learned to do this I am not being paid enough to care ;-). The approach above was straightforward.
Eventually I'll get around to doing the plug-in approach, and maybe in the meantime Mark or Abhilash will speak up. If Those Who Know don't show up soon, ask again in the medium term (but before you update Mailman and it gets overwritten :-).
Steve
Sincerely, Danil Smirnov
On 4/21/24 05:39, Danil Smirnov wrote:
What you can do is create a style in Python and make that the
default. In $SITE_PKGS/mailman/styles/default.py, append:
-------------------------------- cut here -------------------------------- from mailman.interfaces.archiver import ArchivePolicy
@public @implementer(IStyle) class ArchivesDefaultDisabledStyle(LegacyDefaultStyle):
"""The legacy default style with archiving disabled.""" name = 'archives-disabled' description = _('Ordinary discussion mailing list style,' ' with archiving disabled') def apply(self, mailing_list): super().apply(self, mailing_list)
The above line should be super().apply(mailing_list)
mlist.archive_policy = ArchivePolicy.never
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (5)
-
Danil Smirnov
-
Mark Sapiro
-
Odhiambo Washington
-
Stephen J. Turnbull
-
Tibor Molnar