Repository: Mailu/Mailu

Issue:
DEFER_ON_TLS_ERROR in mailu.env doesn't appear to be applied.
Thank you for opening an issue with Mailu. Please understand that issues are meant for bugs and enhancement-requests.
For **user-support questions**, reach out to us  on [matrix](https://matrix.to/#/#mailu:tedomum.net).

To be able to help you best, we need some more information.

## Before you open your issue
- [X] Check if no issue or pull-request for this already exists.
- [X] Check [documentation](https://mailu.io/master/) and [FAQ](https://mailu.io/master/faq.html). (Tip, use the search function on the documentation page)
- [X] You understand `Mailu` is made by volunteers in their **free time** — be conscise, civil and accept that delays can occur.
- [X] The title of the issue should be short and simple. It should contain specific terms related to the actual issue. Be specific while writing the title.

## Environment & Versions
### Environment
 - [X] docker-compose
 - [ ] kubernetes
 - [ ] docker swarm

### Versions
master (d464187)

## Description
DEFER_ON_TLS_ERROR in mailu.env doesn't appear to be applied. I've set this environment variable to "false" and my emails still appear to be deferred according to the SMTP container. 
`(status=deferred (client TLS configuration problem))`

I've set this to "false" because MTA-STS isn't as widely deployed as one would hope, and I don't want my emails blackholed and deferred until my destination's policy is published (which may be never)... 

## Replication Steps
In mailu.env - set `DEFER_ON_TLS_ERROR=false`, reload containers, then try sending an email to a domain without an MTA-STS policy...

Then output logs for the SMTP container and note the message deferral.

## Expected behaviour
I expect the email to continue being sent despite the MTA-STS error.

## Logs
```
smtp_1       | Sep 09 13:42:08 mail postfix/cleanup[416]: 85B6147DDA: message-id=<074C120E-8E94-4753-8F7D-ECE60F3AEDB4@jcaicedo.com>
smtp_1       | Sep 09 13:42:09 mail postfix/qmgr[391]: 85B6147DDA: from=<jonathan@jcaicedo.com>, size=6074, nrcpt=1 (queue active)
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: connect to /tmp/mta-sts.socket: No such file or directory
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: table socketmap:unix:/tmp/mta-sts.socket:postfix lookup error: No such file or directory
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: socketmap:unix:/tmp/mta-sts.socket:postfix lookup error for "ssl-tools.net"
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: smtp_tls_policy_maps, next-hop destination "ssl-tools.net": policy table lookup error
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: TLS policy lookup for ssl-tools.net/ssl-tools.net: client TLS configuration problem
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: warning: TLS policy lookup for ssl-tools.net/ssl-tools.net: client TLS configuration problem
smtp_1       | Sep 09 13:42:09 mail postfix/smtp[417]: 85B6147DDA: to=<check@ssl-tools.net>, relay=none, delay=1.1, delays=1/0.03/0.01/0, dsn=4.7.5, status=deferred (client TLS configuration problem)
```



Discussion:

Resolving patch:
diff --git a/core/postfix/start.py b/core/postfix/start.py
--- a/core/postfix/start.py
+++ b/core/postfix/start.py
@@ -77,7 +77,8 @@ def is_valid_postconf_line(line):
 
 if os.path.exists("/overrides/mta-sts-daemon.yml"):
     shutil.copyfile("/overrides/mta-sts-daemon.yml", "/etc/mta-sts-daemon.yml")
-conf.jinja("/etc/mta-sts-daemon.yml", os.environ, "/etc/mta-sts-daemon.yml")
+else:
+    conf.jinja("/conf/mta-sts-daemon.yml", os.environ, "/etc/mta-sts-daemon.yml")
 
 if not os.path.exists("/etc/postfix/tls_policy.map.lmdb"):
     open("/etc/postfix/tls_policy.map", "a").close()


Test patch: