Path: utzoo!attcan!uunet!mcvax!ukc!strath-cs!glasgow!taylor
From: taylor@cs.glasgow.ac.uk (Jem Taylor)
Newsgroups: comp.mail.sendmail
Subject: Re: home delivery non-standards, followup
Message-ID: <1995@crete.cs.glasgow.ac.uk>
Date: 29 Nov 88 15:25:40 GMT
References: <88Nov27.125307est.6152@neat.ai.toronto.edu>
Reply-To: taylor@cs.glasgow.ac.uk (Jem Taylor)
Organization: Comp Sci, Glasgow Univ, Scotland
Lines: 43

In article <88Nov27.125307est.6152@neat.ai.toronto.edu> rayan@ai.toronto.edu (Rayan Zachariassen) writes:
>[ The questions was whether there was a standard filename for UCB-Mail format
>  message delivery to the recipients' home directory. ]

>There are a lot of advantages to a scheme with one file per message.
>However, very few user agents are prepared to deal with that yet.  I would
>be interested in determining a standard for that situation as well.  How
>about the following (screwy) scheme?:
>
>stat ~/.mail
>
>If it is a file, deliver in UCB-mail/MMDF format to that file.
>
>If it is a directory, create a new file in that directory and deliver
>the raw message to it. 

I believe this to be the only sensible way to organise a mailbox ! It
places concurrency control in the filesystem, and means there can be no
problem with several people or processes reading the mail at the same time
but closing after deleting different messages. It also eases the
'search for message headers' phase of start-up - the headers are at the
fronts of the files.

>The algorithm that generates the file name is
>guaranteed to produce unique names consisting of all-digits.  The algorithm
>is free to maintain state between invocations but doesn't need to.

This is a lot like closed-hash - which is well understood. However, I would
suggest NOT using a 'random' unique name, because it discards data. One thing
a User Agent might like to do, apart from offering messages in CREATION DATE
order rather than DELIVERY DATE, is to group messages which reference one
another by References: or In-Reply-To: headers. So, either use the
Message-ID: in the message (which should be unique) or use the Date:. I prefer
Message-ID since it is more likely to be unique; if it exists then compare
body parts; if body is the same it is a duplicate -> discard it; if they
differ then append (!). If the UA can cope with /usr/spool/mail format then
it can also cope with two messages in one file.

-Jem Taylor.
-- 
ARPANet:taylor@cs.glasgow.ac.uk		| Mail:	J.A.Taylor, Computing Science,
JANET:	taylor@uk.ac.glasgow.cs		|	Glasgow University,
UseNet:	mcvax!cs.glasgow.ac.uk!taylor	|	GB-GLASGOW G12 8QQ