Switch to the right mail profileID if it's not matching the current one

This commit is contained in:
Hadi Nategh 2021-10-26 11:09:59 +02:00
parent d9ae364595
commit 75b168fb0d

View File

@ -4998,6 +4998,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
if(Mail::$debug) error_log(__METHOD__."->".array2string($_messageList)); if(Mail::$debug) error_log(__METHOD__."->".array2string($_messageList));
$uidA = self::splitRowID($_messageList['msg'][0]); $uidA = self::splitRowID($_messageList['msg'][0]);
if ($uidA['profileID'] && $uidA['profileID'] != $this->mail_bo->profileID)
{
$this->changeProfile($uidA['profileID']);
}
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder $folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
$this->mail_bo->sendMDN($uidA['msgUID'],$folder); $this->mail_bo->sendMDN($uidA['msgUID'],$folder);
} }
@ -5024,6 +5028,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
// we have both messageIds AND allFlag folder information // we have both messageIds AND allFlag folder information
$uidA = self::splitRowID($_messageList['msg'][0]); $uidA = self::splitRowID($_messageList['msg'][0]);
if ($uidA['profileID'] && $uidA['profileID'] != $this->mail_bo->profileID)
{
$this->changeProfile($uidA['profileID']);
}
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder $folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
if(!$folder && !$uidA['msg'] && $uidA['accountID']) if(!$folder && !$uidA['msg'] && $uidA['accountID'])
{ {
@ -5161,6 +5169,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
else else
{ {
$uidA = self::splitRowID($_messageList['msg'][0]); $uidA = self::splitRowID($_messageList['msg'][0]);
if ($uidA['profileID'] && $uidA['profileID'] != $this->mail_bo->profileID)
{
$this->changeProfile($uidA['profileID']);
}
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder $folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
} }
if (!$alreadyFlagged) if (!$alreadyFlagged)
@ -5222,6 +5234,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
// we have both messageIds AND allFlag folder information // we have both messageIds AND allFlag folder information
$uidA = self::splitRowID($_messageList['msg'][0]); $uidA = self::splitRowID($_messageList['msg'][0]);
if ($uidA['profileID'] && $uidA['profileID'] != $this->mail_bo->profileID)
{
$this->changeProfile($uidA['profileID']);
}
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder $folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
if (isset($_messageList['activeFilters']) && $_messageList['activeFilters']) if (isset($_messageList['activeFilters']) && $_messageList['activeFilters'])
{ {
@ -5292,6 +5308,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
else else
{ {
$uidA = self::splitRowID($_messageList['msg'][0]); $uidA = self::splitRowID($_messageList['msg'][0]);
if ($uidA['profileID'] && $uidA['profileID'] != $this->mail_bo->profileID)
{
$this->changeProfile($uidA['profileID']);
}
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder $folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
foreach($_messageList['msg'] as $rowID) foreach($_messageList['msg'] as $rowID)
{ {