As seen on #144 (closed), mailman3 remove removes only the ML configuration, not the archives.
A CLI subcommand under django-admin would be very practical. An UI button could ne nice too.
Would you please at least implement the CLI subcommand?
Regards.
\_o<
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Any news?
A list was added before migration and it was decided that it was not the proper course of action. We do not want people to be confused and would like all references removed. I also still have a test list which was only partially removed.
An easy way would be to remove the MailingList model from the database, this is some rough code that should work, if we put it in a django-admin command:
iflen(sys.args)<3:print('usage: python manage.py remove_list list@example.com')exit(1)mlist=sys.args[2]try:ml=MailingList.objects.get(name=mlist)ml.delete()print('The mailing list {} was deleted from database'.format(mlist))exceptDoesNotExist:print('The mailing list {} does not exist'.format(mlist))
Is anyone working on this issue? Frankly, I found the inability to remove an archive terribly crippling. In Mailman 2 it was as simple as doing "rm -rf archives/listname"…
Yes. @maxking is working on it. The difficulty is just deleting the HyperKitty mail list object doesn't work if the database is MySQL because of foreign key constraints. With a MySQL backend, you have to go through the list and delete threads one at a time. We're trying to find a better way.
With PostgreSQL and SQLite, you can run manage.py shell or however you spell that and do
from hyperkitty.models import MailingListml = MailingList.objects.get(name="yourlist@example.com")ml.delete()
FWIW, I had a corrupt import21 (I had not appreciated that I had to run cleanarch on a list before running an import, so messages with unescaped From some text here were truncated i.e. >From some text here) and decided it quicker to delete the whole archive for that listand re-import. As suggested above, its a little messy, and I did it step by step to remove the dependencies. From within mysql client and after selecting the mailman3web database, I determined the mailinglist_id (e.g. 34) are ran:
set @mlid=34;create temporary table tid as (select thread_id from hyperkitty_thread where mailinglist_id=@mlid);create temporary table eid as (select id from hyperkitty_email where mailinglist_id=@mlid);delete from hyperkitty_lastview where thread_id in (select * from tid);delete from hyperkitty_favorite where thread_id in (select * from tid);delete from hyperkitty_tagging where thread_id in (select * from tid);delete from hyperkitty_vote where email_id in (select * from eid);update hyperkitty_thread set starting_email_id=null where mailinglist_id=@mlid;update hyperkitty_email set parent_id=null where mailinglist_id=@mlid;delete from hyperkitty_attachment where email_id in (select * from eid);delete from hyperkitty_email where mailinglist_id=@mlid;delete from hyperkitty_thread where mailinglist_id=@mlid;delete from hyperkitty_mailinglist where id=@mlid;drop table tid;drop table eid;
Since HyperKitty 1.3.1 , a site admin has a delete button on the list's archive overview page. I'm closing this. If this is a request for a list owner to have this capability, please reopen.
Well, yeah, but that button deletes the whole mailinglist, not just the archives. Just learned that the hard way :)
Is there a way to only delete the archives, after e.g. having archiving disabled for a particular list?
It doesn't in my case. I just deleted the archive via the Delete Archive button for a test list in my development install, and the archive is gone and the list remains.
I wonder if @mirkovogt means that it deletes the MailingList object in Hyperkitty, which is true. It doesn't delete it in Core though, which is the Source of Truth in this case.
It is possible to re-create the MailingList in Hyperkitty. IIRC, if it isn't deleted in Core, the next cronjob sync should re-create the list in Hyperkitty or when the next email in that list is archived.
I've run into a problem with corrupt archives, where going to the overview page generates a server error with no options to delete. I had to use the above shell commands to get rid of it, and start over. I'm on 1.3.2.
@mirkovogt I think part of the confusion is when you get the confirmation page for deleting the archive, it has the large heading Delete Mailing List followed by list@example.com will be deleted along with all the threads and messages. Do you want to continue?
I propose to clarify this with the heading Delete Mailing List From HyperKitty and text list@example.com will be deleted from HyperKitty along with all the threads and messages. It will not be deleted from Mailman Core. Do you want to continue? which is what it really means.