Added debug log for #431

This commit is contained in:
the-djmaze 2022-06-08 13:12:33 +02:00
parent 0f02cc6d29
commit 03e8d38a1c

View file

@ -30,8 +30,10 @@ class OverrideSmtpCredentialsPlugin extends \RainLoop\Plugins\AbstractPlugin
$sHost = \trim($this->Config()->Get('plugin', 'smtp_host', ''));
$sWhiteList = \trim($this->Config()->Get('plugin', 'override_users', ''));
if (0 < strlen($sWhiteList) && 0 < \strlen($sHost) && \RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sWhiteList))
$sFoundValue = '';
if (0 < strlen($sWhiteList) && 0 < \strlen($sHost) && \RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sWhiteList, $sFoundValue))
{
\SnappyMail\LOG::debug('SMTP Override', "{$sEmail} matched {$sFoundValue}");
$aSmtpCredentials['Host'] = $sHost;
$aSmtpCredentials['Port'] = (int) $this->Config()->Get('plugin', 'smtp_port', 25);
@ -53,6 +55,10 @@ class OverrideSmtpCredentialsPlugin extends \RainLoop\Plugins\AbstractPlugin
$aSmtpCredentials['Login'] = \trim($this->Config()->Get('plugin', 'smtp_user', ''));
$aSmtpCredentials['Password'] = (string) $this->Config()->Get('plugin', 'smtp_password', '');
}
else
{
\SnappyMail\LOG::debug('SMTP Override', "{$sEmail} no match");
}
}
}