After mailman was running so well I was wondering if I really need the restart option in the service configuration. When I commented it out, I got this error a few weeks later:
# systemctl status mailman3 × mailman3.service - GNU Mailing List Manager Loaded: loaded (/etc/systemd/system/mailman3.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2024-05-14 00:34:37 CEST; 1 week 6 days ago Process: 1159 ExecStart=/opt/mailman/venv/bin/mailman start (code=exited, status=1/FAILURE) CPU: 6.933s
May 14 00:34:36 SERVER.TLD mailman[1159]: return f(get_current_context(), *args, **kwargs) May 14 00:34:36 SERVER.TLD mailman[1159]: File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/commands/cli_control.py", line 109, in start May 14 00:34:36 SERVER.TLD mailman[1159]: call_name(config.mta.incoming).regenerate() May 14 00:34:36 SERVER.TLD mailman[1159]: File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/mta/postfix.py", line 136, in regenerate May 14 00:34:36 SERVER.TLD mailman[1159]: raise RuntimeError(NL.join(errors)) May 14 00:34:36 SERVER.TLD mailman[1159]: RuntimeError: command failure: /usr/sbin/postmap /opt/mailman/mm/var/data/postfix_lmtp, 1, Operation not permitted May 14 00:34:36 SERVER.TLD systemd[1]: mailman3.service: Control process exited, code=exited, status=1/FAILURE May 14 00:34:37 SERVER.TLD systemd[1]: mailman3.service: Failed with result 'exit-code'. May 14 00:34:37 SERVER.TLD systemd[1]: Failed to start GNU Mailing List Manager. May 14 00:34:37 SERVER.TLD systemd[1]: mailman3.service: Consumed 6.933s CPU time.
I can only guess that the error might be some case of very bad timing, because there shouldn't be any problem with the mentioned call.
# su mailman (venv) mailman@SERVER:/$ /usr/sbin/postmap /opt/mailman/mm/var/data/postfix_lmtp Usually works fine.
I re-enabled the lines in the server configuration:
Restart=on-failure RestartSec=15