We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unnecessary assignment on `HOST_WEBMAIL`
We came across another piece of garbage:

https://github.com/Mailu/Mailu/blob/f3f0c3190be9ab9b53a29c5b0326fc9a4602df46/core/nginx/config.py#L19

https://github.com/Mailu/Mailu/blob/f3f0c3190be9ab9b53a29c5b0326fc9a4602df46/core/nginx/config.py#L22

--- 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/config.py`
Content:
```
1 #!/usr/bin/python3
2 
3 import os
4 import logging as log
5 import sys
6 from socrate import system, conf
7 
8 args = os.environ.copy()
9 
10 log.basicConfig(stream=sys.stderr, level=args.get("LOG_LEVEL", "WARNING"))
11 
12 # Get the first DNS server
13 with open("/etc/resolv.conf") as handle:
14     content = handle.read().split()
15     args["RESOLVER"] = content[content.index("nameserver") + 1]
16 
17 args["ADMIN_ADDRESS"] = system.resolve_address(args.get("HOST_ADMIN", "admin"))
18 args["ANTISPAM_ADDRESS"] = system.resolve_address(args.get("HOST_ANTISPAM", "antispam:11334"))
19 args["HOST_WEBMAIL"] = args.get("HOST_WEBMAIL", "webmail")
20 if args["WEBMAIL"] != "none":
21     args["WEBMAIL_ADDRESS"] = system.resolve_address(args.get("HOST_WEBMAIL"))
22 args["HOST_WEBDAV"] = args.get("HOST_WEBDAV", "webdav:5232")
23 if args["WEBDAV"] != "none":
24     args["WEBDAV_ADDRESS"] = system.resolve_address(args.get("HOST_WEBDAV"))
25 
26 # TLS configuration
27 cert_name = os.getenv("TLS_CERT_FILENAME", default="cert.pem")
28 keypair_name = os.getenv("TLS_KEYPAIR_FILENAME", default="key.pem")
29 args["TLS"] = {
30     "cert": ("/certs/%s" % cert_name, "/certs/%s" % keypair_name),
31     "letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
32         "/certs/letsencrypt/live/mailu/privkey.pem"),
33     "mail": ("/certs/%s" % cert_name, "/certs/%s" % keypair_name),
34     "mail-letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
35         "/certs/letsencrypt/live/mailu/privkey.pem"),
36     "notls": None
37 }[args["TLS_FLAVOR"]]
38 
39 if args["TLS"] and not all(os.path.exists(file_path) for file_path in args["TLS"]):
40     print("Missing cert or key file, disabling TLS")
41     args["TLS_ERROR"] = "yes"
42 
43 # Build final configuration paths
44 conf.jinja("/conf/tls.conf", args, "/etc/nginx/tls.conf")
45 conf.jinja("/conf/proxy.conf", args, "/etc/nginx/proxy.conf")
46 conf.jinja("/conf/nginx.conf", args, "/etc/nginx/nginx.conf")
47 if os.path.exists("/var/run/nginx.pid"):
48     os.system("nginx -s reload")
49
```
--- 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/config.py b/core/nginx/config.py
--- a/core/nginx/config.py
+++ b/core/nginx/config.py
@@ -16,12 +16,10 @@
 
 args["ADMIN_ADDRESS"] = system.resolve_address(args.get("HOST_ADMIN", "admin"))
 args["ANTISPAM_ADDRESS"] = system.resolve_address(args.get("HOST_ANTISPAM", "antispam:11334"))
-args["HOST_WEBMAIL"] = args.get("HOST_WEBMAIL", "webmail")
 if args["WEBMAIL"] != "none":
-    args["WEBMAIL_ADDRESS"] = system.resolve_address(args.get("HOST_WEBMAIL"))
-args["HOST_WEBDAV"] = args.get("HOST_WEBDAV", "webdav:5232")
+    args["WEBMAIL_ADDRESS"] = system.resolve_address(args.get("HOST_WEBMAIL", "webmail"))
 if args["WEBDAV"] != "none":
-    args["WEBDAV_ADDRESS"] = system.resolve_address(args.get("HOST_WEBDAV"))
+    args["WEBDAV_ADDRESS"] = system.resolve_address(args.get("HOST_WEBDAV", "webdav:5232"))
 
 # TLS configuration
 cert_name = os.getenv("TLS_CERT_FILENAME", default="cert.pem")

{"golden_diff": "diff --git a/core/nginx/config.py b/core/nginx/config.py\n--- a/core/nginx/config.py\n+++ b/core/nginx/config.py\n@@ -16,12 +16,10 @@\n \n args[\"ADMIN_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ADMIN\", \"admin\"))\n args[\"ANTISPAM_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ANTISPAM\", \"antispam:11334\"))\n-args[\"HOST_WEBMAIL\"] = args.get(\"HOST_WEBMAIL\", \"webmail\")\n if args[\"WEBMAIL\"] != \"none\":\n-    args[\"WEBMAIL_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBMAIL\"))\n-args[\"HOST_WEBDAV\"] = args.get(\"HOST_WEBDAV\", \"webdav:5232\")\n+    args[\"WEBMAIL_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBMAIL\", \"webmail\"))\n if args[\"WEBDAV\"] != \"none\":\n-    args[\"WEBDAV_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBDAV\"))\n+    args[\"WEBDAV_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBDAV\", \"webdav:5232\"))\n \n # TLS configuration\n cert_name = os.getenv(\"TLS_CERT_FILENAME\", default=\"cert.pem\")\n", "issue": "Unnecessary assignment on `HOST_WEBMAIL`\nWe came across another piece of garbage:\r\n\r\nhttps://github.com/Mailu/Mailu/blob/f3f0c3190be9ab9b53a29c5b0326fc9a4602df46/core/nginx/config.py#L19\r\n\r\nhttps://github.com/Mailu/Mailu/blob/f3f0c3190be9ab9b53a29c5b0326fc9a4602df46/core/nginx/config.py#L22\n", "before_files": [{"content": "#!/usr/bin/python3\n\nimport os\nimport logging as log\nimport sys\nfrom socrate import system, conf\n\nargs = os.environ.copy()\n\nlog.basicConfig(stream=sys.stderr, level=args.get(\"LOG_LEVEL\", \"WARNING\"))\n\n# Get the first DNS server\nwith open(\"/etc/resolv.conf\") as handle:\n    content = handle.read().split()\n    args[\"RESOLVER\"] = content[content.index(\"nameserver\") + 1]\n\nargs[\"ADMIN_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ADMIN\", \"admin\"))\nargs[\"ANTISPAM_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ANTISPAM\", \"antispam:11334\"))\nargs[\"HOST_WEBMAIL\"] = args.get(\"HOST_WEBMAIL\", \"webmail\")\nif args[\"WEBMAIL\"] != \"none\":\n    args[\"WEBMAIL_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBMAIL\"))\nargs[\"HOST_WEBDAV\"] = args.get(\"HOST_WEBDAV\", \"webdav:5232\")\nif args[\"WEBDAV\"] != \"none\":\n    args[\"WEBDAV_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBDAV\"))\n\n# TLS configuration\ncert_name = os.getenv(\"TLS_CERT_FILENAME\", default=\"cert.pem\")\nkeypair_name = os.getenv(\"TLS_KEYPAIR_FILENAME\", default=\"key.pem\")\nargs[\"TLS\"] = {\n    \"cert\": (\"/certs/%s\" % cert_name, \"/certs/%s\" % keypair_name),\n    \"letsencrypt\": (\"/certs/letsencrypt/live/mailu/fullchain.pem\",\n        \"/certs/letsencrypt/live/mailu/privkey.pem\"),\n    \"mail\": (\"/certs/%s\" % cert_name, \"/certs/%s\" % keypair_name),\n    \"mail-letsencrypt\": (\"/certs/letsencrypt/live/mailu/fullchain.pem\",\n        \"/certs/letsencrypt/live/mailu/privkey.pem\"),\n    \"notls\": None\n}[args[\"TLS_FLAVOR\"]]\n\nif args[\"TLS\"] and not all(os.path.exists(file_path) for file_path in args[\"TLS\"]):\n    print(\"Missing cert or key file, disabling TLS\")\n    args[\"TLS_ERROR\"] = \"yes\"\n\n# Build final configuration paths\nconf.jinja(\"/conf/tls.conf\", args, \"/etc/nginx/tls.conf\")\nconf.jinja(\"/conf/proxy.conf\", args, \"/etc/nginx/proxy.conf\")\nconf.jinja(\"/conf/nginx.conf\", args, \"/etc/nginx/nginx.conf\")\nif os.path.exists(\"/var/run/nginx.pid\"):\n    os.system(\"nginx -s reload\")\n", "path": "core/nginx/config.py"}], "after_files": [{"content": "#!/usr/bin/python3\n\nimport os\nimport logging as log\nimport sys\nfrom socrate import system, conf\n\nargs = os.environ.copy()\n\nlog.basicConfig(stream=sys.stderr, level=args.get(\"LOG_LEVEL\", \"WARNING\"))\n\n# Get the first DNS server\nwith open(\"/etc/resolv.conf\") as handle:\n    content = handle.read().split()\n    args[\"RESOLVER\"] = content[content.index(\"nameserver\") + 1]\n\nargs[\"ADMIN_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ADMIN\", \"admin\"))\nargs[\"ANTISPAM_ADDRESS\"] = system.resolve_address(args.get(\"HOST_ANTISPAM\", \"antispam:11334\"))\nif args[\"WEBMAIL\"] != \"none\":\n    args[\"WEBMAIL_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBMAIL\", \"webmail\"))\nif args[\"WEBDAV\"] != \"none\":\n    args[\"WEBDAV_ADDRESS\"] = system.resolve_address(args.get(\"HOST_WEBDAV\", \"webdav:5232\"))\n\n# TLS configuration\ncert_name = os.getenv(\"TLS_CERT_FILENAME\", default=\"cert.pem\")\nkeypair_name = os.getenv(\"TLS_KEYPAIR_FILENAME\", default=\"key.pem\")\nargs[\"TLS\"] = {\n    \"cert\": (\"/certs/%s\" % cert_name, \"/certs/%s\" % keypair_name),\n    \"letsencrypt\": (\"/certs/letsencrypt/live/mailu/fullchain.pem\",\n        \"/certs/letsencrypt/live/mailu/privkey.pem\"),\n    \"mail\": (\"/certs/%s\" % cert_name, \"/certs/%s\" % keypair_name),\n    \"mail-letsencrypt\": (\"/certs/letsencrypt/live/mailu/fullchain.pem\",\n        \"/certs/letsencrypt/live/mailu/privkey.pem\"),\n    \"notls\": None\n}[args[\"TLS_FLAVOR\"]]\n\nif args[\"TLS\"] and not all(os.path.exists(file_path) for file_path in args[\"TLS\"]):\n    print(\"Missing cert or key file, disabling TLS\")\n    args[\"TLS_ERROR\"] = \"yes\"\n\n# Build final configuration paths\nconf.jinja(\"/conf/tls.conf\", args, \"/etc/nginx/tls.conf\")\nconf.jinja(\"/conf/proxy.conf\", args, \"/etc/nginx/proxy.conf\")\nconf.jinja(\"/conf/nginx.conf\", args, \"/etc/nginx/nginx.conf\")\nif os.path.exists(\"/var/run/nginx.pid\"):\n    os.system(\"nginx -s reload\")\n", "path": "core/nginx/config.py"}]}