Skip to content

Commit

Permalink
fix(setup): Use MX sort result
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Feb 13, 2024
1 parent ab1ee59 commit e7e69d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Service/AutoConfig/MxRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
}
Expand Down

0 comments on commit e7e69d9

Please sign in to comment.