On Mon, Nov 20, 2023 at 8:53 PM Mark Sapiro <mark@msapiro.net> wrote:
On 11/20/23 00:58, Odhiambo Washington wrote:
What is the command to export the archive as a mbox from the DB? I can't figure out which option it is by looking at 'mailman-web -h'.
Normally you do this on the old server via the HyperKitty web UI which has download buttons which do things like
https://example.com/archives/list/list@example.com/export/list@example.com.m...
or for a partial archive
However, in your case I don't think you have the old installation working any more so the above won't help.
I had a dump of the old installation actually - both databases. The above has actually helped and I obtained the archive.
BTW, how will ' mailman addmembers' treat a file containing:
Firstname Lastname <email@address> Onlyname <email2@address>
Correctly. It will import email@address with display name = 'Firstname Lastname' and email2@address with display name = 'Onlyname'.
Super!
I have opted for the simple way to do this:
- Create the site in Django Admin and create/configure the list in Postorius
- Add the members from the file dump, with delivery set to regular.
- Send the members an email informing them that they need to set their delivery preferences.
I am stuck on the issue of exporting the archives to mbox file as already stated above.
Perhaps you can export the mbox via the web UI on the old server or maybe temporarily create a second mailman-web on your server with the old mailman-web database and use that web UI.
That's exactly how I did it and got the archives.
Otherwise, if you have a working mailman-web that can access this database, you could try something like
$ mailman-web shell >>> from hyperkitty.lib.compat import get_list_by_name >>> mlist = get_list_by_name('list_name_only', 'list_domain') >>> with open('output.mbox', 'wb') as fp: ... for email in mlist.emails.order_by("archived_date").all(): ... fp.write(email.as_bytes() + b'\n') ... >>>
I tested the above out of curiosity. It failed. There are 9 lists in the setup, but I am only interested in 1.
(venv) mailman@debian12:~$ mailman-web shell
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.17.2 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from hyperkitty.lib.compat import get_list_by_name
In [2]: mlist = get_list_by_name('list_name_only', 'list_domain')
---------------------------------------------------------------------------
Http404 Traceback (most recent call last)
Cell In[2], line 1
----> 1 mlist = get_list_by_name('list_name_only', 'list_domain')
File ~/venv/lib/python3.11/site-packages/hyperkitty/lib/compat.py:37, in
get_list_by_name(list_name, domain)
35 matching =
list(MailingList.objects.filter(name__startswith=list_name+"@"))
36 if len(matching) == 0: # no candidate found
---> 37 raise Http404("No archived mailinglist by that name")
38 if len(matching) == 1: # only one candidate
39 return matching[0]
Http404: No archived mailinglist by that name
Was I supposed to substitute something for the real listname of the list I wanted?
Another thing - totally unrelated - that surprised me: While using the commented-out block below, I could not click and get anything beyond http://http://list.name/mailman3 as anything to do with /postorius/xxxxx gave "Page not found" error. However, with the second config block that uses the UNIX socket, I am able to access everything
#<IfModule mod_proxy.c>
# ProxyPreserveHost On
# ProxyPass "/mailman3" "http://127.0.0.1:8010/mailman3"
# ProxyPass "/archives" "http://127.0.0.1:8010/archives"
# ProxyPass "/accounts" "http://127.0.0.1:8010/accounts"
# ProxyPass "/admin" "http://127.0.0.1:8010/admin"
# ProxyPass "/user-profile" "http://127.0.0.1:8010/user-profile"
# </IfModule>
ProxyPassMatch ^/static/ !
ProxyPassMatch ^/favicon.ico !
ProxyPass / unix:/opt/mailman/mm/var/uwsgi.sock|uwsgi://localhost/
ProxyPassReverse / unix:/opt/mailman/mm/var/uwsgi.sock|uwsgi://localhost/
Why is it that the UNIX socket option worked flawlessly while the other option failed???
-- 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]