From 9c8e8007f98ad45f59101a75c9b8037f48b504dc Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sat, 3 Oct 2020 20:42:15 +0200 Subject: [PATCH] Remove setup check for php mail Signed-off-by: Daniel Kesselberg --- .../lib/Controller/CheckSetupController.php | 6 --- .../Controller/CheckSetupControllerTest.php | 40 ------------------- core/js/setupchecks.js | 12 ------ 3 files changed, 58 deletions(-) diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 6d237e04c1..5c7bb4a85e 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -522,10 +522,6 @@ Raw output return []; } - protected function isPHPMailerUsed(): bool { - return $this->config->getSystemValue('mail_smtpmode', 'smtp') === 'php'; - } - protected function hasOpcacheLoaded(): bool { return extension_loaded('Zend OPcache'); } @@ -722,8 +718,6 @@ Raw output 'missingColumns' => $this->hasMissingColumns(), 'isSqliteUsed' => $this->isSqliteUsed(), 'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'), - 'isPHPMailerUsed' => $this->isPHPMailerUsed(), - 'mailSettingsDocumentation' => $this->urlGenerator->getAbsoluteURL('index.php/settings/admin'), 'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(), 'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(), 'recommendedPHPModules' => $this->hasRecommendedPHPModules(), diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index 819c8edcca..6943ee8e26 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -479,10 +479,6 @@ class CheckSetupControllerTest extends TestCase { 'relativeTime' => '2 hours ago', 'backgroundJobsUrl' => 'https://example.org', ]); - $this->checkSetupController - ->expects($this->once()) - ->method('isPHPMailerUsed') - ->willReturn(false); $this->checker ->expects($this->once()) ->method('hasPassedCheck') @@ -588,8 +584,6 @@ class CheckSetupControllerTest extends TestCase { 'databaseConversionDocumentation' => 'http://docs.example.org/server/go.php?to=admin-db-conversion', 'missingIndexes' => [], 'missingColumns' => [], - 'isPHPMailerUsed' => false, - 'mailSettingsDocumentation' => 'https://server/index.php/settings/admin', 'isMemoryLimitSufficient' => true, 'appDirsWithDifferentOwner' => [], 'recommendedPHPModules' => [], @@ -605,40 +599,6 @@ class CheckSetupControllerTest extends TestCase { $this->assertEquals($expected, $this->checkSetupController->check()); } - public function testIsPHPMailerUsed() { - $checkSetupController = $this->getMockBuilder(CheckSetupController::class) - ->setConstructorArgs([ - 'settings', - $this->request, - $this->config, - $this->clientService, - $this->urlGenerator, - $this->l10n, - $this->checker, - $this->logger, - $this->dispatcher, - $this->db, - $this->lockingProvider, - $this->dateTimeFormatter, - $this->memoryInfo, - $this->secureRandom, - $this->iniGetWrapper, - ]) - ->setMethods(null)->getMock(); - - $this->config->expects($this->at(0)) - ->method('getSystemValue') - ->with('mail_smtpmode', 'smtp') - ->willReturn('php'); - $this->config->expects($this->at(1)) - ->method('getSystemValue') - ->with('mail_smtpmode', 'smtp') - ->willReturn('not-php'); - - $this->assertTrue($this->invokePrivate($checkSetupController, 'isPHPMailerUsed')); - $this->assertFalse($this->invokePrivate($checkSetupController, 'isPHPMailerUsed')); - } - public function testGetCurlVersion() { $checkSetupController = $this->getMockBuilder(CheckSetupController::class) ->setConstructorArgs([ diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 4773a20153..c8ca1afe51 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -417,18 +417,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }) } - if (data.isPHPMailerUsed) { - messages.push({ - msg: t( - 'core', - 'Use of the the built in php mailer is no longer supported. Please update your email server settings ↗.', - { - docLink: data.mailSettingsDocumentation, - } - ), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }); - } if (!data.isMemoryLimitSufficient) { messages.push({ msg: t(