Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I understand correctly, a spool is a temporary storage location. Traditionally, the mail is stored in a "mail spool", a mailbox in the /var/spool/mail directory, where users are expected to pick it up. Therefore, according to this view, once the mail has been read it should be deleted or moved elsewhere — most likely somewhere in the user's home directory.

This way of handling the mail doesn't seem very efficient to me. And where does a program such as procmail fit into this scheme? If you have an MDA that automatically stores your mail into folders in your home directory, then why keep a mail spool at all?

share|improve this question
2  
Spooling is discussed here: en.wikipedia.org/wiki/Spooling#Uses_and_advantages, also take a look at my A as well as Gilles to this Q: unix.stackexchange.com/questions/82910/… –  slm Aug 18 at 0:58

1 Answer 1

up vote 6 down vote accepted

With traditional unix mail clients, /var/spool/mail/$USER is the user's inbox. The emails remain there as long as the user decides not to archive the mail. Some mail clients insist on moving emails to a proprietary file, or offer the option to move emails to a different file after reading. Users can choose which mail client they use and how they configure it.

If you run an MDA such as procmail, you can set it up to deliver some emails to the system inbox, or to deliver all emails to files under your home directory (and you can call one of them your inbox if you want). It's a user choice.

Conceptually, you can think of /var/spool/mail/$USER as being a file in your home directory. It pretty much belongs to you. It's in a different location because that file needs to be available during email delivery. Users aren't allowed to create a broken symbolic link or a named pipe where the system expects a regular file, for example, which avoids potentially nasty errors in the delivery system. There are sites where the home directories are on one or more file servers and the mail spools are on a different server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.