IMAPFolderPermission object


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.


Account Account
 Gets the account referenced by this permission.
Group Group
 Gets the group referenced by this permission.
long ID
 The unique database identifier for the ACL permission.
bool Permission(eACLPermission iType)
 ACL permission
long PermissionAccountID
 The identifier of the account this ACL permission is connected to.
long PermissionGroupID
 The identifier of the group this ACL permission is connected to.
eACLPermissionType PermissionType
 The type of object this ACL permission is connected to.
long ShareFolderID
 The folder which has been shared (read-only)
long Value
 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 ''.

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()
    with oPermission
        .PermissionAccountID = oApp.Domains.ItemByName("").accounts.ItemByAddress(").id
        .value = 16
    end with



Search documentation