mmdf(5)
π mmdf(5) π
okay bestie, you've landed on mmdf(5) from the User Manuals section β the whole page is about the MMDF mailbox format, and yes, it's lowkey iconic π.
πΈ NAME πΈ
MMDF β Multi-channel Memorandum Distribution Facility mailbox format, periodt.
π¦ DESCRIPTION π¦
This page is the lore drop for the MMDF mailbox format: some MTAs and MUAs (i.e. scomail(1)) use it to store mail messages locally. Cute for them, honestly.
An MMDF mailbox is a text file containing an arbitrary number of e-mail messages. Each message consists of a postmark, followed by an e-mail message formatted according to RFC822 / RFC2822, followed by a postmark. The file format is line-oriented β lowkey simple, highkey charming. Lines are separated by line feed characters (ASCII 10). A postmark line consists of the four characters ^A^A^A^A (Control-A; ASCII 1). That's the separator doing its little main character moment β¨.
Example of a MMDF mailbox holding two mails:
^A^A^A^A
From: example@example.com
To: example@example.org
Subject: test
>From what I learned about the MMDF-format:
^A^A^A^A
^A^A^A^A
From: example@example.com
To: example@example.org
Subject: test 2
bar
^A^A^A^A
I'm obsessed with how the >From line just vibes there with no special meaning, iykyk.
In contrast to most other single file mailbox formats like MBOXO and MBOXRD (see mbox(5)) there is no need to quote/dequote "From "-lines in MMDF mailboxes as such lines have no special meaning in this format. Slay β no escaping drama π
.
If the modification-time (usually determined via stat(2)) of a nonempty mailbox file is greater than the access-time, the file has new mail. Many MUAs place a Status: header in each message to indicate which messages have already been read. Not me checking my inbox like π.
π LOCKING π
Since MMDF files are frequently accessed by multiple programs in parallel, MMDF files should generally not be accessed without locking. This is not a drill β lock your files, bestie.
Three different locking mechanisms (and combinations thereof) are in general use:
fcntl(2)locking β mostly used on recent, POSIX-compliant systems. Use of this locking method is, in particular, advisable if MMDF files are accessed through the Network File System (NFS), since it seems the only way to reliably invalidate NFS clients' caches. NFS besties, take notes π«Ά.flock(2)locking β mostly used on BSD-based systems. Short and sweet.- Dotlocking β used on all kinds of systems. In order to lock an MMDF file named folder, an application first creates a temporary file with a unique name in the directory in which the folder resides. The application then tries to use the
link(2)system call to create a hard link namedfolder.lockto the temporary file. The success of thelink(2)system call should be additionally verified usingstat(2)calls. If the link has succeeded, the mail folder is considered dotlocked. The temporary file can then safely be unlinked.
In order to release the lock, an application just unlinks the folder.lock file.
If multiple methods are combined, implementors should make sure to use the non-blocking variants of the fcntl(2) and flock(2) system calls in order to avoid deadlocks. Deadlocks are not cute π.
If multiple methods are combined, an MMDF file must not be considered to have been successfully locked before all individual locks were obtained. When one of the individual locking methods fails, an application should release all locks it acquired successfully, and restart the entire locking procedure from the beginning, after a suitable delay. It's giving "all or nothing" main character energy, and honestly? Respect.
The locking mechanism used on a particular system is a matter of local policy, and should be consistently used by all applications installed on the system which access MMDF files. Failure to do so may result in loss of e-mail data, and in corrupted MMDF files.
β οΈ Warning, bestie: inconsistent locking can literally eat your e-mail data and corrupt MMDF files. Stay consistent, fr fr.
β CONFORMING TO β
MMDF is not part of any currently supported standard. That's the vibe check: no standard currently supports it, periodt.
π HISTORY π
MMDF was developed at the University of Delaware by Dave Crocker. Historical icon behavior π.
π SEE ALSO π
scomail(1), fcntl(2), flock(2), link(2), stat(2), mbox(5), RFC822, RFC2822. Go read those if you're nosy like me π.
π AUTHOR π
Urs Janssen <urs@tin.org> β ngl, that's the author credit, keep it exactly like that. Author icon β¨.
xoxo, this page is brought to you by Unix, dated February 18th, 2002, and it's mmdf(5) π
β¨.
π¦ where this page comes from
- opensuse-leap 16.0: mutt 2.2.16-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mutt 2.2.16-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mutt 2.2.16-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mutt 2.2.16-160000.3.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms