From c4a158ea81e455097fc9a030a23c5e4dea4e4aa7 Mon Sep 17 00:00:00 2001 From: Sebastian Marsching Date: Thu, 12 Oct 2023 21:29:05 +0200 Subject: [PATCH] Use domain from e-mail address, if provided. This ensures that the correct SRV records are retrieved when the autoconfig file is loaded through a redirect or proxy. --- data/web/autoconfig.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/web/autoconfig.php b/data/web/autoconfig.php index 95952df0d..fdf70a77b 100644 --- a/data/web/autoconfig.php +++ b/data/web/autoconfig.php @@ -23,6 +23,13 @@ else { $port = substr($_SERVER['HTTP_HOST'], $domain_port+1); } +if (isset($_GET['emailaddress'])) { + $emailaddress_at = strpos($_GET['emailaddress'], '@'); + if ($emailaddress_at !== FALSE) { + $domain = substr($_GET['emailaddress'], $emailaddress_at + 1); + } +} + header('Content-Type: application/xml'); ?> '; ?>