[Mailman-Users] Cannot use mailman moderation over HTTPS, fix_url ineffective, mm_cfg.py does not apply

Mark Sapiro mark at msapiro.net
Tue Dec 4 09:58:47 EST 2018


On 12/4/18 4:35 AM, Nikolaos Andriopoulos wrote:
> 
> Things checked:
> - The web server configuration seems OK, and properly redirects to HTTPS.


Redirects of POST lose the POST data.


> - The current mm_cfg.py ( with comments omitted ) is the following:
> 
>     from Defaults import *
>     import pwd, grp
> 
>     MAILMAN_UID = pwd.getpwnam('mailman')[2]
>     MAILMAN_GID = grp.getgrnam('mailman')[2]
> 
>     from socket import *
>     try:
>       fqdn = getfqdn()
>     except:
>       fqdn = 'mm_cfg_has_unknown_host_domains'
> 
>     DEFAULT_URL_HOST   = fqdn
>     DEFAULT_URL_PATTERN = 'http*s*://%s/mailman/'


This is correct, but the preceding stuff seems to be from some
downstream package which may explain why DEFAULT_URL_PATTERN is
apparently not effective.


>     DEFAULT_EMAIL_HOST = fqdn
> 
>     add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
> 
> - For old lists, using
>     ./withlist -l -r fix_url mylistname -u lists.mydomain.com
>   does NOT change to form action to HTTPS, and new lists still have HTTP as
> an action.


which indicates that your mm_cfg.py setting for DEFAULT_URL_PATTERN is
not effective, possibly because the file you are editing is not the one
Mailman is using.


> I have copied over fix_url.py to fix_url2.py which hardcodes
>    web_page_url =  'https://lists.mydomain.com/mailman/'
> 
> And apply it to all lists of each domain after creation to fix this, but it
> really seems that it should not be this way. Is there something I am
> missing as far as MailMan is concerned?


Mailman is spelled Mailman.

fix_url creates web_page_url from DEFAULT_URL_PATTERN. If the created
web_page_url is not https, either the mm_cfg it imports is not the one
you edited or the setting you edit is being overridden somehow.

There should be a Mailman/ directory containing Defaults.py, mm_cfg.py
and many other Mailman modules. Is this mm_cfg.py a file or a symlink?
If it is a file, is it the one you are editing? If it is a symlink, is
its target the file that you are editing.

Also, as far as new lists are concerned, you need to restart Mailman
after editing mm_cfg.py, but this shouldn't affect fix_url.

You could try running './withlist -i' and in the interactive session


>>> from Mailman import mm_cfg
>>> mm_cfg.DEFAULT_URL_PATTERN

This should print

'https://%s/mailman/'

If it doesn't, you need to figure out why it isn't importing from the
mm_cfg.py that you edited.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the Mailman-Users mailing list