From 2c0f6fe044f21c68570e0c4e2cac7845dc45be2f Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Thu, 7 Nov 2024 14:04:27 -0500 Subject: [PATCH] fixup! fixup! feat: per account imap and smtp debugging Signed-off-by: SebastianKrupinski --- lib/IMAP/IMAPClientFactory.php | 2 +- lib/SMTP/SmtpClientFactory.php | 2 +- tests/Unit/SMTP/SmtpClientFactoryTest.php | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/IMAP/IMAPClientFactory.php b/lib/IMAP/IMAPClientFactory.php index 9ed22f5cb2..14e8b9dba9 100644 --- a/lib/IMAP/IMAPClientFactory.php +++ b/lib/IMAP/IMAPClientFactory.php @@ -118,7 +118,7 @@ public function getClient(Account $account, bool $useCache = true): Horde_Imap_C ]; } $debug = array_merge( - explode('|', $this->config->getSystemValue('MAIL_DEBUG')), + explode('|', $this->config->getSystemValueString('MAIL_DEBUG')), explode('|', $account->getDebug()) ); if (in_array('imap', $debug) || in_array('imap-full', $debug)) { diff --git a/lib/SMTP/SmtpClientFactory.php b/lib/SMTP/SmtpClientFactory.php index d0ddb33693..68fc222415 100644 --- a/lib/SMTP/SmtpClientFactory.php +++ b/lib/SMTP/SmtpClientFactory.php @@ -78,7 +78,7 @@ public function create(Account $account): Horde_Mail_Transport { ); } $debug = array_merge( - explode('|', $this->config->getSystemValue('MAIL_DEBUG', '')), + explode('|', $this->config->getSystemValueString('MAIL_DEBUG')), explode('|', $account->getDebug()) ); if (in_array('smtp', $debug)) { diff --git a/tests/Unit/SMTP/SmtpClientFactoryTest.php b/tests/Unit/SMTP/SmtpClientFactoryTest.php index 456cb0c98f..6e63e48d46 100644 --- a/tests/Unit/SMTP/SmtpClientFactoryTest.php +++ b/tests/Unit/SMTP/SmtpClientFactoryTest.php @@ -69,13 +69,16 @@ public function testSmtpTransport() { ->method('getSystemValue') ->willReturnMap([ ['app.mail.transport', 'smtp', 'smtp'], - ['debug', false, false], ['app.mail.smtp.timeout', 20, 2], ]); $this->config->expects($this->any()) ->method('getSystemValueBool') ->with('app.mail.verify-tls-peer', true) ->willReturn(true); + $this->config->expects($this->any()) + ->method('getSystemValueString') + ->with('MAIL_DEBUG') + ->willReturn(''); $this->crypto->expects($this->once()) ->method('decrypt') ->with('obenc')