[mod.computers.vax] mail files...

SCOTTH@GMUVAX.BITNET.UUCP (01/16/87)

Does anyone know why VMS mail sets up so many extra files?  I have 4 folders and
probably a total of 15 messages in them combined, but for some reason mail
has set up about 10 files.  Is there any way to condense these files into
one managable file?  It gets to be a pain having all of the file come up
when ever I do a directory of my home directory.

    If anyone has any ideas or sugestions please drop me a line at
BITNET ADDRESS: SCOTTH@GMUVAX.BITNET


                                           Thanks in advance,
                                           Scott Hutchinson

LEICHTER-JERRY@YALE.ARPA (01/20/87)

    Does anyone know why VMS mail sets up so many extra files?  I have 4
    folders and probably a total of 15 messages in them combined, but for some
    reason mail has set up about 10 files.

MAIL stores header information about messages, and the body of short messages
(up to maybe 2000 bytes - I'm not really sure) within MAIL.MAI which is an
indexed file.  Longer messages are stored in their own sequential files, and
MAIL.MAI contains a pointer to those files.  Folders have no effect on this
allocation; in fact, at the implementation level, there really isn't any such
thing as a "folder":  The records in the mail file have multiple keys, on of
which is the "folder name".  A folder is no more and no less than all the
records that have some common folder name field.

You seem to have MAIL.MAI plus 9 files for 15 messages, so 6 of your messages
are short enough to fit in MAIL.MAI and the other 9 are in external files.  A
DIR/FUL in MAIL will show you which ones are where.

The reason for this organization, BTW, is speed and generality, traded off
against the expense involved in storing many, many records in an indexed that
sees a lot of deletion.  If everything were stored in your MAIL.MAI file,
you'd see the "Reclaiming deleted space" message a lot more often.

					    Is there any way to condense these
    files into one managable file?

No; you cannot affect MAIL's file allocations.

				    It gets to be a pain having all of the
    file come up when ever I do a directory of my home directory.

Now, finally, we get to the real issue.  This problem is in fact easily
solved; MAIL allows you to store your mail files in a subdirectory of your
chosing.  Go into MAIL and type HELP SET MAIL_DIRECTORY for details.

Hint to other INFO-VAX writers:  You are more likely to get a useful answer
if you describe the problem YOU see - "I have too many mail files in my
login directory" - rather than wandering off into general complaints about
VMS - why all those "extra" files? - or proposing your own solutions - com-
bining everything into "one manageable file" - when there may already be a
perfectly good solution you aren't aware of.  (Reminds me of the story once
posted to the net about someone who was asked how to get EMACS to use line
numbers.  Since this was a military site, and the requestor was a high-level
officer, getting an answer to "Why do you want to do that?  What are you
trying to accomplish?" was difficult.  Eventually, it turned out that the
requestor's only previous experience was with either punch cards or BASIC,
and what he wanted to do was add lines into the middle of the text.  The way
he wanted to to this, of course, was to type them at the end of the file,
with line numbers that would cause them to migrate to where they should go!)

In this particular case, the author did (eventually) describe his real
problem.  Good thing.  Had he only asked "How do I get all my mail together
into one file", I (and others, most likely) would have told him:  "Use EXTRACT
or EXTRACT/MAIL" - a perfect solution to entirely the wrong problem.

							-- Jerry
-------

TWADE@CSVAX.UCD.HEA.IRL (01/20/87)

MAIL (since VMS 4.0) uses an ISAM structure for MAIL.MAI rather than
the older sequential format. Messages smaller than 3 blocks are stored
within this file, but for a larger message, a separate file is created
(called MAIL$horrific_number.MAI) and a pointer to it stored within MAIL.MAI.
As you delete messages within MAIL, these files disappear.

This gives greater flexibility and speed when randomly accessing messages
stored in a folder. To avoid seeing all these files, you could move them all
into a subdirectory using the MAIL command SET MAIL_DIRECTORY
	MAIL> Set MAIL_DIRECTORY [.VAXMAIL]

Tom Wade
Systems Programmer
UCD Dept Computer Science
Dublin Ireland

Ean:	twade@csvax.ucd.irl
Hea:	twade@csvax.ucd.hea.irl
Bit:	twade%csvax.ucd.hea.irl@irlearn.bitnet

Official Disclaimer:	"It wasn't me, it was an accident, and besides,
			 I wasn't there."

BRUCE@UC780.BITNET (01/23/87)

Those horiffic numbers in those mail$number.mai files I believe
are the quadword in hex showing the time the file was created.
Disclaimer.  I've never actually check this, so it may be wrong.