On 12/28/21 11:56 AM, William Oliver wrote:
- I got the error
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'hyperkitty.templatetags.decorate': cannot import name 'escape_html' from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site- packages/mistune/scanner.py)
when I ran 'mailman-web migrate'
The fix was trivial: I just added the lines:
from mistune.util import escape_html from mistune.util import escape_url to /opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py
This is fixed at https://gitlab.com/mailman/hyperkitty/-/merge_requests/379. Unfortunately, that fix is not in the latest release version. We will need to address that as mistune 2.0.0 moved those functions from their prior location in mistune 2.0.0rc1
- Similarly, migrate (using postgres) also gave the error:
File "/opt/mailman/venv/lib/python3.9/site- packages/django/db/backends/postgresql/utils.py", line 6, in utc_tzinfo_factory raise AssertionError("database connection isn't set to UTC")
I was able to find a discusson of this one at
https://stackoverflow.com/questions/68024060/assertionerror-database-connect...
which had me downgrade to an older version of psycopg2-binary:
pip install psycopg2-binary==2.8.6
There might be a different fix, but this worked.
This should be fixed in psycopg2-binary, but it isn't. The work around is what you did and I'll update the doc.
- When I ran the test "uwsgi --ini /etc/mailman3/uwsgi.ini" I got the error:
ModuleNotFoundError: No module named 'settings'
This was also trivially fixed by adding the path:
export PYTHONPATH=$PYTHONPATH:/etc/mailman3
in /opt/mailman/.bashrc
The recommended uwsgi.ini includes
pythonpath = /etc/mailman3/
according to https://uwsgi-docs.readthedocs.io/en/latest/Options.html?highlight=pythonpat... this should work. Did you have that? If you did and it doesn't work, perhaps adding
env = PYTHONPATH=/etc/mailman3
would work.
- Sometimes when I rebooted the machine, when I ran 'systemctl start mailman3' I'd get the error that mailman wouldn't start because the lock was stll there. I never could figure out where the lock was, so I worked around it by replacing
ExecStart=/opt/mailman/venv/bin/mailman start
with ExecStart=/opt/mailman/venv/bin/mailman start --force
in /etc/systemd/system/mailman3.service
I'm sure there's something bad about doing that, but it works for me, so far.
The lock is /opt/mailman/mm/var/locks/master.lck*
The problem with using --force unconditionally is you can start a second instance when mailman core is already running and that causes other issues.
- I had a problem with mail to outside people not being delivered while mail to the local host was delivered. It turned out that this was because in my mailman.cfg I had "smtp_host:my.listserver.tld when it should have been localhost. The error was "relay access denied." To fix this, I had to add my.listserver.tld to "mynetworks" in /etc/postfix/main.cf, ie change:
mynetworks = 127.0.0.0/8 10.0.0.0/24
to
mynetworks = 127.0.0.0/8 10.0.0.0/24 111.222.333.444 <--- my ip address
However, Mark Sapiro (a God) told me this was because I had changed a line in the [mta] section of mailman.cfg. I had changed
smtp_host: localhost
to
smtp_host: mydomain.tld
Here's the thing. The reason I did this was because the instructions at https://docs.mailman3.org/en/latest/config-core.html
give this as their model:
[mta] incoming: mailman.mta.postfix.LMTP outgoing: mailman.mta.deliver.deliver lmtp_host: mail.example.com lmtp_port: 8024 smtp_host: mail.example.com <---- not localhost smtp_port: 25
I'll add some clarification to the doc.
The instructions are good, but there are a few places where one size does not fit all, I guess.
- A second error in delivery to outside addresses resulted in an "Access denied" error. A search on the internet revealed that this had to do with (for me) smtpd_recipient_restrictions in postfix. See, for instance: https://know.mailsbestfriend.com/postfix_error_relay_access_denied_noqueue_r...
Changing this fixed things.
I'm not sure, but I think this shows up mostly with installations that include dovecot.
This is a Postfix configuration issue.
<big snip>
Thanks for your feedback.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan