>I want to know when the users check their mailbox because, if they don't
>check, it means they don't need and then, I can remove the mailbox :) I use
>a script to check the date of the .user.cache file.

I use different methods to check if mailboxes are in use.

First, I regularly do something like:

cd /var/spool/mail
ls -lS | head
ls -lrt | head

The first ls finds mailbox hogs, the second finds abandoned mailboxes.  I
guess you may feel this doesn't accomplish your goal because the date on
the mailspool file will be recent as long as it is receiving mail even if
it is not being checked.

I also run a script that includes a line like:

grep "Stats: $1 " /var/log/maillog | tail --lines 1

which looks for the last mail check by a user, it can be very useful to
know if they are checking, if they had mail, if they are leaving it on the
server, etc.

Since we let the cache files get deleted after users check their mail, we
prefer to use the logfile to determine if a mailbox is active.  This seems
like a more robust approach and also yields some information that is very
useful in troubleshooting mail problems for users.

One more thing, beware of deleting mail accounts just because they appear
inactive, until you first check to make sure they aren't being forwarded.

Reply via email to