Default mail folder for new user
-
Hello everyone. Please help me. Creating a user via the XML API. The default mail folder is created in d:\MDaemon\Data\Domain\Users\.
Through the web interface, the user folder is created in d:\MDaemon\Users\Domain\.
I need the folder to be created using the API in the same way - d:\MDaemon\Users\Domain\. Any ideas?
<?xml version="1.0" encoding="utf-8"?> <MDaemon> <API productversion="23.5.0" serviceversion="23.5.0.2"> <Request version="23.5" echo="1" verbose="0"> <Operation>CreateUser</Operation> <Parameters> <Domain>{mail_domain}</Domain> <Mailbox>{mail_name}</Mailbox> <Details> <Frozen>No</Frozen> <Disabled>No</Disabled> <MustChangepassword>No</MustChangepassword> <DontExpirePassword>Yes</DontExpirePassword> <Password>{mail_password}</Password> <FullName>{full_name}</FullName> <Suffix><![CDATA[]]></Suffix> </Details> <Permissions> <EditPassword>Yes</EditPassword> <AccessWorldClient>Yes</AccessWorldClient> </Permissions> <Quotas> <ApplyQuotas>Yes</ApplyQuotas> <MaxMessageCount>1000</MaxMessageCount> <MaxDiskSpace>500000</MaxDiskSpace> </Quotas> </Parameters> </Request> <Response version="23.5" et="1.563126"> <Status id="0" value="0x00000000" message="The operation completed successfully."/> </Response> </API> </MDaemon>
-
Keith StaffEvgeniy,Two possible means of accomplishing this ...1. Update the New Account Templace so that RootMailPath=d:\MDaemon\Users\$DOMAIN$\$MAILBOX$\or...2. For that domain, issue an UpdateDomain operation with the Parameters node as follows...
<Parameters> <Domain>{SelectedDomainNameHere}</Domain> <Users> <MailboxRoot>d:\MDaemon\Users\{SelectedDomainNameHere}</MailboxRoot> </Users> </Parameters>
-
Keith Staff
BTW, Regarding option 2 above.
Once you issue that UpdateDomain request, any new users for that domain created via the XML API will be created under the path that you specified.
Generally, we recommend using the New Account Template (option 1). However, on large servers where domains/accounts might occupy several drives or network shares, setting the Domain MailboxRoot value allows for segregation of those domains to different locations.
-
Hello, Keith. In the "Create accounts" template, the path is specified correctly, such as I need. But it is not taken into account when creating using the API
-
Keith Staff
Evgeniy,
On MgmtWS.ini (in the Data Directory), are there any [_Domain:*] sections? If so, what are their contents?
I'm going to run some tests here and see what it yields...
-
Keith Staff
Evgeniy,
If I don't have the MailboxRoot= Entry [_Domain:sample.int] in my MgmtWS.ini, then, in my testing shows that the API is correctly retrieving the path from the New Account Template.
I noticed that you are using a locaized build. I am checking to see if there is something that needs to be done as far as non-English builds.
By Default, it looks for a section in AccountTemplates.dat entitled. "New Accounts"
-
Keith Staff
Evgeniy,
I found what I needed. MDaemon Version 24.5 will support MDaemon INI's [Special] NewAccountTemplateName= value.
For now, use the UpdateDomain operation and set the MailboxRoot as I documented above.
-
Thanks, Keith. Option 2 works in my case.
-
Keith Staff
Excellent, glad to hear it.
As I said, MDaemon v24.5 will support the Non-Default New Account Template name. I"ve already written and tested the code and it works as expected.