1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
.\" Project : tin
.\" Module : mmdf.5
.\" Author : U. Janssen
.\" Created : 2002-02-18
.\" Updated :
.\" Notes : needs a lot of work
.\"
.TH mmdf 5 "February 18th, 2002" "Unix" "User Manuals"
.\"
.SH NAME
MMDF \- Multi\-channel Memorandum Distribution Facility mailbox format
.\"
.SH DESCRIPTION
This document describes the
.B MMDF
mailbox format used by some MTAs and MUAs (i.e.
.BR scomail (1))
to store mail messages locally.
.PP
An
.B 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 \fBRFC822\fP / \fBRFC2822\fP, followed by a postmark. The file
format is line-oriented. 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).
.TP
Example of a \fBMMDF\fP mailbox holding two mails:
.RS
.nf
.sp
^A^A^A^A
.br
From: example@example.com
.br
To: example@example.org
.br
Subject: test
.br
.sp
.br
>From what I learned about the MMDF-format:
.br
.br
^A^A^A^A
.br
^A^A^A^A
.br
From: example@example.com
.br
To: example@example.org
.br
Subject: test 2
.br
.sp
.br
bar
.br
^A^A^A^A
.fi
.RE
.PP
In contrast to most other single file mailbox formats like
MBOXO and MBOXRD (see
.BR mbox (5))
there is no need to quote/dequote "From "\-lines in
.B MMDF
mailboxes as such lines have no special meaning in this format.
.PP
If the modification-time (usually determined via
.BR 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.
.\"
.SH LOCKING
Since
.B MMDF
files are frequently accessed by multiple programs in parallel,
.B MMDF
files should generally not be accessed without locking.
.PP
Three different locking mechanisms (and combinations thereof) are in
general use:
.IP "\(bu"
.BR fcntl (2)
locking is mostly used on recent, POSIX-compliant systems. Use of
this locking method is, in particular, advisable if
.B MMDF
files are accessed through the Network File System (NFS), since it
seems the only way to reliably invalidate NFS clients' caches.
.IP "\(bu"
.BR flock (2)
locking is mostly used on BSD-based systems.
.IP "\(bu"
Dotlocking is used on all kinds of systems. In order to lock an
.B MMDF
file named \fIfolder\fR, an application first creates a temporary file
with a unique name in the directory in which the
\fIfolder\fR resides. The application then tries to use the
.BR link (2)
system call to create a hard link named \fIfolder.lock\fR
to the temporary file. The success of the
.BR link (2)
system call should be additionally verified using
.BR stat (2)
calls. If the link has succeeded, the mail folder is considered
dotlocked. The temporary file can then safely be unlinked.
.IP ""
In order to release the lock, an application just unlinks the
\fIfolder.lock\fR file.
.PP
If multiple methods are combined, implementors should make sure to
use the non-blocking variants of the
.BR fcntl (2)
and
.BR flock (2)
system calls in order to avoid deadlocks.
.PP
If multiple methods are combined, an
.B 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.
.PP
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
.B MMDF
files. Failure to do so may result in loss of e-mail data, and in
corrupted
.B MMDF
files.
.\"
.\" .SH FILES
.\" /usr/spool/mmdf/lock/home
.\" $HOME/Mail/
.\"
.\" .SH SECURITY
.\"
.SH "CONFORMING TO"
.B MMDF
is not part of any currently supported standard.
.\"
.SH HISTORY
.B MMDF
was developed at the University of Delaware by Dave Crocker.
.\"
.SH "SEE ALSO"
.BR scomail (1),
.BR fcntl (2),
.BR flock (2),
.BR link (2),
.BR stat (2),
.BR mbox (5),
.BR RFC822 ,
.BR RFC2822
.SH AUTHOR
Urs Janssen <urs@tin.org>
|