Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Updating mailbox files.

Posted on 1999-01-28
1
Medium Priority
?
225 Views
Last Modified: 2010-04-21
I am using AIX 3.2.5 and have a number of users who do not update their mail files.  This leaves the files filled with deleted messages which take up space.  Is there a utility that will update all mail files in a directory?  Currenly, when the var filesystem starts getting to full, I just go in and log in as whichever user has the largest mailbox and update.  This can be very time consuming though.  Any help would be appreciated.
0
Comment
Question by:lcoombes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
mliberi earned 200 total points
ID: 2009443
I'm not really sure to fully understand your question.

How is it possible that the files remains filled with DELETED messages? When you delete a message it get phisically removed from the /var/spool/mail/$user file.

When the user READ the mail message without DELETING it, mail command move the message to $HOME/mbox file.

So if you experience that the /var/spool/mail/$user file grows the problem is that the user doesn't READ the mail.

If you want to empty the incoming mail box for a given user without deleting messages you can use the following:

su - $user /tmp/readmail.ksh >/dev/null 2>&1

the command may also be automatically executed by putting it in the root's crontab file.

#!/bin/ksh
# /tmp/readmail.ksh
# move all new mail to personal $HOME/mbox file
while mail -e
do
  mail <<EOF
n
EOF
done >/dev/null 2>&1
exit


If you want to do the job for all the users do the following

for f in /var/spool/mail/*
do
  test -f "$f" || continue
  su - $f /tmp/readmail.ksh >/dev/null 2>&1
done

If users do not read their mail the next problem you'll have is that the $HOME/mbox file grows.
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

715 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