We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
SSL fails for all domains if a single domain fails LetsEncrypt challenge
## 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). 
- [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.
- 
## Environment & Versions
### Environment
 - [X] docker compose
 - [ ] kubernetes
 - [ ] docker swarm

### Versions
```
1.9
```

## Description
I used [mailu setup utility](https://setup.mailu.io/1.9/) to create a docker-compose.yml with multiple email domains. Turns out not all domains were already pointing to the server IP, so some challenges failed. This leads to nginx closing port 443. So even the main domain is not reachable via SSL.

After removing the non-working domains the cert is created successfully and SSL is working.

## Replication Steps
Create a new mailu setup, add multiple domains of which some are not pointing to the server.

## Expected behaviour
There should be a certificate for the domains that are reachable and nginx should make those accessible with SSL on port 443.

## Logs
```
2022-10-05T19:47:24.203180336Z   Domain: email.example.com
2022-10-05T19:47:24.203182530Z   Type:   dns
2022-10-05T19:47:24.203184754Z   Detail: no valid A records found for email.example.com; no valid AAAA records found for email.example.com
2022-10-05T19:47:24.203187149Z
2022-10-05T19:47:24.203189393Z Hint: The Certificate Authority couldn't exterally verify that the standalone plugin completed the required http-01 challenges. Ensure the plugin is configured correctly and that the changes it makes are accessible from the internet.
2022-10-05T19:47:24.203192008Z
2022-10-05T19:47:24.702017069Z 2022/10/05 21:47:24 [notice] 1#1: signal 1 (SIGHUP) received from 22, reconfiguring
2022-10-05T19:47:24.702118810Z 2022/10/05 21:47:24 [notice] 1#1: reconfiguring
2022-10-05T19:47:24.705542967Z 2022/10/05 21:47:24 [warn] 1#1: conflicting server name "" on 0.0.0.0:80, ignored
2022-10-05T19:47:24.705911789Z 2022/10/05 21:47:24 [notice] 1#1: using the "epoll" event method
2022-10-05T19:47:24.706081756Z 2022/10/05 21:47:24 [notice] 1#1: start worker processes
2022-10-05T19:47:24.706331032Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 23
2022-10-05T19:47:24.706639951Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 24
2022-10-05T19:47:24.706852248Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 25
2022-10-05T19:47:24.730032307Z Hook 'post-hook' ran with output:
2022-10-05T19:47:24.730052144Z  Missing cert or key file, disabling TLS
2022-10-05T19:47:24.730291842Z Hook 'post-hook' ran with error output:
2022-10-05T19:47:24.730302613Z  nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored
2022-10-05T19:47:24.732101009Z Some challenges have failed.
2022-10-05T19:47:24.732342892Z Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/nginx/letsencrypt.py`
Content:
```
1 #!/usr/bin/python3
2 
3 import os
4 import time
5 import subprocess
6 
7 hostnames = ','.join(set(host.strip() for host in os.environ['HOSTNAMES'].split(',')))
8 
9 command = [
10     "certbot",
11     "-n", "--agree-tos", # non-interactive
12     "-d", hostnames, "--expand", "--allow-subset-of-names",
13     "-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
14     "certonly", "--standalone",
15     "--cert-name", "mailu",
16     "--preferred-challenges", "http", "--http-01-port", "8008",
17     "--keep-until-expiring",
18     "--renew-with-new-domains",
19     "--config-dir", "/certs/letsencrypt",
20     "--post-hook", "/config.py"
21 ]
22 command2 = [
23     "certbot",
24     "-n", "--agree-tos", # non-interactive
25     "-d", hostnames, "--expand", "--allow-subset-of-names",
26     "-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
27     "certonly", "--standalone",
28     "--cert-name", "mailu-ecdsa",
29     "--preferred-challenges", "http", "--http-01-port", "8008",
30     "--keep-until-expiring",
31     "--key-type", "ecdsa",
32     "--renew-with-new-domains",
33     "--config-dir", "/certs/letsencrypt",
34     "--post-hook", "/config.py"
35 ]
36 
37 # Wait for nginx to start
38 time.sleep(5)
39 
40 # Run certbot every day
41 while True:
42     subprocess.call(command)
43     subprocess.call(command2)
44     time.sleep(86400)
45
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/core/nginx/letsencrypt.py b/core/nginx/letsencrypt.py
--- a/core/nginx/letsencrypt.py
+++ b/core/nginx/letsencrypt.py
@@ -15,6 +15,7 @@
     "--cert-name", "mailu",
     "--preferred-challenges", "http", "--http-01-port", "8008",
     "--keep-until-expiring",
+    "--allow-subset-of-names",
     "--renew-with-new-domains",
     "--config-dir", "/certs/letsencrypt",
     "--post-hook", "/config.py"
@@ -28,6 +29,7 @@
     "--cert-name", "mailu-ecdsa",
     "--preferred-challenges", "http", "--http-01-port", "8008",
     "--keep-until-expiring",
+    "--allow-subset-of-names",
     "--key-type", "ecdsa",
     "--renew-with-new-domains",
     "--config-dir", "/certs/letsencrypt",

{"golden_diff": "diff --git a/core/nginx/letsencrypt.py b/core/nginx/letsencrypt.py\n--- a/core/nginx/letsencrypt.py\n+++ b/core/nginx/letsencrypt.py\n@@ -15,6 +15,7 @@\n     \"--cert-name\", \"mailu\",\n     \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n     \"--keep-until-expiring\",\n+    \"--allow-subset-of-names\",\n     \"--renew-with-new-domains\",\n     \"--config-dir\", \"/certs/letsencrypt\",\n     \"--post-hook\", \"/config.py\"\n@@ -28,6 +29,7 @@\n     \"--cert-name\", \"mailu-ecdsa\",\n     \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n     \"--keep-until-expiring\",\n+    \"--allow-subset-of-names\",\n     \"--key-type\", \"ecdsa\",\n     \"--renew-with-new-domains\",\n     \"--config-dir\", \"/certs/letsencrypt\",\n", "issue": "SSL fails for all domains if a single domain fails LetsEncrypt challenge\n## Before you open your issue\r\n- [X] Check if no issue or pull-request for this already exists.\r\n- [X] Check [documentation](https://mailu.io/master/) and [FAQ](https://mailu.io/master/faq.html). \r\n- [X] You understand `Mailu` is made by volunteers in their **free time** \u2014 be conscise, civil and accept that delays can occur.\r\n- [X] The title of the issue should be short and simple.\r\n- \r\n## Environment & Versions\r\n### Environment\r\n - [X] docker compose\r\n - [ ] kubernetes\r\n - [ ] docker swarm\r\n\r\n### Versions\r\n```\r\n1.9\r\n```\r\n\r\n## Description\r\nI used [mailu setup utility](https://setup.mailu.io/1.9/) to create a docker-compose.yml with multiple email domains. Turns out not all domains were already pointing to the server IP, so some challenges failed. This leads to nginx closing port 443. So even the main domain is not reachable via SSL.\r\n\r\nAfter removing the non-working domains the cert is created successfully and SSL is working.\r\n\r\n## Replication Steps\r\nCreate a new mailu setup, add multiple domains of which some are not pointing to the server.\r\n\r\n## Expected behaviour\r\nThere should be a certificate for the domains that are reachable and nginx should make those accessible with SSL on port 443.\r\n\r\n## Logs\r\n```\r\n2022-10-05T19:47:24.203180336Z   Domain: email.example.com\r\n2022-10-05T19:47:24.203182530Z   Type:   dns\r\n2022-10-05T19:47:24.203184754Z   Detail: no valid A records found for email.example.com; no valid AAAA records found for email.example.com\r\n2022-10-05T19:47:24.203187149Z\r\n2022-10-05T19:47:24.203189393Z Hint: The Certificate Authority couldn't exterally verify that the standalone plugin completed the required http-01 challenges. Ensure the plugin is configured correctly and that the changes it makes are accessible from the internet.\r\n2022-10-05T19:47:24.203192008Z\r\n2022-10-05T19:47:24.702017069Z 2022/10/05 21:47:24 [notice] 1#1: signal 1 (SIGHUP) received from 22, reconfiguring\r\n2022-10-05T19:47:24.702118810Z 2022/10/05 21:47:24 [notice] 1#1: reconfiguring\r\n2022-10-05T19:47:24.705542967Z 2022/10/05 21:47:24 [warn] 1#1: conflicting server name \"\" on 0.0.0.0:80, ignored\r\n2022-10-05T19:47:24.705911789Z 2022/10/05 21:47:24 [notice] 1#1: using the \"epoll\" event method\r\n2022-10-05T19:47:24.706081756Z 2022/10/05 21:47:24 [notice] 1#1: start worker processes\r\n2022-10-05T19:47:24.706331032Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 23\r\n2022-10-05T19:47:24.706639951Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 24\r\n2022-10-05T19:47:24.706852248Z 2022/10/05 21:47:24 [notice] 1#1: start worker process 25\r\n2022-10-05T19:47:24.730032307Z Hook 'post-hook' ran with output:\r\n2022-10-05T19:47:24.730052144Z  Missing cert or key file, disabling TLS\r\n2022-10-05T19:47:24.730291842Z Hook 'post-hook' ran with error output:\r\n2022-10-05T19:47:24.730302613Z  nginx: [warn] conflicting server name \"\" on 0.0.0.0:80, ignored\r\n2022-10-05T19:47:24.732101009Z Some challenges have failed.\r\n2022-10-05T19:47:24.732342892Z Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.\r\n```\r\n\n", "before_files": [{"content": "#!/usr/bin/python3\n\nimport os\nimport time\nimport subprocess\n\nhostnames = ','.join(set(host.strip() for host in os.environ['HOSTNAMES'].split(',')))\n\ncommand = [\n    \"certbot\",\n    \"-n\", \"--agree-tos\", # non-interactive\n    \"-d\", hostnames, \"--expand\", \"--allow-subset-of-names\",\n    \"-m\", \"{}@{}\".format(os.environ[\"POSTMASTER\"], os.environ[\"DOMAIN\"]),\n    \"certonly\", \"--standalone\",\n    \"--cert-name\", \"mailu\",\n    \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n    \"--keep-until-expiring\",\n    \"--renew-with-new-domains\",\n    \"--config-dir\", \"/certs/letsencrypt\",\n    \"--post-hook\", \"/config.py\"\n]\ncommand2 = [\n    \"certbot\",\n    \"-n\", \"--agree-tos\", # non-interactive\n    \"-d\", hostnames, \"--expand\", \"--allow-subset-of-names\",\n    \"-m\", \"{}@{}\".format(os.environ[\"POSTMASTER\"], os.environ[\"DOMAIN\"]),\n    \"certonly\", \"--standalone\",\n    \"--cert-name\", \"mailu-ecdsa\",\n    \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n    \"--keep-until-expiring\",\n    \"--key-type\", \"ecdsa\",\n    \"--renew-with-new-domains\",\n    \"--config-dir\", \"/certs/letsencrypt\",\n    \"--post-hook\", \"/config.py\"\n]\n\n# Wait for nginx to start\ntime.sleep(5)\n\n# Run certbot every day\nwhile True:\n    subprocess.call(command)\n    subprocess.call(command2)\n    time.sleep(86400)\n", "path": "core/nginx/letsencrypt.py"}], "after_files": [{"content": "#!/usr/bin/python3\n\nimport os\nimport time\nimport subprocess\n\nhostnames = ','.join(set(host.strip() for host in os.environ['HOSTNAMES'].split(',')))\n\ncommand = [\n    \"certbot\",\n    \"-n\", \"--agree-tos\", # non-interactive\n    \"-d\", hostnames, \"--expand\", \"--allow-subset-of-names\",\n    \"-m\", \"{}@{}\".format(os.environ[\"POSTMASTER\"], os.environ[\"DOMAIN\"]),\n    \"certonly\", \"--standalone\",\n    \"--cert-name\", \"mailu\",\n    \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n    \"--keep-until-expiring\",\n    \"--allow-subset-of-names\",\n    \"--renew-with-new-domains\",\n    \"--config-dir\", \"/certs/letsencrypt\",\n    \"--post-hook\", \"/config.py\"\n]\ncommand2 = [\n    \"certbot\",\n    \"-n\", \"--agree-tos\", # non-interactive\n    \"-d\", hostnames, \"--expand\", \"--allow-subset-of-names\",\n    \"-m\", \"{}@{}\".format(os.environ[\"POSTMASTER\"], os.environ[\"DOMAIN\"]),\n    \"certonly\", \"--standalone\",\n    \"--cert-name\", \"mailu-ecdsa\",\n    \"--preferred-challenges\", \"http\", \"--http-01-port\", \"8008\",\n    \"--keep-until-expiring\",\n    \"--allow-subset-of-names\",\n    \"--key-type\", \"ecdsa\",\n    \"--renew-with-new-domains\",\n    \"--config-dir\", \"/certs/letsencrypt\",\n    \"--post-hook\", \"/config.py\"\n]\n\n# Wait for nginx to start\ntime.sleep(5)\n\n# Run certbot every day\nwhile True:\n    subprocess.call(command)\n    subprocess.call(command2)\n    time.sleep(86400)\n", "path": "core/nginx/letsencrypt.py"}]}