Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable1.12] fix(autoconfig): Disable buggy DNS query #9973

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/codecov-action@v3.0.0
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/codecov-action@v3.0.0
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;
}
}
Loading