Next: Rmail Files Prev: Rmail Deletion Up: Rmail
Rmail Files and Inboxes
Unix places incoming mail for you in a file that we call your
"inbox". When you start up Rmail, it copies the new messages from your
inbox into your primary mail file, an Rmail file, which also contains
other messages saved from previous Rmail sessions. It is in this file
that you actually read the mail with Rmail. This operation is called
"getting new mail". It can be repeated at any time using the `g' key
in Rmail. The inbox file name is `/usr/spool/mail/USERNAME' on some
systems (typically Berkeley-derived ones) and `/usr/mail/USERNAME' on
There are three reason for having separate Rmail files and inboxes.
1. The inbox file format varies between operating systems and
according to the other mail software in use. Only one part of
Rmail needs to know about the alternatives, and it need only
understand how to convert all of them to Rmail's own format.
2. The inbox file format usually doesn't provide a place for all the
information that Rmail records.
3. It is very cumbersome to access an inbox file without danger of
losing mail, because it is necessary to interlock with mail
delivery. Moreover, different operating systems use different
interlocking techniques. The strategy of moving mail out of the
inbox once and for all into a separate Rmail file avoids the need
for interlocking in all the rest of Rmail, since only Rmail
operates on the Rmail file.
When getting new mail, Rmail first copies the new mail from the inbox
file to the Rmail file; then it saves the Rmail file; then it truncates
the inbox file. This way, a system crash may cause duplication of mail
between the inbox and the Rmail file, but cannot lose mail.
Copying mail from an inbox in the system's mailer directory actually
puts it in an intermediate file `~/.newmail'. This is because the
interlocking is done by a C program that copies to another file.
`~/.newmail' is deleted after mail merging is successful. If there is
a crash at the wrong time, this file continues to exist and will be
used as an inbox the next time you get new mail.
automatically generated by info2www