Created attachment 190704 [details]
Config file, with hostname changed to example.com
I updated one of my systems to r361539 and a check added in r461277 appears to be checking for "localhost" in mm_cfg.py and finding it, despite it not being defined. This leads to a very ambiguous error message, "Start of mailman refused due to insufficient configuration."
My mm_cfg.py is attached, in sanitized form.
Sorry, this is a side-effect of a cleanup that prevents checksum mismatches on the Defaults.py file, and the solution is documented in UPDATING 20180208.
To fill in a bit of detail, there have been three phases of Mailman behaviour:
- older versions filled in the BUILD host name, causing very strange mail bounce behaviour in your configuration
- not so old versions before the 2.1.26 update would write the installation host's name into Defaults.py from post-install, breaking the pkg checksum on every installation.
- recent mailman versions just hardwire localhost, which is what two Linux distributions are doing (Fedora and Arch Linux), and since that is even more confusing, the rcfile catches this.
AFFECTS: users of mail/mailman*
In order to overcome complaints about mismatched checksums in
Mailman/Default.py, mailman now configures the DEFAULT_EMAIL_HOST
and DEFAULT_URL_HOST to "localhost" statically, and the rc script
will check this and refuse to start on next boot.
Users must configure DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST in
A short example has been added to:
where the latter contains:
In most cases, you will want to override the host name settings (which
default to 'localhost') by adding these lines to Mailman/mm_cfg.py:
(the documentation is in Mailman/Defaults.py, but you need to override
the defaults in mm_cfg.py instead, changes to Defaults.py are lost on
# adjust and add this to Mailman/mm_cfg.py:
DEFAULT_URL_HOST = 'CHANGE_ME.example.org'
DEFAULT_EMAIL_HOST = 'CHANGE_ME.example.org'
If you have a good proposal that works for source/ports installation as well as binary package installation, that avoids the checksum failures that arose from tampering with Defaults.py/.pyc from the post-install script, and that is robust without tampering with user configurations, I shall be very happy to hear about that, in that case, please reopen this report with a solution or best a tested patch.
[Revised due to your intervening reply.]
There is a very subtle interaction going on. Defaults.py already contains:
Therefore, I did not change it in mm_cfg.py. However, that is apparently evaluated before the definitions of DEFAULT_URL_HOST and DEFAULT_EMAIL_HOST in mm_cfg.py.
Setting DEFAULT_URL_HOST and DEFAULT_EMAIL_HOST in mm_cfg.py is not sufficient - add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) is also needed.
I suggest 2 changes:
1) Revise UPDATING to inclue add_virtualhost to the required contents of mm_cfg.py.
2) Revise the wording of the error "Start of mailman refused due to insufficient configuration." with something like "DEFAULT_EMAIL_HOST, DEFAULT_URL_HOST and add_virtualhost must be set in Mailman/mm_cfg.py"?
Per my previous reply, re-opening.
Indeed, and I have had other ideas how to solve this for the common cases.
A commit references this bug:
Date: Sat Feb 17 12:45:19 UTC 2018
New revision: 462151
Overhaul default hosts configuration.
- When no virtualhosts are defined, and the default localhost/localhost is
effective, the post-install script now adds DEFAULT_EMAIL_HOST,
DEFAULT_URL_HOST, and add_virtualhost() lines to mm_cfg.py.
Add corresponding support to remove unchanged configurations to the
- While here, overhaul crontab configuration to only request a merge if the
crontab had been modified, and unify progress reports.
- Merge pkg-deinstall into pkg-install, to avoid duplication of code
that might be missed in later maintenance.
Reported by: Terry Kennedy