Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
mbox(5)
Edit
PageHistory
Diff
Info
LikePages
mbox !!!mbox NAME DESCRIPTION LOCKING FILES SEE ALSO AUTHOR HISTORY ---- !!NAME mbox - Format for mail message storage. !!DESCRIPTION This document describes the format traditionally used by Unix hosts to store mail messages locally. __mbox__ files typically reside in the system's mail spool, under various names in users' __Mail__ directories, and under the name __mbox__ in users' home directories. An __mbox__ 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 RFC 822. The file format is line-oriented. Lines are separated by line feed characters (ASCII 10). A postmark line consists of the four characters addrspec__ as defined in appendix D of RFC 822. The date is expected to be formatted according to the following syntax (represented in the augmented Backus-Naur formalism used by RFC 822): For compatibility reasons with legacy software, two-digit years greater than or equal to 70 should be interpreted as the years 1970+, while two-digit years less than 70 should be interpreted as the years 2000-2069. Software reading files in this format should also be prepared to accept non-numeric timezone information such as Example: From roessler@does-not-exist.org Fri Jun 23 02:56:55 2000 In order to avoid mis-interpretation of lines in message bodies which begin with the four characters !!LOCKING Since __mbox__ files are frequently accessed by multiple programs in parallel, __mbox__ files should generally not be accessed without locking. Three different locking mechanisms (and combinations thereof) are in general use: fcntl(2) locking is mostly used on recent, POSIX-compliant systems. Use of this locking method is, in particular, advisable if __mbox__ files are accessed through the Network File System (NFS), since it seems the only way to reliably invalidate NFS clients' caches. flock(2) locking is mostly used on BSD-based systems. Dotlocking is used on all kinds of systems. In order to lock an __mbox__ 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 named ''folder''__.lock__ to the temporary file. The success of the link(2) system call should be additionally verified using stat(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) sytem calls in order to avoid deadlocks. If multiple methods are combined, an __mbox__ 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. 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 __mbox__ files. Failure to do so may result in loss of e-mail data, and in corrupted __mbox__ files. !!FILES /var/spool/mail/''user'' ''user'''s incoming mail folder. ~''user''/mbox ''user'''s archived mail messages, in his home directory. ~''user''/Mail/ A directory in ''user'''s home directory which is commonly used to hold __mbox__ format folders. !!SEE ALSO elm(1), fcntl(2), flock(2), link(2), local(8), mail(1), maildir(5), mail.local(8), mutt(1), mutt_dotlock(1), pine(1), procmail(1), sendmail(8) D. Crocker, Standard for the format of ARPA Internet text messages, RFC 822 M. R. Horton, UUCP mail interchange format standard, RFC 976 !!AUTHOR The present document was written by Thomas Roessler !!HISTORY The __mbox__ format occured in Version 6 AT __ A variant of this format was documented in RFC 976. ----
3 pages link to
mbox(5)
:
mutt(1)
muttrc(5)
Man5m
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.