Ref: 17350005
Title: Message and Attachment Numbering in 3+Mail
date: 12/31/90

Copyright 3Com Corporation, 1991.  All rights reserved.

This article describes the extension numbering scheme for messages and
attachments generated by 3+Mail and provides an overview of the mail
distribution process.  (The process of forwarding envelopes from the sender's
Mail Server to a destination Mail Server is NOT covered in this article.)


Background Information

When a user sends a message, with or without attachments, from a workstation
running 3+Mail, Mail parses the To: and cc: line of the message, polling
Name service on a person-by-person basis, and expanding Group names as
necessary to determine destination Mail Servers, their Network Numbers and
Ethernet addresses.

For each destination Mail Server, client-side Mail creates an envelope
consisting of the destination Mail Server's three-part name and Ethernet
address, the source Mail Server three-part name and Ethernet address, the
well-known Mail socket number 0463, the sender's three-part name, and the
recipients' three-part names.  These envelopes are then sent to the sender's
Mail Server, along with the message and any attachments.  Server-side Mail
service continues the distribution process (described in the following
paragraphs).


Submitting the Message

When a mail message is received at the sender's Mail Server, the message
is immediately assigned an eight character filename based on a hash of
the time and date of the server's clock.  It is also given an extension
to the filename based on the number of destination Mail Server
envelopes.  The extension count starts at zero.  As each envelope for the
message is received from the sending workstation, the extension count is
incremented by one.  The extension takes the form of .Mnn, where M indicates
Message and nn is a running count of the number of received envelopes for
that message.  For example, if four envelopes were received, the extension
would be .M04.

The message filename is placed in the \3PLUS\3MAIL\MESSAGES subdirectory of
the Mail Server.  Any attachments are given the same filename as the message
and an extension based on the attachment count.  For example, if seven
attachments are sent by the workstation, they are given extensions of .A0
through .A6, the A representing Attachment and the numbers 00 through 06
representing the seven attachments.  (Note that the attachment count starts
at zero.)  Attachments are placed in the same directory as their
corresponding message (\3PLUS\3MAIL\MESSAGES).


Delivering the Message

After the messages and attachments have been put in a subdirectory, the mail
envelopes are opened and examined.  All envelopes contain a destination
network number, a Mail Server Ethernet address, and the well-known Mail
socket 0463.  Mail service creates a directory structure on a Mail Server as
follows:

As each mail envelope is opened, the network number is noted.  Mail
determines if it is the local network number.  If not, it looks in
the \3PLUS\3MAIL\FORWARD directory (on the Mail Server) for a subdirectory
with that network number.  For example, if the envelope contains network
number 00040001, Mail looks for \3PLUS\3MAIL\FORWARD\00040001.  If it is not
found, Mail creates the 00040001 subdirectory.

Next, Mail notes the destination Mail Server Ethernet address and well-known
Mail socket number 0463 and looks for that subdirectory.  For example, using
the Mail envelope for network number 00040001, if the destination Mail
Server has an address of 02608c123456, Mail looks for subdirectory \
\3PLUS\3MAIL\FORWARD\00040001\02608c12\34560463.  (Note that the destination
Mail Server Ethernet address has been combined with the well-known Mail
socket and divided into two eight-character groupings.)  If the subdirectory
does not exist, it is created by Mail.  Then, Mail places the envelope in
that subdirectory, constituting "delivery."


Distributing the Message

After the envelope has been delivered, the message extension count (.Mnn)
is incremented by one, indicating a pending retrieval for the Route, Remote,
or NetConnect service.

If no envelopes remain, the message distribution process is complete.
However, distribution may remain for users whose home Mail Server is
the same as the sender's Mail Server.  In that case, Mail looks at
the envelope, retrieves destination user names one at a time, and
scans a file called MBXS, located in \3PLUS\3MAIL (on the Mail Server).  If
the user name is found, it will cross-reference to a number that identifies a
subdirectory.  Here is a sample MBXS file:

.LT
   43  Mary Hanley:Domain:Org
   04  Jack Jones:Domain:Org
   132 Shelly Winters:Domain:Org
   15  Neil Farnham:Domain:Org
.EL

Assume the first name in the envelope is Jack Jones.  Mail looks for
the subdirectory \3PLUS\3MAIL\MAILBOX\04.  If it is not found, Mail
creates it.  A zero-byte file is created, given the same filename as the
message and an extension of .Pnn, and placed in the subdirectory.
The P represents Pending mail, and nn represents number of
Attachments.  If nn=x, then a Mail delivery error has occurred.
The envelope is read until mail is distributed to all local user
names, then it is discarded.  The message reference count, .Mnn, is
decremented by one to signify delivery to end users.  This count is
only decremented when mail reaches its destination.  Transfer from the
forward subdirectory fulfills this requirement.  The count now represents
the number of envelopes pending delivery in the forward subdirectory, plus
the number of local users pending receipt of the message.

The message extension starts at one (a message must have some
destination).  As envelopes are delivered to the subdirectories
representing remote mail servers and notifications are made to local
users, the message reference count is incremented from one through nine,
then from A through Z.  This constitutes a maximum of 35 recipients.  The
count then increments to .M10 through .M1Z, another potential 36 recipients.
(It is 36, because the second count cycle includes .M00.)  .M00 indicates
completion of message retrieval, at which point the message and attachments
are erased.  This limits the initial count to 35, but all pending cycles to
36.  Therefore, the number of recipients waiting for any given message can be
calculated as follows:

    [(MSC*36) + LSC]

where MSC=Most Significant Character and LSC=Least Significant Character.

For example, assume you looked in the \3PLUS\3MAIL\MESSAGES subdirectory and
saw a message with the extension .M2P.  P represents (1-9)+(A-P) or 25.  That
would calculate to:

.LT
   [(2*36) + P]
   [(2*36) + 25]
   [72 + 25]
   [97]
.EL

Therefore, the number of pending recipients is 97.  That is, the mail
message has been sent to some combination of 97 local recipients and
remote mail servers.

.MZZ calculates to [(Z*36) + Z], which is [(36*36) + 35] or 1,331.  Because
a 3+ Share server is limited to a maximum of 520 users, a sender would have
to be distributing to 520 local users AND 811 remote domains!

As noted before, if an error occurs receiving mail to the sender's Mail
Server, the message will be placed in the message subdirectory, and a
duplicate filename with an extension of .x will be placed just after it.  For
example:

.LT
   16d3a331.M0B
   16d3a331.x
.EL


Limited Number of Attachments

There can be no more than 26 attachments to one mail message.  This is
because when mail attachments are received by a workstation, each attachment
on one message is given the next successive alphabet letter (A-Z).  Therefore,
within the server mail message directory, the largest filename attachment
extension you will see is .AP.  (P = 0-9 + A-P [16 letters] for a total of
26.)

Error extensions do not have a count associated with them.
