Link to home
Start Free TrialLog in
Avatar of palazzini
palazzini

asked on

/var/spool/mail

Greetings,

Is there a good howto on managing /var/spool/mail on a unix system someone might know about?

TIA
Avatar of ppfoong
ppfoong


It should have permission drwxrwsr-x owned by root.mail.

You should monitor the growth in file size, ie the size of mailbox of each user.

Nowadays modern email applications such as postfix and qmail support MailDir mailbox, instead of single file mailbox residing in /var/spool/mail. MailDir is more efficient and easier to manage. For example, you can set a cron job to clear out files older than n days in the Trash folder of each user.

There are a lot of ways to manage the spooling on linux. It depends on the mailing system you use.
Different programs for sendmail, exim or qmail
Avatar of palazzini

ASKER

I'm working with sendmail and would like to kow how to manually manage the mailbox.  Also if you have more than 1 user on the server is there is /var/spool/mail directory for each user or is there only 1 var/spoo/mail for the server only? I'm working at a web hosting company and this is a problem I encounter daily where the var directory is at 100% and needs to be cleaned out.  I know that the user needs to set his mail program to not leave mail on the server.

For sendmail, each user's mailbox will be a file with the username as filename inside /var/spool/mail.

Beside /var/spool/mail, you should also maintain the /var/log directory. Running logrotate with proper config will be sufficient to clean up old log entries.

So you go into each users mailbox and lets say for arguement sake that there is mail there but the user can not download to his computer.  What steps would you take so that the user can download his mail?
ASKER CERTIFIED SOLUTION
Avatar of ppfoong
ppfoong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
First of all thanks for working with me on this problem ppgoong.  Will each user have a /var/log/mail/user file?  Once inside can u tell me some of the errors I would see and how to fix them?  You seem to be very knowledgable about email.

If the user has received email before, then they would have their mbox file inside /var/spool/mail. If the user haven't received any mail, the mbox file might not be created yet. If the mbox file is deleted, and new mail arrive, a new file with same filename will be created automatically.

There are many kind of errors, such as invalid username, invalid password, network interruption (time-out or unexpected session termination), etc, etc.



[root@test mail]$ pwd
/var/spool/mail
[root@test mail]$ dir
user1 user2 jonh terry

Each users have a file in /var/spool/mail to store the content of email.

What do you want?
If you want users can download mail from /var/spool/mail/user you should setup a POP or IMAP server, and user(client ) can download mail with Mail Client Tools, such as Outlook Express, Evolution , ...

If you only want users can read their email from /var/spool/mail/user , you can use "neomail", this web based mail client can read content of mail in file in /var/spool/mail and display for user, when they login via web. This no need to setup a Pop or Imap server.

Any?