MAILDIRACL(1)
π MAILDIRACL β okay bestie, let's talk access control lists π
Hi hi! This is maildiracl, section 1 of the manual, written by S. Varshavchik, and it's the little tool that manages access control lists for your maildir folders. Strap in, it's giving sysadmin main character energy. β¨
πΈ SYNOPSIS πΈ
Like, the shapes it comes in:
maildiracl {-reset} {maildir}
maildiracl {-list} {maildir} {INBOX[.folder]}
maildiracl {-set} {maildir} {INBOX[.folder]} {[-]identifier}
{[+/-]rights}
maildiracl {-delete} {maildir} {INBOX[.folder]} {[-]identifier}
maildiracl {-compute} {maildir} {INBOX[.folder]} {identifier...}
β¨ DESCRIPTION β¨
So maildiracl manages "access control lists" (ACLs, bestie, we abbreviate everything) for the Courier IMAP server's maildir folders. And what are ACLs for, you ask? They're used primarily to give you fine-grained control over who can access virtual shared folders via IMAP. No cap. π
Note π«Ά The Courier IMAP server server implements two types of shared folders: filesystem permission-based shared folders, and virtual shared folders based on IMAP access control lists. Use themaildiraclcommand to set up access control lists for virtual shared folders. Use themaildirmake(1)[1] command to implement shared folders based on filesystem permissions. See the Courier IMAP server documentation for additional info on setting up virtual shared folders.
π ACL overview π
ACLs are the fine-grained mechanism for controlling access to shared folders. Lowkey iconic. You can say stuff like: user1 may only open and read messages in the folder, while user2 can also delete messages and create subfolders. Different vibes for different users. π
Every single folder maintains its own individual access control list that specifies who can do what to that folder. An ACL is a list of βidentifierβ and βrightsβ pairs. Each pair means the entity called βidentifierβ (using the UTF-8 character set, always) is allowed to do βrightsβ on this folder.
And βrightsβ is one or more letters, where each letter is a whole action:
aβ identifier may modify this folder's ACLs. (admin energy π)cβ identifier may create subfolders of this folder. This includes renaming another folder as this folder's subfolders, fr fr.eβ identifier may remove deleted messages from this folder. (expunge, bestie β¨)iβ identifier may add messages to this folder, whether that's uploading them one by one or copying messages from another folder.lβ identifier may actually see that this folder exists. Like, look right at it. If identifier doesn't have the βlβ right on this folder, the folder is effectively invisible to them. Ghosted. π»rβ identifier may open this folder. Careful though: if identifier knows the name of this folder, it can open it even without the βlβ right on it. Sneaky. πsβ identifier may mark messages in this folder as seen, or unseen.tβ identifier may mark messages in this folder as deleted, or undeleted.wβ identifier may change other status flags of messages in this folder. May also add or remove custom keywords on individual messages.xβ identifier may delete this folder, which includes renaming this folder as another mailbox's subfoler.
π Negative rights π
An ACL entry of β-identifierβ and βrightsβ is called a βnegative rightβ, and what it does is explicitly remove βrightsβ from βidentifierβ. Usually more than one βidentifierβ gets used to figure out the actual rights someone has on a given folder. The actual access rights = take all the rights from all applicable identifiers, then subtract any negative rights, as explained in the next bit. Periodt.
π§ Identifiers π§
Access rights on a given folder are computed by obtaining the rights on the following identifiers, then subtracting the negative rights on those same identifiers:
ownerβ the owner of the maildir containing this folder. The maildir'sINBOX's ACL defaults to all rights for its owner. A new folder's ACL is the same as its parent's ACL. And in all cases, trying to remove the βaβ right from the owner β either directly or using a negative right β results in an error. Don't even try it. πanyoneβ this identifier refers literally to every userid. Ever. The associated rights (or negative rights) are always used.anonymousβ this is a synonym for βanyoneβ.user=loginidβ rights (or negative rights) for the IMAP account βloginidβ.
Note π βloginidβ is what's logged to syslog after a succesful login. In some situations βloginidβ is not exactly the actual login ID used by the IMAP client. Just so u know.
group=nameβ rights (or negative rights) for account group βnameβ. Access rights get granted to an account group as a whole. The account options feature of the Courier Authentication Library specifies which account belongs to which account group. See courier-authlib's documentation for more info.administratorsβ this is an alias for βgroup=administratorsβ. Accounts that are members of an account group called βadministratorsβ are considered administrative accounts, and automatically receive all access rights on all accessible folders. The ultimate power move. π
Consider the following access control list:
owner aceilrstwx
anyone lr
user=john w
-user=mary r
administrators aceilrstwx
This access control list specifies that the folder's owner has complete control over the mailbox (as do the administrators, who have complete access to every folder); everyone else can see it and open it β except for βmaryβ, who can see that the mailbox exists but can't open it; and additionally βjohnβ can change the status and keywords of individual messages, but not mark them as deleted/undeleted or seen/unseen, because that needs extra rights. Sucks to be john, tbh. π
π OPTIONS π
maildiracl -reset maildir
This command resets access control lists in maildir, which is a path to a maildir. Under certain conditions, the files where a folder's ACLs are saved may keep existing even after the folder is removed. Weird, right? The -reset option goes through maildir and removes all those stale ACL files for removed folders. Cleanup era. π§Ήβ¨
Note π«Ά The Courier IMAP server normally performs this maintenance function automatically. It is not necessary to run this command under normal conditions. So like, chill.
maildiracl -list maildir folder
This command lists the access control lists set for folder. And folder must be either βINBOXβ or βINBOX.folder.subfolderβ, which is the same naming convention the Courier IMAP server uses. Keep it consistent bestie.
maildiracl -set maildir folder identifier rights
Puts identifier (which may begin with a minus sign to specify a negative right) and rights in folder's access control list. Existing rights for identifier (or identifier) get replaced by rights β unless βrightsβ begins with β+β or β-β, in which case it modifies the existing rights by adding or removing from them accordingly.
Some examples for u:
maildiracl -set /home/user1/Maildir INBOX.Sent user=john lr
maildiracl -set /home/user2/Maildir INBOX.Notes anyone -r
maildiracl -set /home/user3/Maildir INBOX.Private -user=tom +r
Note π Observe that the last command revokes the βrβ right from βtomβ, by adding it as a negative right. Sneaky but correct.
maildiracl -delete maildir folder identifier
This command removes identifier from folder's access control list, if it exists. Use β-identifierβ to remove negative rights.
maildiracl -compute maildir folder [identifier]+
This command takes a list of one or more identifiers. All access rights for the identifiers get combined together, then any appropriate negative rights are removed, and the result is printed on standard output. Slay.
Use the following procedure to compute access rights the exact same way the Courier IMAP server computes them:
maildiracl -compute /home/tom46/Maildir INBOX.Sent owner user=tom46
This command computes the access rights βtom46β has on his own folder.
maildiracl -compute /home/john34/Maildir INBOX.Public user=tom46
This command computes the access rights βtom46β has on βjohn34β's folder. Nosy but legal. π
π IRREVOCABLE ACCESS RIGHTS π
The owner of the mailbox must always have the βaβ and βlβ access rights. The administrators group must always have all access rights to all folders. Attempts to set access control lists that don't include these minimum access rights will be rejected. Non-negotiable, bestie.
π BUGS π
- All identifiers are specified using the UTF-8 character set.
- All non-Latin letters in folder names are specified using the modified-UTF7 coding as used in IMAP.
- This implementation of access control lists is based on version 2 (or βACL2β) of IMAP access control lists, which is a work-in-progress. The existing IMAP ACL,
RFC 2086[2], is transparently implemented inside the ACL2 model. - If history's of any guidance, ACL2 is subject to change at any time. Be sure to check the release notes when upgrading to a newer version of this software. The βACL overviewβ portion of this manual page is a very brief summary of ACL2, which leaves out optional parts of ACL2 that are not implemented. So like, don't @ me.
π SEE ALSO π
maildirmake(1)[1], maildirkw(1)[3]
π AUTHOR π
Sam Varshavchik
- Author
π NOTES π
maildirmake(1)http://www.courier-mta.org/maildirmake.htmlRFC 2086http://www.rfc-editor.org/rfc/rfc2086.txtmaildirkw(1)http://www.courier-mta.org/maildirkw.html
And that's the whole thing, bestie π this page came from Courier Mail Server and it's dated 01/10/2026. Go forth and ACL responsibly. πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: courier-base 2.0.6-1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 2003-2009 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms