mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Add more logging for #907
This commit is contained in:
parent
f2ca5f6a30
commit
636ffe5fbb
1 changed files with 7 additions and 4 deletions
|
|
@ -36,7 +36,7 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
$oActions = \RainLoop\Api::Actions();
|
$oActions = \RainLoop\Api::Actions();
|
||||||
$oAccount = $oActions->getAccountFromToken();
|
$oAccount = $oActions->getAccountFromToken();
|
||||||
if (!$oAccount) {
|
if (!$oAccount) {
|
||||||
\error_log('No Account');
|
$this->Logger()->Write('No Account');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$oSettingsLocal = $oActions->SettingsProvider(true)->Load($oAccount);
|
$oSettingsLocal = $oActions->SettingsProvider(true)->Load($oAccount);
|
||||||
|
|
@ -114,8 +114,9 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
foreach ($found as $role => $folders) {
|
foreach ($found as $role => $folders) {
|
||||||
if (isset($folders[0])) {
|
if (isset($folders[0])) {
|
||||||
// Set the first as default
|
// Set the first as default
|
||||||
// \error_log("Set role {$role}");
|
$aFolder = &$aResponse['Result']['@Collection'][$folders[0]];
|
||||||
$aResponse['Result']['@Collection'][$folders[0]]['role'] = $role;
|
$this->Logger()->Write("Set {$role} mailbox to {$aFolder['fullName']}");
|
||||||
|
$aFolder['role'] = $role;
|
||||||
} else if ($this->Config()->Get('plugin', 'autocreate_system_folders', false)) {
|
} else if ($this->Config()->Get('plugin', 'autocreate_system_folders', false)) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -136,7 +137,7 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// \error_log("Create mailbox {$sFolderNameToCreate}");
|
$this->Logger()->Write("Create {$role} mailbox {$sFolderNameToCreate}");
|
||||||
$aFolder = $oActions->MailClient()->FolderCreate(
|
$aFolder = $oActions->MailClient()->FolderCreate(
|
||||||
$sFolderNameToCreate,
|
$sFolderNameToCreate,
|
||||||
$sParent,
|
$sParent,
|
||||||
|
|
@ -150,6 +151,8 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
{
|
{
|
||||||
$this->Logger()->WriteException($oException);
|
$this->Logger()->WriteException($oException);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->Logger()->Write("Mailbox for {$role} not created");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue