Skip to content

Commit

Permalink
fixup! fixup! feat: per account imap and smtp debugging
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Nov 7, 2024
1 parent 6f37da9 commit 2c0f6fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/IMAP/IMAPClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/SMTP/SmtpClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 4 additions & 1 deletion tests/Unit/SMTP/SmtpClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 2c0f6fe

Please sign in to comment.