Subject: What does the message 'MAIL FOLDER "INBOX" CLOSED DUE TO ACCESS ERROR' mean

From: "Lawrence R. Rogers" <[email-masked]>
Date: Wed, 23 Feb 1994 08:45:28 EST

Hi:

I have just installed pine-3.89 and a user reports getting the message:

	MAIL FOLDER  "INBOX" CLOSED DUE TO ACCESS ERROR

followed by it deleteing all of this person's new mail, which I assume means 
the unread mail in /usr/spool/mail/foo.  Have I built pine incorrectly.  
Thanks.

 =====   ======= =======	Larry Rogers
=     =     =       =     	Manager, UNIX Systems
=           =       =     	Princeton University
=           =       =     	87 Prospect Street, Room 201
=           =       =     	Princeton, NJ 08544
=           =       =     	[email-masked], princeton!lrr
=     =     =       =     	Phone: 609-258-6483/6000
 =====   =======    =     	FAX:   609-258-1069/3943

---

From: David L Miller <[email-masked]>
Date: Thu, 24 Feb 1994 16:59:29 -0800 (PST)

Lawrence,

The message ``Folder format invalidated (consult an expert), aborted'' means
that Pine was reading your mail folder, and at the point in which it expected
a start-of-message header line, it found something else.

The start-of-message header line is in the form:
	From [email-masked] Wed Feb 23 11:43:10 PST 1994
There are variations in the format of the date and time.

The ``format invalidated'' condition can happen in one of three ways:
 1) bad data exists at the beginning of the folder.
 2) data was appended to the folder after Pine initially read it, and the new
    data did not begin with a start-of-message-header.
 3) the folder was modified without Pine being aware of it.

All three problems are generally caused by software external to Pine.

Condition (1) can be determined by whether or not the problem repeats itself
after restarting Pine.  If restarting Pine does not make the problem go away,
then you need to look at the actual file for the folder and see what is wrong
with the very first line.  In particular, make sure that the first character
of the folder file is a capital ``F'' , the second an ``r'', the third an
``o'', etc.

Condition (2) may be caused by a mail delivery process (e.g. /bin/mail) which
writes some characters other than ``From '' at the beginning of the new data.

Condition (3) is caused by some program manipulating the mail folder without
following the Pine folder locking protocol.  This is a general problem on
UNIX.

Conditions (2) and (3) have also been known to occur when accessing folders
via NFS, if the information returned by the stat() and read() system calls do
not correspond with each other as a result of NFS buffer caching.

Restarting Pine on that folder always clears conditions (2) and (3).  If the
problem is chronic, it may be worth an investigation to determine its cause.
Usually, it is due to the misbehavior of some external software.  The reason
why Pine gives up with conditions (2) and (3) is that it does not want to risk
damaging user data by guessing what is right.  Pine never writes to the folder
unless it is absolutely sure it knows what it is doing.

There are some steps which can be taken to reduce the risk of these conditions
coming up.  Some of these steps may require the assistance of your system
adminstrator (or whomever it was that built and installed Pine on your
system):
 1) Use IMAP instead of NFS to access remote folders.  This is perhaps the
    single most important cause of user difficulties.
 2) Consider enabling the mbox driver in Pine.  If the mbox driver is enabled,
    mail is transferred from the /usr/spool/mail mail into a file called mbox
    in your home directory, if mbox exists.  The home directory mbox file is
    then your INBOX.  This has the advantage that Pine and the mail delivery
    system are never in contention for the INBOX.  Pine only empties the
    /usr/spool/mail file, it never tries updating it.
 3) Be careful not to run other programs that access your folders while you
    are running Pine.  Such programs may modify the folder from under Pine,
    and lead Pine to conclude that there is a problem.

Thanks for the report!

--DLM

|\ |  |\/|  David L. Miller    [email-masked]  (206) 685-6240
|/ |_ |  |  Software Engineer, Pine Development Team   (206) 685-4045 (FAX)
University of Washington, Networks & Distributed Computing
4545 15th Ave NE, Seattle WA 98105, USA

---

From: Matt Simmons <[email-masked]>
Date: Thu, 24 Feb 1994 20:29:10 -0600 (CST)

Honestly, what works for me 99% of the time is to load it into dmail (or 
equivalent), do something to it which causes dmail to rewrite the 
mailbox, exit dmail, and re-run pine.

   [email-masked]  Matt Simmons  Bradley University, Peoria, IL
                    Found in the BU Scout Personals:  
  "Jane--I don't want to be alone again for Valentine's Day.  I want to work 
    this out.  I was just hurt that you would sleep with my best friend ... 
     repeatedly ... in my bed.  Actually, never mind.  Go to hell.   John"