/var/spool/mail

Greetings,

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

TIA
LVL 2
palazziniAsked:
Who is Participating?
 
ppfoongCommented:

You should check the log generated by your pop3/imap server to find out why the user cannot download the mail. It should be inside /var/log/mail.

You can send the mail file of the user to him/her, but then the user will need to use special tools to read the mbox file. That's why MailDir is a better option, each email is one single file. However, MailDir not supported by sendmail, yet.





0
 
ppfoongCommented:

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.

0
 
NelliosCommented:
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
palazziniAuthor Commented:
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.
0
 
ppfoongCommented:

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.

0
 
palazziniAuthor Commented:
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?
0
 
palazziniAuthor Commented:
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.
0
 
ppfoongCommented:

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.



0
 
Kien KennedyCommented:
[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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.