From 926570f1ca0d2a8595f4841023c96b79e7f8a977 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Sat, 28 Jan 2023 18:30:33 +0100 Subject: [PATCH] Need this too --- webmails/start.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webmails/start.py b/webmails/start.py index 84d05654..7a8d6bf2 100755 --- a/webmails/start.py +++ b/webmails/start.py @@ -20,6 +20,12 @@ context.update(env) context["MAX_FILESIZE"] = str(int(int(env.get("MESSAGE_SIZE_LIMIT", "50000000")) * 0.66 / 1048576)) +# Get the first DNS server +with open("/etc/resolv.conf") as handle: + content = handle.read().split() + resolver = content[content.index("nameserver") + 1] + context["RESOLVER"] = f"[{resolver}]" if ":" in resolver else resolver + db_flavor = env.get("ROUNDCUBE_DB_FLAVOR", "sqlite") if db_flavor == "sqlite": context["DB_DSNW"] = "sqlite:////data/roundcube.db"