Creating a Mail Gro...
 
Notifications
Clear all

Creating a Mail Group fails with SmarterMail100 provider

1 Posts
1 Users
0 Reactions
7 Views
Posts: 21
Topic starter
(@duarte)
Eminent Member
Joined: 9 years ago

Hi,

When trying to create a Mail Group in the SolidCP Portal (Hosting Spaces > Mail > Groups > Create Mail Group), the operation fails with:
Accessed JArray values with invalid key value: "name". Int32 array index expected.

The error occurs in the GroupExists() method in SmarterMail100.cs, which is called to check if a group already exists before creating it.

Possible root cause:
Looking at the code, GroupExists() appears to use dynamic property access on the JSON response from the SmarterMail API:
if (gridinfo.name == groupNameUser)

Since the SmarterMail API returns a JArray for gridInfo, this may not work correctly with Newtonsoft.Json 13.0.x, which doesn't support dynamic member access on JArray objects.

Possible fix — replace with explicit indexer access:
if (gridinfo["name"].ToString() == groupNameUser)

I noticed that MailAliasExists() in the same file already uses this pattern (aliases["name"].ToString()), which works correctly.


Environment:

  • SolidCP v1.5.1
  • SmarterMail Build 9540+
  • Newtonsoft.Json 13.0.x

I wasn't able to compile and test the fix due to build dependency issues. Has anyone encountered this problem or can confirm?


Share: