In-reply-to: Raffaele Calogero's message of "Thu, 27 Jun 96 18:28:01 BST."
I have taken the liberty of replying to the list, since I suspect this is a
question of general interest, and the facility exists as part of the base
Digital UNIX product.
Raffaele Calogero asked:
> I have a dec alpha 400 running osf/1 v 3.2. During the last year the number of
> mail users increased a lot and the new mail messages are stored by the mailx
> program in the directory /usr/var/spool/mail.
> A lot of the users are subscribers of mailing lists producing a lot of
> daily messages therefore the amount of messages stored in the
> /usr/var/spool/mail is growing up rapidly. I have only 80 MB left in the usr
> file system and I am afraid that during the summer holidays I can run out
> of space due to the mail messages.
>
> I would like to know if it is possible to push the mailx program to deliver the
> new messages directly in the directory of each user
> or
> if it is possible to link the /usr/var/spool/mail to an other directory in
> a larger file system
Yes, you can link /usr/var/spool to a directory in another file system, and
you could just move /usr/var/spool/mail if that's all you wanted to move.
It is even an installation option to make the whole /var hierarchy live in
a disk partition of its own instead of in /usr.
Alternatively, you can cause the mail system to deliver each user's mail
into a user-owned directory instead of into /usr/var/spool/mail. This is
particularly useful when you want to have the users mount only their home
directory on a local workstation, and not have all of the mail server's
/usr/var/spool/mail mounted.
To do this, you need to install the MH (Mail Handler) software package, a
part of the base distribution.
In each user directory, set up the .forward file to contain this text:
"|/usr/lib/mh/slocal -user USER"
where "USER" is the user's login name (e.g., "tpb" for me).
Then, you need to set up a .maildelivery file for the user. The key line in
this file is this:
default - > ? Mail/newmail
It's possible to have other lines that specify other things that the slocal
program should do.
Then, the user needs to set up their MAIL environment variable to point to
the real mail drop.
Works like a charm. Of course, you'd want to have a shell script go around
to the user directories and set this up, and it doesn't solve the problem of
getting new accounts set up this way "automagically" nor does it move the
old mail from /usr/var/spool/mail, and sometimes mail winds up there if the
user directory with the .forward isn't accessible when the mail is delivered
(e.g., if the mail daemon starts before all the file systems are mounted, or
if the mail comes in on a system that doesn't happen to have the user's home
directory accessible due to NFS problems, etc.).
There are, of course, other ways to accomplish the same thing, but this one
is part of the base system and fully supported (we use it all the time here
in UNIX engineering).
Tom
Dr. Thomas P. Blinn, UNIX Software Group, Digital Equipment Corporation
110 Spit Brook Road, MS ZKO3-2/U20 Nashua, New Hampshire 03062-2698
Technology Partnership Engineering Phone: (603) 881-0646
Internet: tpb_at_zk3.dec.com Digital's Easynet: alpha::tpb
Worry kills more people than work because more people worry than work.
My favorite palindrome is: Satan, oscillate my metallic sonatas.
-- Phil Agre, pagre_at_ucsd.edu
Opinions expressed herein are my own, and do not necessarily represent
those of my employer or anyone else, living or dead, real or imagined.
Received on Thu Jun 27 1996 - 21:51:29 NZST