The IMAPFolderPermission represents a single permission attached to an IMAP folder.
Deletes the object from the database.
Saves changes of the object in the database.
Gets the account referenced by this permission.
Gets the group referenced by this permission.
The unique database identifier for the ACL permission.
bool Permission(eACLPermission iType)
The identifier of the account this ACL permission is connected to.
The identifier of the group this ACL permission is connected to.
The type of object this ACL permission is connected to.
The folder which has been shared (read-only)
The ACL permission value.
ACL permission value
The ACL Permission values for the public IMAP folders is as follows
Lookup = 1
Read = 2
Keep seen flag = 4
Keep other flags = 8
Insert Mail = 16
Create Mailbox = 64
Delete Mailbox = 128
Keep deleted flag = 256
Expunge = 512
Administer = 1024
The way this works.
If you want say 'Insert mail' and 'keep deleted flag' (this allows deletion) then you would set a value of 16+ 256 = 272
If you want everything except 'delete mailbox' you would set a value of 1+2+4+8+16+64+256+512+1024 = 1887
Code below sets 'Insert mail' permissions ONLY for public IMAP folder 'Another Subfolder' to the user 'firstname.lastname@example.org'.
Please note that if you want 'read' permissions for a subfolder, you will also need to provide 'read' permissions to parent folder(s).
Dim oApp, oPermission, oPublicFolder
Set oApp = CreateObject("hMailServer.Application")
Call oApp.Authenticate("Administrator", "Secret_Password")
'set Public Folder
set oPublicFolder = oApp.settings.Publicfolders.ItemByName("Main Folder").subfolders.itemByName("Subfolder").subfolders.add("Another Subfolder")
set oPermission = oPublicFolder.permissions.add()
.PermissionAccountID = oApp.Domains.ItemByName("domain.com").accounts.ItemByAddress(email@example.com").id
.value = 16