root/doc/mmdf.man

Revision 3660:eadfb8bf4039, 4.1 kB (checked in by Urs Jan?en <urs@…>, 5 years ago)

mmdf(5), new mbox (5). (These changes have been sitting in my inbox
for ages, tlr.)

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