Can we disable archiving by default

Hi Team
I want to disable some mailing lists archives by default and want to enable after a period of time. I don't want any archives to enabled from day-1 to a list but may be later.
I tried many options but I am not able to do so.
Please help with any solution
-- Regards Sandeep Kumar +91-9642669192

sandeep kumar writes:
I tried many options but I am not able to do so.
It helps if you tell us what you tried and didn't work.
As far as timing goes, cron is your friend. It should be possible to curl or the mailman command interface to access the REST interface to enable and disable archives.
Steve

Hi
I mean while creating a new list I can see three options like announce this list, private archives, public archives, all these options do is making archives public and private. But what I required is making this list as "Do not archive this list" by default for every list while creating the list.
Is there any option to do this...??
Regards Sandeep
Sent from my iPhone

On Thu, Sep 19, 2019, at 7:27 PM, sandeep kumar wrote:
Not yet, these options are called "Styles" in Mailman terminology, and there aren't any styles that have archiving disabled by default.
I don't mind adding one though, can you open an issue on Gitlab?
https://gitlab.com/mailman/mailman/issues
-- thanks, Abhilash Raj (maxking)

Hi Team
I think I have resolved the issue. I have enabled the disabling the archive by default.
Made below changes under the /mailman/src/mailman/styles/base.py
208 @public 209 class Noarchive: 210 """Settings for noarchive mailing lists.""" 211 212 def apply(self, mailing_list): 213 mlist = mailing_list 214 mlist.advertised = False 215 mlist.archive_policy = ArchivePolicy.never
and also made below changes in the /mailman/src/mailman/styles/default.py
90 @public
91 @implementer(IStyle)
92 class NoarchiveDefaultStyle(
93 Identity, BasicOperation, Bounces, Noarchive, Discussion,
Moderation):
94
95 """Style for mailing-lists with private archives."""
96
97 name = 'Noarchive-default'
98 description = _('Do not archive the list.')
99
100 def apply(self, mailing_list):
101 """See IStyle
."""
102 Identity.apply(self, mailing_list)
103 BasicOperation.apply(self, mailing_list)
104 Bounces.apply(self, mailing_list)
105 Noarchive.apply(self, mailing_list)
106 Discussion.apply(self, mailing_list)
107 Moderation.apply(self, mailing_list)
Can you please check if the code is fine. I have also checked by creating a new list and checked the database entries in the table for "0" value (NO Archives)
Regards Sandeep
On Fri, Sep 20, 2019 at 9:20 AM sandeep kumar <sandeep7790@gmail.com> wrote:
-- Regards Sandeep Kumar +91-9642669192

On 9/22/19 9:47 PM, sandeep kumar wrote:
You may have done this, but you also need to change lines 22-24 from
to
I would make this
description = _('Discussion mailing list style with no archives.')
Comments inline above. Also, you must have added the import of NoArchive somewhere in styles/default.py, or it couldn't have worked.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

sandeep kumar writes:
I tried many options but I am not able to do so.
It helps if you tell us what you tried and didn't work.
As far as timing goes, cron is your friend. It should be possible to curl or the mailman command interface to access the REST interface to enable and disable archives.
Steve

Hi
I mean while creating a new list I can see three options like announce this list, private archives, public archives, all these options do is making archives public and private. But what I required is making this list as "Do not archive this list" by default for every list while creating the list.
Is there any option to do this...??
Regards Sandeep
Sent from my iPhone

On Thu, Sep 19, 2019, at 7:27 PM, sandeep kumar wrote:
Not yet, these options are called "Styles" in Mailman terminology, and there aren't any styles that have archiving disabled by default.
I don't mind adding one though, can you open an issue on Gitlab?
https://gitlab.com/mailman/mailman/issues
-- thanks, Abhilash Raj (maxking)

Hi Team
I think I have resolved the issue. I have enabled the disabling the archive by default.
Made below changes under the /mailman/src/mailman/styles/base.py
208 @public 209 class Noarchive: 210 """Settings for noarchive mailing lists.""" 211 212 def apply(self, mailing_list): 213 mlist = mailing_list 214 mlist.advertised = False 215 mlist.archive_policy = ArchivePolicy.never
and also made below changes in the /mailman/src/mailman/styles/default.py
90 @public
91 @implementer(IStyle)
92 class NoarchiveDefaultStyle(
93 Identity, BasicOperation, Bounces, Noarchive, Discussion,
Moderation):
94
95 """Style for mailing-lists with private archives."""
96
97 name = 'Noarchive-default'
98 description = _('Do not archive the list.')
99
100 def apply(self, mailing_list):
101 """See IStyle
."""
102 Identity.apply(self, mailing_list)
103 BasicOperation.apply(self, mailing_list)
104 Bounces.apply(self, mailing_list)
105 Noarchive.apply(self, mailing_list)
106 Discussion.apply(self, mailing_list)
107 Moderation.apply(self, mailing_list)
Can you please check if the code is fine. I have also checked by creating a new list and checked the database entries in the table for "0" value (NO Archives)
Regards Sandeep
On Fri, Sep 20, 2019 at 9:20 AM sandeep kumar <sandeep7790@gmail.com> wrote:
-- Regards Sandeep Kumar +91-9642669192

On 9/22/19 9:47 PM, sandeep kumar wrote:
You may have done this, but you also need to change lines 22-24 from
to
I would make this
description = _('Discussion mailing list style with no archives.')
Comments inline above. Also, you must have added the import of NoArchive somewhere in styles/default.py, or it couldn't have worked.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Abhilash Raj
-
Mark Sapiro
-
sandeep kumar
-
Stephen J. Turnbull