[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

/var/spool/mail

Posted on 2006-04-13
9
Medium Priority
?
1,381 Views
Last Modified: 2013-11-18
Greetings,

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

TIA
0
Comment
Question by:palazzini
9 Comments
 
LVL 14

Expert Comment

by:ppfoong
ID: 16451174

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
 
LVL 10

Expert Comment

by:Nellios
ID: 16452117
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
 
LVL 2

Author Comment

by:palazzini
ID: 16454039
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:ppfoong
ID: 16454069

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
 
LVL 2

Author Comment

by:palazzini
ID: 16454114
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
 
LVL 14

Accepted Solution

by:
ppfoong earned 2000 total points
ID: 16454150

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
 
LVL 2

Author Comment

by:palazzini
ID: 16454609
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
 
LVL 14

Expert Comment

by:ppfoong
ID: 16454704

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
 
LVL 1

Expert Comment

by:Kien Kennedy
ID: 16464741
[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

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question