Skip to content

Commit

Permalink
fix(autoconfig): Disable bugy DNS query
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Oct 18, 2024
1 parent 4a562f0 commit 5476e0b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/Service/AutoConfig/IspDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public function getUrls(): array {
];
}

public function __construct(IClientService $clientService, LoggerInterface $logger) {
public function __construct(IClientService $clientService,
LoggerInterface $logger) {
$this->client = $clientService->newClient();
$this->logger = $logger;
}
Expand Down Expand Up @@ -119,10 +120,9 @@ private function convertServerElement(\SimpleXMLElement $server): array {

/**
* @param string $domain
* @param bool $tryMx
* @return array
*/
public function query(string $domain, string $email, bool $tryMx = true): array {
public function query(string $domain, string $email): array {
$this->logger->debug("IsbDb: querying <$domain>");
if (strpos($domain, '@') !== false) {
// TODO: use horde mail address parsing instead
Expand All @@ -149,14 +149,6 @@ public function query(string $domain, string $email, bool $tryMx = true): array
}
}
}

if ($tryMx && ($dns = dns_get_record($domain, DNS_MX))) {
$domain = $dns[0]['target'];
if (!($provider = $this->query($domain, $email, false))) {
[, $domain] = explode('.', $domain, 2);
$provider = $this->query($domain, $email, false);
}
}
return $provider;
}
}

0 comments on commit 5476e0b

Please sign in to comment.