No module named postfix mta_sts_resolver

I’ve been having a rough time since upgrading to v.50 when it first came out. Things have been working but the status updates have all had the code below in it. Today things came to head when the certs didn’t renew. I’ve gotten to a point where the users can access their webmail again but the admin page still isn’t working.

  File "./status_checks.py", line 14, in <module>
    import postfix_mta_sts_resolver.resolver
ModuleNotFoundError: No module named 'postfix_mta_sts_resolver'

I’ve added the suggested dns entries for mta_sts and I’ve been getting the above messages over and over in my status checks.

Other steps I have taken was to reinstall several times. Each time I do that I still have to go back in and comment out the TLS line in nginx.conf. I also tried renewing the certs but that didn’t help. Later on is when i added the mta dns entries and requested a cert for mta. At that point then I was able to use certbot to get my main domain back up with SSL.

I don’t think I have a lot to go on here and am wondering if I should just rebuild the server and restore a backup?

I had the same problem and managed to solve it by manually installing the postfix-mta-resolver. The install was a bit tricky, because no matter how I installed the mta-sts-resolver, MiaB would not see it.
Until I finally found the “special cases of deployment” section on the PyPi project page: https://pypi.org/project/postfix-mta-sts-resolver

Even though Mailinabox uses Python 3.6 the section about “Systems without Python 3.5+” is still useful, because it tells us how to install the package using MiaB’s own python binary, bypassing the system binary. And that means we end up with a working/correctly linked postix-mta-resolver where MiaB expects it.

On my system the magic line was “/usr/local/lib/mailinabox/env/bin/pip3 install postfix-mta-sts-resolver[sqlite,redis]” (I wasn’t sure if we really need sqlite and redis support, so I kept them to be safe).

The downside of this method is you now have a “hacked/botched/butchered” version of MiaB. Which might (or might not) break on the next update.
The upside is that everything seems to work, and you don’t have to reinstall and recover from a backup (though you should still have a working backup before you try this method).

Thanks for the suggestion. I had the same problem! I couldn’t get MiaB to see the mta resolver file after I installed it.

I am definitely going to give this a try.

Update - That got the admin to work but the certificate provisioning fails. If I re-provision the cert from terminal I can get back into admin then but it still always shows the certificate status as wxpired. When it fails it breaks everything again. I re-ran the .v50 update and that didn’t help.

I’m going to see what happens tomorrow. Maybe the certs will correct themselves. I only have 2 people using it through thunderbird so I switched them to use Amazon SES for their SMTP. It works when everything is just in roundcube.

Overnight it must have tried to renew the certs. It failed again because I was right back to nothing working. I had to manually reinstall the LE cert.