Skip to content

Commit

Permalink
Merge pull request #9973 from nextcloud/backport/9964/stable1.12
Browse files Browse the repository at this point in the history
[stable1.12] fix(autoconfig): Disable buggy DNS query
  • Loading branch information
ChristophWurst authored Oct 18, 2024
2 parents 4a562f0 + 8adf118 commit 30fcc5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'dev-master', 'dev-stable24', 'dev-stable23', 'dev-stable22', 'dev-stable21' ]
ocp-version: [ 'dev-stable24', 'dev-stable23', 'dev-stable22', 'dev-stable21' ]
name: Nextcloud ${{ matrix.ocp-version }}
steps:
- name: Checkout
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ jobs:
nextcloud-versions: stable24
- php-versions: 8.0
nextcloud-versions: stable24
- php-versions: 7.4
nextcloud-versions: master
- php-versions: 8.0
nextcloud-versions: master
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests
steps:
- name: Set up php${{ matrix.php-versions }}
Expand Down Expand Up @@ -56,6 +52,7 @@ jobs:
uses: codecov/[email protected]
if: ${{ always() && matrix.nextcloud-versions == 'master' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./nextcloud/apps/mail/tests/clover.unit.xml
flags: unittests
fail_ci_if_error: true
Expand Down Expand Up @@ -95,7 +92,7 @@ jobs:
--health-timeout=5s
--health-retries=3
postgres-service:
image: postgres
image: postgres:14
env:
POSTGRES_USER: nextcloud
POSTGRES_DB: nextcloud
Expand Down Expand Up @@ -156,6 +153,7 @@ jobs:
uses: codecov/[email protected]
if: ${{ always() && matrix.db == 'mysql' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./nextcloud/apps/mail/tests/clover.integration.xml
flags: integrationtests
fail_ci_if_error: true
Expand Down
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 30fcc5a

Please sign in to comment.