MAILDIRMAKE(1)
β¨ MAILDIRMAKE(1) β¨
bestie. it's giving manual page energy, and it's by S. Varshavchik. this is maildirmake from the Courier mail server, and she's here to make your maildirs and maildir folders slay. π
πΈ NAME πΈ
maildirmake β create maildirs and maildir folders. periodt. π
π¦ SYNOPSIS π¦
maildirmake [options...] {maildir}
π DESCRIPTION π
okay so the maildirmake command creates maildirs, and maildir folders, and does some routine maintenance on them. no cap. This documentation describes the maildirmake command from the Courier mail server, which creates an extended form of maildirs that implements additional extensions beyond the basic maildir properties that were first implemented in the Qmail mail server. iconic behavior, honestly. π
β¨ OPTIONS β¨
-Sβ create a "sharable" maildir. A sharable maildir has slightly different permissions which allows creation of publicly-shared folders. π«Ά-qquota β install a quota on the maildir. Seemaildirquota(7)[1]for more information. The specified maildir gets automatically created if it does not exist; otherwise the existing maildir's quota gets updated. quota may be:####Sβ Specifies the quota in the total number of bytes for all messages.β10000000Sβspecifies a quota of ten million bytes. πΎ####Cβ Specifies the quota in the total number of messages in the maildir.β10000Sβspecifies a quota of ten thousand messages. π
-ffolder β do not create a maildir, but create a folder in an existing maildir. ποΈ-Ffolder β Like the-foption, except that the folder's name is given using the system locale's character set. Non-Latin characters in the folder's name must be given to the-foption using IMAP's UTF8 encoding. The-Foption takes the folder name specified using the console's character set. π-smode β create a publicly accessible folder in an existing sharable maildir. First, use the-Soption to create a sharable maildir. Then, runmaildirmakeagain with the-soption to create publicly accessible folders. mode is a comma-separated list of the following keywords:readβ readonly folder, only you can write messages to this folderwriteβ anyone can read and write messages to this foldergroupβ only allow members of your own system group to access messages in this folder (instead of everyone)
--addname=pathname,--delname β create or delete the directories and links needed to access shared folders. See below for more information. π--checkutf8maildir maildirfilter β Perform a sanity check to verify that a pre-unicode format maildir can be converted to a unicode-format maildir. See βConverting pre-unicode format maildirsβ, below, for more information. π§--convutf8maildir maildirfilter β Convert a pre-unicode format maildir can be converted to a unicode-format maildir. See βConverting pre-unicode format maildirsβ, below, for more information. β¨
ποΈ FOLDERS ποΈ
This maildirmake command supports enhanced maildirs that contain folders. π
By itself, maildirmake makes a new subdirectory maildir, and creates all the necessary structures. The -f option creates a new "folder" within an existing maildir. maildir must already exist, and the maildirmake command will create a new folder in the maildir. no cap.
Folders are simply subdirectories inside the main maildir whose names start with a period, and which are themselves maildirs. For example, the command "maildirmake -f Drafts mail/Maildir" creates mail/Maildir/.Drafts, that has the usual tmp, new and cur. You MUST use the -f option, instead of specifying mail/Maildir/.Drafts directly, in order to correctly initialize certain enhanced maildir features. π
Folders cannot be created directly within other folders. Running maildirmake -f Urgent mail/Maildir/.Drafts will not work. Instead, the period character is designated as a hierarchy separator, run maildirmake -f Drafts.Urgent mail/Maildir instead. This creates mail/Maildir/.Drafts.Urgent, and all mail software that supports enhanced maildirs will interpret it as a subfolder Urgent of the Drafts folder. so iconic. π
π€ SHARED FOLDERS π€
This is another extension to the Maildir format that allows folders to be shared between multiple clients. π
Note The Courier IMAP server implements two types of shared folders: filesystem permission-based shared folders, as well as virtual shared folders based on IMAP access control lists. Use themaildirmakecommand to implement shared folders based on filesystem permissions. Themaildiracl(1)[2]command manages access control lists, which are used by virtual shared folders. See the Courier IMAP server documentation for more information. π
First, you need to create a collection of sharable folders, as a separate maildir:
maildirmake -S /usr/local/share/maildirs/notices
Then, create individuals folders that will be accessed in shared mode:
maildirmake -s write -f Weekly /usr/local/share/maildirs/notices
In this example, the "Weekly" folder is created, with read/write access to everyone. Multiple folders can be created in the same maildir, with different access permissions. Everyone can create a sharable maildir. The access privileges for individual folders are set by the -s option, and are implemented using traditional filesystem permissions. π«Ά
Use the --add and --del options to add a sharable maildir to an existing maildir. Client software that implements this extension will now know where to find sharable folders:
maildirmake --add notices=/usr/local/share/maildirs/notices $HOME/Maildir
$HOME/Maildir is your main maildir. The argument to -add is nick=path. nick is a nickname for this collection of sharable folders, and path is the location of the sharable maildir. All folders in the sharable maildir that you have access to -- such as "Weekly", in this case, will now be accessible. Multiple sharable maildirs can be added, by giving each one a unique nick. π₯
The --del option "disconnects" the sharable maildir from the main maildir. βοΈ
π GLOBAL SHARED FOLDERS π
Normally -add command must be run for every maildir which needs to access the sharable maildir. Alternatively the file /etc/maildirshared can be created, to specify a default set of sharable maildirs. Each line in this file takes the following format:
nick<tab>path
nick is a short nickname for the sharable maildir, <tab> is a single tab character, path is the pathname to the sharable maildir. π
π ACCESSING SHARED FOLDERS π
You may have read or write access to a shared folder. If you have write access, you can add messages to the shared folder. You can also delete messages that you've added. π
Anyone can create a sharable maildir, so if the sharable maildir is actually created by you, can can delete any message, not just your own. π
π CONVERTING PRE-UNICODE FORMAT MAILDIRS π
okay bestie, this whole section is for you if any of these apply:
- You're updating Courier-IMAP to version 5.0, and later, from prior versions of Courier-IMAP, or:
- You're updating SqWebmail to version 6.0, and later, from prior versions of SqWebmail, or:
- You're updating Courier to version 1.0, and later, from prior versions of Courier.
These versions literally got glow-ups to implement native Unicode support in several E-mail-related protocols. And ngl, it was already a known thing that updating Internet standards to use native Unicode-formatted E-mail messages was not going to be 100% backwards-compatible, in terms of E-mail client support. So given all that, this major update to Unicode also brings some backwards-incompatible changes to the internal structure of maildirs, as a major upgrade to simplify Unicode support going forward. Might as well go through the pain of a major upgrade once. π« (iconic reasoning honestly)
maildirmake's --checkutf8 and --convutf8 options are the tools to aid in conversion of existing mailboxes to the new Unicode-based naming standard.
β¨ Background β¨
Mail folders in a maildir are hidden subdirectories. For example: a folder name "Mailing list" is a maildir subdirectory named $HOME/Maildir/.Mailing list ($HOME/Maildir is the main mailbox).
Prior to the unicode update, non-English characters in folder names used a convention based on the non-standard "modified-UTF7" encoding used by IMAP. A folder named "RΓ©sumΓ©" is a maildir subdirectory named $HOME/Maildir/.R&AOk-sum&AOk-. The current versions of Courier, Courier-IMAP, and SqWebmail, now creates $HOME/Maildir/.RΓ©sumΓ© using the UTF8 encoding. This appears as plain .RΓ©sumΓ© (hidden) subdirectory on modern UTF8-based systems. slay π
Consequently, any existing maildirs with folders that use non-English names must be converted as part of updating to the current version of Courier, Courier-IMAP, and SqWebmail from pre-unicode versions. This does not happen automatically when updating to the current version. This must be done manually given the wide variety of individual mail server configurations that are possible. no autopilot here, bestie β you're driving. π
π Unicode conversion overview π
Updating from pre-unicode versions involves:
- Renaming the actual maildir folders,
$HOME/Maildir/.namesinto unicode names (using UTF8). - Updating the
$HOME/Maildir/courierimapsubscribedfile, which is a list of subscribed IMAP folders, if it exists. - Updating any maildrop mail filtering recipes,
$HOME/.mailfilter, if it exists, to reference the unicode maildir folders; or updating any custom site mail filtering engine that delivers to maildir folders, to reference the correct subdirectory names.
π¦ Unicode conversion steps π¦
The --checkutf8 and --convutf8 options to maildirmake convert a single maildir to the new unicode format:
$ ./maildirmake --checkutf8 ~/Maildir ~/.mailfilter
Checking /home/mrsam/Maildir:
Mail filter to INBOX.R&AOk-sum&AOk- updated to INBOX.RΓ©sumΓ©
Subscription to INBOX.R&AOk-sum&AOk- changed to INBOX.RΓ©sumΓ©
Rename INBOX.R&AOk-sum&AOk- to INBOX.RΓ©sumΓ©
Verified /home/mrsam/Maildir/courierimapsubscribed
Verified /home/mrsam/.mailfilter
$ ./maildirmake --convutf8 ~/Maildir ~/.mailfilter
Checking /home/mrsam/Maildir:
Mail filter to INBOX.R&AOk-sum&AOk- updated to INBOX.RΓ©sumΓ©
Subscription to INBOX.R&AOk-sum&AOk- changed to INBOX.RΓ©sumΓ©
Rename INBOX.R&AOk-sum&AOk- to INBOX.RΓ©sumΓ©
Updating /home/mrsam/Maildir/courierimapsubscribed
Updating /home/mrsam/.mailfilter
--checkutf8 goes through the motions of converting a single maildir to Unicode, but without making any actual changes. --convutf8 does the conversion for real. The first required parameter is the maildir to convert. The second parameter is optional, and specifies the corresponding maildrop filtering recipe, but only if SqWebMail generates the mail filtering recipes. SqWebMail's mail filtering recipes are parsable, and can be automatically-converted. Non-SqWebMail-generated .mailfilters cannot be converted automatically. The second parameter must be omitted, and the mail filtering recipe must be converted by hand. π
Note All this work is only needed if maildirs have folders with non-English names. Ignore everything you've just read if all folder names are English-only.--checkutf8and--convutf8will not do anything, and nothing needs to be done. π (love that for you honestly)
To convert all mailboxes to Unicode all at once:
- A shell script needs to run the
--checkutf8option for every mailbox. A list of all accounts' maildirs needs to be prepared in advance, together with the corresponding.mailfilters(where appropriate). courier-authlib'sauthenumeratecommand is usually a good starting point. It's ok to explicitly specify each mailbox's.mailfilter, when using SqWebMail even if a particular mailbox does not use it. It will be ignored. The list of all accounts' maildirs gets converted to a shell script that runsmaildirmakewith the--checkutf8option. The script should report any maildir whose--checkutf8option reports an error, andmaildirmakeexits with a non-zero status.
It is safe to run --checkutf8 without shutting down your mail server. A non-zero exit from --checkutf8 indicates a problem (see below) for a particular maildir.
- Once
--checkutf8does not find any problems with any mailbox, shut down the mail server, run--checkutf8one more time for all mailboxes, then if everything goes well, upgrade Courier, Courier-IMAP, or SqWebMail and run--convutf8on every mailbox before restarting the server.
Note--convutf8is a one-shot deal. Do not run--convutf8a second time after it successfully converted a maildir. In nearly all cases nothing will happen, but there are rare edge cases where some folder names may get garbled, or it fails completely. π
π Resolving unicode conversion problems π
The only likely problems that might be encountered is the fall-out from buggy IMAP clients that did not follow the pre-Unicode naming convention for non-Latin folder names. The customized IMAP "modified-UTF7" encoding convention for non-Latin folder names is mostly an IMAP client convention, and the pre-Unicode version of Courier-IMAP did not enforce it. The server took the name from the IMAP client, as is.
Unicode conversion (--checkutf8 or --convutf8) fails if it finds a folder name that does not correctly use IMAP's "modified-UTF7" encoding. This can only be resolved manually, by renaming the folder. This may also involve manually editing courierimapsubscribed and .mailfilter if they exist. The bad folder name should be removed from courierimapsubscribed. For .mailfilter it is sufficient to remove only the comments that precede the actual maildrop rule, and --convutf8 will remove the entire rule, by itself. --convutf8 actually reads only the machine-parsable comments in SqWebMail-generated .mailfilter (plus a few other things in the file), and replaces the .mailfilter with the Unicode version based solely on the parsed data.
π After the Unicode conversion π
The current, Unicode version of Courier-IMAP supports both Unicode and non-Unicode IMAP clients; however unlike the pre-Unicode version, Courier-IMAP rejects requests from non-Unicode IMAP clients to use or create folders that are not properly encoded.
Encountering a bad folder during conversion strongly suggests the presence of an IMAP client that does not correctly encode non-English folder names. Such an IMAP client will likely have problems after the conversion. β¨
β SEE ALSO β
maildir(5)[3], maildiracl(1)[2], maildirkw(1)[4], maildirwatch(1)[5], maildrop(1)[6], maildirquota(7)[1], deliverquota(8)[7], maildropfilter(7)[8].
πΈ AUTHOR πΈ
Sam Varshavchik
- Author
π NOTES π
http://www.courier-mta.org/maildirquota.html
http://www.courier-mta.org/maildiracl.html
http://www.courier-mta.org/maildir.html
http://www.courier-mta.org/maildirkw.html
http://www.courier-mta.org/maildirwatch.html
http://www.courier-mta.org/maildrop.html
http://www.courier-mta.org/deliverquota.html
http://www.courier-mta.org/maildropfilter.html
and that's a wrap bestie!! π«Ά this page came from the <strong>Courier Mail Server</strong>, dated <strong>01/10/2026</strong>, and it lives under the name <strong>MAILDIRMAKE(1)</strong>. go convert those folders, you absolute icon π β¨
π¦ where this page comes from
- ubuntu stonking: maildrop 4.0.4-1 Β· GPL-3~with-OpenSSL-exception
- Copyright 1998 - 2018 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