Group folder subscriptions email broken after upgrade to 7.10.18 #3820

Open
opened 2026-02-20 16:10:17 -05:00 by deekerman · 4 comments
Owner

Originally created by @tsmgeek on GitHub (Jul 9, 2019).

Issue

I currently ran an upgrade from 7.8.X to 7.10.18 which mostly went fine.
I have seen an odd thing happening when trying to assign a group mailbox to a user.
When I try and assign a group mailbox to a user i start to get all these messages in the log.

Tue Jul  9 13:14:25 2019 [1930][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2
Tue Jul  9 13:14:36 2019 [1872][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2
Tue Jul  9 13:14:36 2019 [1872][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2
Tue Jul  9 13:14:44 2019 [1892][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2
Tue Jul  9 13:14:44 2019 [1892][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2

I did some digging and took me to this part of the code.
https://github.com/salesagility/SuiteCRM/blob/7.10.x/modules/Emails/EmailUIAjax.php#L76-L83

When I select a group mailbox, the ID passed to EmailUIAjax:setFolderViewSelection is the id of the Inbound Email account. But afaik this will not always match the folder_id, should it not be passing group_id or groupfolder_id?

So when I select the one Inbound Email account I see, it does nothing as it never finds a match on the folders table. When I un-select the group account then I have a bigger issue. It posts though a blank array entry to ieIdShow[] and this in turn runs the SQL query in the above link with blanks and as its a LIKE query all the folders come back which then gets added as subscription folders for the user.

It just ends up adding more and more entries into the subscriptions table.

Expected Behavior

Assign group folder subscriptions correctly.

Actual Behavior

Spams the folder_subscriptions table and keeps getting bigger and bigger then throws up errors in the log about duplicate folders.

Possible Fix

  1. Filter out blank ieIdShow entries.
  2. Change to using = instead of LIKE
  3. Do not proceed to query if the value is empty at all
  4. Return the group_id or groupfolder_id when assigning inbound email accounts or process this server side.

Steps to Reproduce

  1. Select and deselect group email account on user account

Your Environment

  • SuiteCRM Version 7.10.18
  • Version 75.0.3770.100 (Official Build) (64-bit)
  • MySQL, PHP 7.1
  • Docker on Centos 7
Originally created by @tsmgeek on GitHub (Jul 9, 2019). #### Issue I currently ran an upgrade from 7.8.X to 7.10.18 which mostly went fine. I have seen an odd thing happening when trying to assign a group mailbox to a user. When I try and assign a group mailbox to a user i start to get all these messages in the log. ``` Tue Jul 9 13:14:25 2019 [1930][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2 Tue Jul 9 13:14:36 2019 [1872][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2 Tue Jul 9 13:14:36 2019 [1872][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2 Tue Jul 9 13:14:44 2019 [1892][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2 Tue Jul 9 13:14:44 2019 [1892][30a6bf63-688a-63b1-17b6-5d24930a07d3][ERROR] Duplicated folder detected: 1fcb3af1-98c9-0da5-231d-5bf2b78449a2 ``` I did some digging and took me to this part of the code. https://github.com/salesagility/SuiteCRM/blob/7.10.x/modules/Emails/EmailUIAjax.php#L76-L83 When I select a group mailbox, the ID passed to EmailUIAjax:setFolderViewSelection is the `id` of the Inbound Email account. But afaik this will not always match the `folder_id`, should it not be passing `group_id` or `groupfolder_id`? So when I select the one Inbound Email account I see, it does nothing as it never finds a match on the folders table. When I un-select the group account then I have a bigger issue. It posts though a blank array entry to `ieIdShow[]` and this in turn runs the SQL query in the above link with blanks and as its a LIKE query all the folders come back which then gets added as subscription folders for the user. It just ends up adding more and more entries into the subscriptions table. #### Expected Behavior Assign group folder subscriptions correctly. #### Actual Behavior Spams the `folder_subscriptions` table and keeps getting bigger and bigger then throws up errors in the log about duplicate folders. #### Possible Fix 1. Filter out blank `ieIdShow` entries. 2. Change to using `=` instead of `LIKE` 3. Do not proceed to query if the value is empty at all 4. Return the `group_id` or `groupfolder_id` when assigning inbound email accounts or process this server side. #### Steps to Reproduce 1. Select and deselect group email account on user account #### Your Environment * SuiteCRM Version 7.10.18 * Version 75.0.3770.100 (Official Build) (64-bit) * MySQL, PHP 7.1 * Docker on Centos 7
Author
Owner

@pabaillon commented on GitHub (Jul 10, 2019):

Hi,
I have exactely the same problem with the version 7.11.6.

@pabaillon commented on GitHub (Jul 10, 2019): Hi, I have exactely the same problem with the version 7.11.6.
Author
Owner

@tsmgeek commented on GitHub (Jul 19, 2019):

Is there any more info required?

@tsmgeek commented on GitHub (Jul 19, 2019): Is there any more info required?
Author
Owner

@Proziam commented on GitHub (Dec 9, 2019):

I just wanted to mention that I'm experiencing the exact same issue, I've yet to find a working solution myself unfortunately.

@Proziam commented on GitHub (Dec 9, 2019): I just wanted to mention that I'm experiencing the exact same issue, I've yet to find a working solution myself unfortunately.
Author
Owner

@viewpointsa commented on GitHub (Sep 29, 2021):

I have many problem with mail/group email, table folder_subscriptions has bad filling, another problem come from table user_preferences who keep informations about deleted mail account.

@viewpointsa commented on GitHub (Sep 29, 2021): I have many problem with mail/group email, table `folder_subscriptions` has bad filling, another problem come from table `user_preferences` who keep informations about deleted mail account.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#3820
No description provided.