Can we disable archiving by default
![](https://secure.gravatar.com/avatar/d7871b0f74d4c76f031c2cf21718fbbd.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/e2371bef92eb40cd7c586e9f2cc75cd8.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/d7871b0f74d4c76f031c2cf21718fbbd.jpg?s=120&d=mm&r=g)
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 19-Sep-2019, at 10:05 PM, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
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
![](https://secure.gravatar.com/avatar/8c8c6e35ec7ca5c708a6049152b2bedd.jpg?s=120&d=mm&r=g)
On Thu, Sep 19, 2019, at 7:27 PM, sandeep kumar wrote:
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.
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
Is there any option to do this...??
Regards Sandeep
Sent from my iPhone
On 19-Sep-2019, at 10:05 PM, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
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
-- thanks, Abhilash Raj (maxking)
![](https://secure.gravatar.com/avatar/d7871b0f74d4c76f031c2cf21718fbbd.jpg?s=120&d=mm&r=g)
Thanks Abhilash
Sure I will raise issue
Regards Sandeep
Sent from my iPhone
On 20-Sep-2019, at 8:20 AM, Abhilash Raj <maxking@asynchronous.in> wrote:
On Thu, Sep 19, 2019, at 7:27 PM, sandeep kumar wrote: 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.
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
Is there any option to do this...??
Regards Sandeep
Sent from my iPhone
On 19-Sep-2019, at 10:05 PM, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
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
-- thanks, Abhilash Raj (maxking)
![](https://secure.gravatar.com/avatar/d7871b0f74d4c76f031c2cf21718fbbd.jpg?s=120&d=mm&r=g)
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:
Thanks Abhilash
Sure I will raise issue
Regards Sandeep
Sent from my iPhone
On 20-Sep-2019, at 8:20 AM, Abhilash Raj <maxking@asynchronous.in> wrote:
On Thu, Sep 19, 2019, at 7:27 PM, sandeep kumar wrote: 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.
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
Is there any option to do this...??
Regards Sandeep
Sent from my iPhone
On 19-Sep-2019, at 10:05 PM, Stephen J. Turnbull <
turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
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
-- thanks, Abhilash Raj (maxking)
-- Regards Sandeep Kumar +91-9642669192
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 9/22/19 9:47 PM, sandeep kumar wrote:
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
You may have done this, but you also need to change lines 22-24 from
from mailman.styles.base import ( Announcement, BasicOperation, Bounces, Discussion, Identity, Moderation, Private, Public)
to
from mailman.styles.base import ( Announcement, BasicOperation, Bounces, Discussion, Identity, Moderation, NoArchive, Private, Public)
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.')
I would make this
description = _('Discussion mailing list style with no archives.')
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)
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