Profile Picture

User managemnt using API

Posted By Amin_ben 3 Years Ago
You don't have permission to rate!
Author
Message
Amin_ben
General Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 51
Hello,

while testing the API to use it for User management I run into the following issues:-

- the maximum user inbox size is 4GB because UserData.Maxsize is of type "uint"
- when querying the user maximum box size it returns 0 which means unlimited which doesn't help to check the actual maximum size
- the full user name is returned as a special character, maybe some encoding is used there?

can you please help me in resolving the above issues?

Best regards,
Amin









Mike Barber
Posted 3 Years Ago
View Quick Profile
Time Traveler

Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)

Group: Administrators
Last Active: 2 Months Ago
Posts: 480, Visits: 19.4K
the maximum user inbox size is 4GB because UserData.Maxsize is of type "uint"
when querying the user maximum box size it returns 0 which means unlimited which doesn't help to check the actual maximum size

If the user does not have a limit set then 0 is the correct value that should be returned. If there is a domain limit set then you'd need to check for that after you get a 0 for the user level.

the full user name is returned as a special character, maybe some encoding is used there?

The IMail API is in an in-between two different API's right now. To access the full name you'll need to use the Framework API. Here is an example on how to do that.

Add a reference to Ipswitch.Messaging.Framework.dll

using System;
using Ipswitch.Messaging.Framework;

namespace Test
{
class Program
{
static void Main(string[] args)
{
MessagingSystem ms = new MessagingSystem();
Host host = ms.Hosts.Get("ipsaug-mbarber"); // replace this with the correct domain name
User user = host.Users.Get("admin"); // replace this with the correct User Id

Console.WriteLine(user.DisplayName);
}
}
}

I hope this helps, Let me know if you need any further advice.


Mike Barber
Senior Software Developer
Ipswitch, Inc
Amin_ben
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 51
Hi Mike,

Thank you for the answer, for my test the user had a limit set on his profile, so it shouldn't return 0 right?
also about the maximum size that can be set using the API is it 4GB or is there a way to set higher values?

Best regards,

Amin
Mike Barber
Posted 3 Years Ago
View Quick Profile
Time Traveler

Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)

Group: Administrators
Last Active: 2 Months Ago
Posts: 480, Visits: 19.4K
MaxSize is actually a ulong not a uint. The registry value where the setting is stored is a QWORD.
I just ran a test and it's returning the correct value as far as I can see. What version of IMail are you working with?


Mike Barber
Senior Software Developer
Ipswitch, Inc
Amin_ben
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 51
Hi Mike,

we are using version 12.5.0.248, the class that we use to get the user info GetUser

Best regards,
Amin
Mike Barber
Posted 3 Years Ago
View Quick Profile
Time Traveler

Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)

Group: Administrators
Last Active: 2 Months Ago
Posts: 480, Visits: 19.4K
12.5.0 should be working correctly. Double check the version of the IMailAPI_NET dll you're referencing in your project.

Also, I am still wondering about your initial statement
the maximum user inbox size is 4GB because UserData.Maxsize is of type "uint"

Is IntelliSense telling you that MaxSize on the UserData object is a UINT?

Mike Barber
Senior Software Developer
Ipswitch, Inc
Amin_ben
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 51
Hi Mike,

the API version is 11.0.60.0, and as far as I know it is the only version available, for the email size the "uint" is what IntelliSense reports, can attach a screen shot if needed
for the username I tried your suggestion but it returned an error

System.Web.Services.Protocols.SoapException:Server was unable to process request. ---> System.IO.FileNotFoundException:Could not load file or assembly
'Ipswitch.Messaging.Interop.IMailSec, Version=1.0.5456.24574,Culture=neutral, PublicKeyToken=null' or one of its dependencies. The systemcannot find the file specified.

  at IMailUpdateInboxSizeRequest.Execute()

  at EmailApiService.Execute(IMailRequest request)

  --- End of inner exception stack trace ---

is there anything that is missing? or is there any new version of the API?

Best regards,
Amin

Edited
3 Years Ago by Amin_ben
Mike Barber
Posted 3 Years Ago
View Quick Profile
Time Traveler

Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)Time Traveler (666 reputation)

Group: Administrators
Last Active: 2 Months Ago
Posts: 480, Visits: 19.4K
You should be using the API files from the version of IMail you are currently running. You said you are running IMail 12.5.0.248 so use the dll's from the install directory of IMail for that version. I'd offer to get you an exact list of all the files you'd need but it's easier to just grab all the dll's and exe's from the install dir.

Mike Barber
Senior Software Developer
Ipswitch, Inc
Amin_ben
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 51
Hi Mike,

that solved the issue thank you! we were using the files that were in the API folder

Best regards,
Amin


Similar Topics


Reading This Topic