On 11/25/21 1:16 PM, Mark Sapiro wrote:
On 11/25/21 10:56 AM, David Newman wrote:
Thanks for this. After setting these variables and restarting mailman3 and mailmanweb, the mailman user still cannot find a hyperkitty_import command (neither can root, btw). Again, I installed MM3 and Django/Postorius/Hyperkitty using the venv and web docs previously referenced.
Don't run mailman or django admin commands as root. This causes issues when files are created by root and can't be read by mailman.
Understood, thanks. I'd only tried root to determine if there was a permissions issue, where hyperkitty_import really did exist but wasn't available to the mailman user.
What django admin command are you running?
As the mailman user, with venv activated:
(venv) mailman@lists:~$ hyperkitty_import -l testlist@lists.domain.com /var/lib/mailman/archives/private/testlist.mbox/testlist.mbox
'testlist' and 'lists.domain.com' are redactions; they are correct in the given command, but the command fails because the system can't find hyperkitty_import.
(BTW
Also, because I'm looking to migrate from Mailman 2.1 installed from Debian packages, all the 2.1 stuff is owned by the 'list' user. I'd changed ownership of the above private archive to mailman:mailman for the command not to complain about permissions.
If you don't set DJANGO_SETTINGS_MODULE in the environment and you have activated your virtualenv and run
mailman-web
as the django admin command it will set /etc/mailman3/settings.py as the settings.
I'd run these two environment commands as the mailman user with virtualenv activated:
export DJANGO_SETTINGS_MODULE=settings export PYTHONPATH=/etc/mailman3/settings.py
Am I being overly literal here with 'settings' in that first command? Asking because 'mailman-web check' runs clean before running these commands and returns this error afterward:
ModuleNotFoundError: No module named 'settings'
Either way, the hyperkitty_import command still isn't found.
On the plus side, all lists now appear in the admin web page. However, lists created from the admin page do not appear in a site list page, even though all lists are in the same site/domain.
By default, only lists that you are owner, moderator or subscriber for are shown. What if you click Filter by Role and select All?
Same result. In this case, the ID of the admin and list owner are the same.
Finally, how to make these exports permanent? I did not see this covered in the migration doc above. This is on a Debian system where the mailman user's shell is bash. Is this simply a matter of adding environment variables in the mailman user's .bashrc file?
You can do that but as I note above, if you run
mailman-web
you shouldn't need to. You can add asource /opt/mailman/venv/bin/activate
command as mentioned at https://docs.mailman3.org/en/latest/install/virtualenv.html#activate-virtual....
Yes, this is what I have in mailman's .bashrc file. I'd followed that venv doc for initial installation, and it activates the virtualenv whenever launching a shell for mailman.
dn