How to assign inbox group email account to users?

Hi,

I just made a fresh install of SuiteCRM Version 7.11.10.
Then I created a new inbound group email account as an admin user.

If I check the email accounts available for the admin profil, I can see the new account wich is enabled.
If I go to the email module, I can see those emails too.

I created 2 new users with no admin privileges. They can log in fine.

Anyway as an admin I can’t find a way to give access to the group email account to these users.
If I go to their profiles through the admin panel, in their email settings, I can’t find the group email account.

How am I supposed to do that ?

Thank you

Hi Marc,

In the tab to the left, under the header folder management, there should be the folders the admin user can assign to the user. (This should include group mail accounts). There are however a few issues with email folders atm that a being actively worked on by the internal team. Let me know your results :slight_smile:

Hi,

Thank’s for your answer, hopelessly the list is empty when I’m editing a normal user.

Anyway, I just did a new fresh install and I’m still having this issue. I guess I might just be missing something.

Here’s what I’ve done:

As and admin user

  • I created a new user
  • I did not define any role nor security group
  • Then I created a new inbound group email account
  • I checked into the email module from the admin user
  • the mailbox is there and I can select which folder of the mailbox to look into
  • If I go into the email setting of the admin user
  • I can see the available folders of my group mailbox on the first tab and the mail account on the second tab
  • If I go into the email settings of the normal user, there is nothing

As the normal user

  • I checked into the email module
  • I can see some mails but I can’t select which folder to look into
  • I defined a personal mailbox for this user
  • I checked into the email module
  • I can see mails from the personal mail account
  • When I try to change the current folder, I can’t find the group account anymore

Did I forget something ?

At a last resort, I can do it by a direct update into the database but I can’t figure out right how users and group mailboxes are linked together.
I saw there’s a table inbound_email, so I may find out how to do it this way.

If you have any more idea, let me know

I’ve got a temporary solution, but it is very fragile.

To show all all mailboxes under folder management:
Open file include/SugarFolders/SugarFolders.php, find
$folders = $this->retrieveFoldersForProcessing($focusUser); around line 800 in function getFoldersForSettings

Replace this with: $folders = $this->retrieveFoldersForProcessing($focusUser, false);

Now you (but also every user in the system) will see all mailboxes in this select control in user prerefences. BUT BE VERY CAREFUL when clicking - once mailbox is assigned(subscribed) to user it cannot be undone with the UI.

If you want to remove or add mailboxes from/to users look at table folders_subscriptions. Rember to undo that change to php file as with this change everyone could gain access to any email account (even personal).

Well, at least this allowed me to configure group email accounts.

Thank you.

I tested with the modified SugarFolders.php file and I was able to assign the groupmailboxes to some users.

I did it on my test instance.

As I don’t want to make this change into production, I did a really quick and dirty php cli script to generate the sql insert lines to copy/paste into db.

It takes the database name, the user id, the different folder ids for inbox, draft, sent and archived mail folders as parameters and echoes the sql scrip to execute into the database.

<?php
/**
*  * CLI script to echo the insert lines to copy/paste into database
*  * Parameters : 
*       * 1: databasename
*       * 2: user id from users table
*       * 3: folder id of the inbox folder (from folders table)
*       * 4: folder id of the draft folder (from folders table)
*       * 5: folder id of the Sent folder (from folders table)
*       * 6: folder id of the archived folder (from folders table)
*         */
function create_guid()
{
$microTime = microtime();
list($a_dec, $a_sec) = explode(' ', $microTime);

$dec_hex = dechex($a_dec * 1000000);
$sec_hex = dechex($a_sec);

ensure_length($dec_hex, 5);
ensure_length($sec_hex, 6);

$guid = '';
$guid .= $dec_hex;
$guid .= create_guid_section(3);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= $sec_hex;
$guid .= create_guid_section(6);

return $guid;
}

function create_guid_section($characters)
{
$return = '';
for ($i = 0; $i < $characters; ++$i) {
$return .= dechex(mt_rand(0, 15));
}

return $return;
}

function ensure_length(&$string, $length)
{
$strlen = strlen($string);
if ($strlen < $length) {
$string = str_pad($string, $length, '0');
} elseif ($strlen > $length) {
$string = substr($string, 0, $length);
}
}

$dbName = $argv[1];
$uid = $argv[2];
$guid1 = create_guid();
$folder1 = $argv[3];
$guid2 = create_guid();
$folder2 = $argv[4];
$guid3 = create_guid();
$folder3 = $argv[5];
$guid4 = create_guid();
$folder4 = $argv[6];
$startReq = 'Insert into ' . $dbName . '.folders_subscriptions (id,folder_id,assigned_user_id) values (\'';
$sep = '\',\'';
$end = '\');';
echo($startReq . $guid1 . $sep . $folder1 . $sep . $uid . $end . PHP_EOL);
echo($startReq . $guid2 . $sep . $folder2 . $sep . $uid . $end . PHP_EOL);
echo($startReq . $guid3 . $sep . $folder3 . $sep . $uid . $end . PHP_EOL);
echo($startReq . $guid4 . $sep . $folder4 . $sep . $uid . $end . PHP_EOL);

Anyway, I will have a look on the existing issues on github related to that.

There should be a way to set it through the UI.

1 Like

Has there been a resolution yet to not being able to remove folder assignment for users? My use case is a non-profit elected Board of Directors. Office holders rotate, so I need to be able to upgrade and downgrade users’ folder access.

