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 the maildiracl command to set up access control lists for virtual shared folders. Use the maildirmake(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's INBOX'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 πŸ“š

  1. maildirmake(1) http://www.courier-mta.org/maildirmake.html
  2. RFC 2086 http://www.rfc-editor.org/rfc/rfc2086.txt
  3. maildirkw(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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms