1.0 Mac Eudora LMOS
	1.1 Data storage
		1.1.1 The POPD Resource
			1.1.1.1 Type ÔPOPDÕ for dominant, ÔPOxxÕ for personalities
				1.1.1.1.1 NOT keyed to POP account, just to personality
			1.1.1.2 Kept in Eudora Settings file
			1.1.1.3 typedef struct POPDesc
{
	uLong receivedGMT;/* time Eudora first saw it */
	uLong uidHash;		/* hash function of message-id or UID */
	long msgSize;			/* size of the message */
	Boolean retr;			/* should we fetch this message? */
	Boolean retred;		/* fetched successfully */
	Boolean delete;		/* should we delete it if we manage to fetch it? */
	Boolean deleted;	/* did we delete it? */
	Boolean stub:1;		/* should we download a stub? */
	Boolean stubbed:1;/* do we have a stub? */
	Boolean skip:1;		/* are we stubbing this because of sbm? */
	Boolean big2:1;		/* are we stubbing this because it's too big? */
	Boolean head:1;		/* are we stubbing because of download headers? */
	Boolean error:1;	/* was there an error downloading? */
	Boolean spare:2;	/* rest of the bits */
} POPDesc, *POPDPtr, **POPDHandle;
			1.1.1.4 Hashing
				1.1.1.4.1 Andrew hash is used
		1.1.2 1001 - Server messages
			1.1.2.1 Describes all messages on server and what we did with them as of last mail check.
		1.1.3 1002 - Fetch list
			1.1.3.1 List of all messages user has requested explicit fetch for.
			1.1.3.2 Only the uidHash is used
		1.1.4 1003 - Delete list
			1.1.4.1 List of all messages user has requested explicit delete for.
			1.1.4.2 Only the uidHash is used
	1.2 User Inputs
		1.2.1 Settings
			1.2.1.1 LMOS checkbox - if off, mail normally deleted immediately
			1.2.1.2 LMOS days - if 0, mail normally never deleted
			1.2.1.3 Delete from server when emptied from trash - if on, mail deleted from server when emptied from trash
		1.2.2 Controls
			1.2.2.1 On Message window
				1.2.2.1.1 Trash can
					1.2.2.1.1.1 Displayed for all mail on POPD 1001 not marked Deleted
					1.2.2.1.1.2 Enabled unless LMOS off and Fetch selected; then disabled and selected
					1.2.2.1.1.3 Selected if message is on 1003
				1.2.2.1.2 Fetch icon
					1.2.2.1.2.1 Displayed for Error or Stubbed not marked Fetched or Deleted
					1.2.2.1.2.2 Always enabled if displayed
					1.2.2.1.2.3 Selected if message is on 1002
			1.2.2.2 In Menu bar/mailbox
				1.2.2.2.1 Do Nothing/Fetch/Delete/Fetch&Delete
				1.2.2.2.2 Enabling
					1.2.2.2.2.1 Based on current message or 1st message of multiple selection
					1.2.2.2.2.2 Option key enables all items (except Fetch if LMOS off)
					1.2.2.2.2.3 Enabling of items follows enabling of icons above
	1.3 Mail Check Logic
		1.3.1 Build list of messages on server with UIDL, LIST
for each message on server
{
	// setup
  if message appears on POPD 1001
  {
    copy old descriptor
    clear retr, stub, delete
  }
  // special conditions
  if user has requested unconditional delete
  	set delete
  else if user has requested headers to in box
    set head, stub
  else if message marked as deleted last time
    set delete
  else // normal check, more or less
  {
  	// first, we make a rough pass to decide what we might do
    if there is room to fetch message
      clear the too big flag (which might have carried over from last fetch)
    if message not fetched before and user is fetching mail
    	set retr
    if (lmos is off) or (user is deleting and message is on delete list) or (message has been fetched and is over X days old)
      set delete
    // now we fine-tune the process
    // skip big messages
    if message > skip size
      set skip flag
    if fetch set and skip set and message not on fetch list
    {
    	clear retr
    	if not stubbed
    	{
    		set stub
    		clear delete
    	}
    }
    // deal with mail previously stubbed and now tentatively marked fetch
    if stubbed set and retr set
    {
    	if head set or error set
    	{
    		clear retr
    	}
    }
    if fetching mail and message on fetch list
      set retr
    if fetch set and not enough room for message
    {
      set big2
      clear delete // don't delete it if we can't fetch it!
      if not stubbed
        set stub
    }
    if stub but not enough room even for stub
    {
    	clear stub
    	clear delete // don't delete what we don't have
    }
    if user has requested all messages fetched to be deleted
      set delete
    
    // one last sanity check
    if (not fetched and not fetch) and (not on delete list or on fetch list) and not deleted
    	clear delete
  }
}