HI @ctucker,

There was an update recently that changed how the system works. Hopefully, this should fix the functionality you need. Please try it out and let me know if you have any issues!

Hi,

I will test the last SuiteCRM version this week, I’ll keep you up-to-date, too.

1 Like

I’m already running 7.11.13. Perhaps I’m doing thing wrong, in which case a little guidance would be helpful. Thanks both.

Well, obviously, it still doesn’t work or at least we don’t know how to use it.

I made several fresh installs of suitecrm 7.11.13.

Install 1:

  • No security groups configured
  • No roles configured
  • Security suite settings unchanged

I created a group inbound mail account.

  • Then I created a new user

  • Once created I went back to his profile as an admin and went to his mail settings.

  • On the first tab (the general tab), no folders appeared

  • On the second tab, the group mail account appeared and was checked.

  • I tried unchecking it and checking it again with no luck.

    • I checked the table folders_subscriptions during my tests.
    • Unchecking and checking it again does change the table content
      • new lines appeared for my user
      • but there are less lines for my new user than for the admin user (see screenshot)

In my other installs, I tried defining a default security group in the security suite settings, It didn’t change anything.

I also tried to create a new user before creating the group mail account, it doesn’t work too, I can’t link the related folder to the user.

As @ctucker1984 said, I too keep thinking I’m doing something wrong. Is there a more complete documentation about the group inbound mail accounts ?

@Mac-Rae do you know where I can find some information about how it works or point me to the php files involved in it, even if I’m not a developper anymore (been 12 years without coding…) I still can read some code, maybe I’ll find something ?


By the way here are the file access rights set on my install :

chown -R root:root ${SUITECRM_FOLDER}

the apache user has rights on the suitecrm folder

chown www-data:www-data ${SUITECRM_FOLDER}

the apache user has rights on these folders and subfolders

chown -R www-data:www-data ${SUITECRM_FOLDER}/cache/ ${SUITECRM_FOLDER}/custom/ ${SUITECRM_FOLDER}/modules/ ${SUITECRM_FOLDER}/themes/ ${SUITECRM_FOLDER}/data/ ${SUITECRM_FOLDER}/upload/ ${SUITECRM_FOLDER}/include/ ${SUITECRM_FOLDER}/install/

chmod -R u=rwx,g=rx,o=rx “${SUITECRM_FOLDER}”

Why is this thread marked Solved? I had posted another thread on this issue last year, then tried to resurrect my coding from days past to little or no avail. As recommended here in the forums I was told to post an issue on github, which I did in great detail and it got pulled as a security risk. Go figure. This issue doesn’t exist in SugarCRM by the way.

There are 4 files that affect this issue. EmailUI.js, EmailUI.php, EmailUIAjax.php and SugarFolders.php.

At least now the “Fix” has been to just lock down the feature so it doesn’t let you keep adding mailbox folder permissions (at all).

Before 7.11.10~ish would just keep populating the folders_subscriptions table with duplicate entries every time a user visited the email settings and clicked on either the allowed folders area or the settings tab where you can (or should) be able to enable/disable group mail account access.

Hi @stratacorps, it was marked “Solved” because at that time, I had a way to do what my customer wanted.

Anyway you’re right it shouldn’t be marked as solved, but in the new version of the forum I don’t know how to change this thread’ title.

2 Likes

Hi there. Is this still not fixed, @Mac-Rae? What a pity for all this great work if the email functionality isn’t working. It spoils the show. Even the two hotfixes posted by @Marc-Alexandre and enbyted do not work in my case. The folder selection window appearing in user mail settings is completely indifferent as to whether I tick or untick the mailboxes (which do correctly get listed there on the mail accounts tab, but missing on the general tab). If I untick them and then save the user’s profile, then when I next take a look they’re still marked as checked. The admin user, when clicking on the Emails module, has a button to the right on top of the list of messages which allows to select mail accounts. That button only exists in a degenerated form without content for normal users.

No offense, but do I take this correctly that SuiteCRM is for well over one year in a state in which non-admin users can’t access the system’s inbound mail accounts?

Afaik it’s working as expected right now, I’ll see if I can take a look today and confirm which side of the fence this falls on. It may be that the email documentation needs an update which if I get the time I can take a look at.

Emails is still broken in its own ways however on the front end it should at least be functional.

I’ll let you know how I get on!

1 Like

Hey there - any news on this front?

Hello to all,
we evaluate suitecrm and came across this problem in v.7.11.18.
Searching for a solution I finally found this thread and can confirm the problem is still there as described above by Marc-Alexandre and stratcorps.
Our goal is simple:
One sales team that has access to a shared group email box sales@…
A support team that has access to a shared group email box support@… and which is using the AOP for dealing with the cases.
In addition the sales users have all a personal account.
I thought this is a common basic starter configuration, but failed to configure it.
As admin I can access any of the incomming group e-mails.
If I try to assign them (as admin) to individual users in the folder management window (select one or many and click done) . I get a confirmation “The settings have been saved”.
But just reopening the folder management window I see they are not saved.
@ Mac-Rae: That’s at least how I understand you instruction from Dec. 2019.

Please excuse my ignorance, if I asked the obvious and please give me an advice how to deal with this.
With best regards
Dieter

Yeah, there must be something wrong - I tried all sorts of things, for days, and I’m not like new to computers at any rate.