diff --git a/lib/Service/AutoConfig/MxRecord.php b/lib/Service/AutoConfig/MxRecord.php index 0090b14155..b6fe622cb4 100644 --- a/lib/Service/AutoConfig/MxRecord.php +++ b/lib/Service/AutoConfig/MxRecord.php @@ -49,10 +49,10 @@ public function query(string $host) { $sortedRecords = array_combine($mxRecords, $mxWeights); asort($sortedRecords, SORT_NUMERIC); - $mxRecords = array_filter($mxRecords, static function ($record) { + $mxRecords = array_filter(array_keys($sortedRecords), static function ($record) { return !empty($record); }); - $this->logger->debug("found " . count($mxRecords) . " MX records for host <$host>"); + $this->logger->debug("found " . count($sortedRecords) . " MX records for host <$host>"); if (empty(($mxRecords))) { return []; }