Subject: Corrupted Mailbox Notification

From: Randy Holder <[email-masked]>
Date: Mon, 28 Nov 1994 11:08:59 -0600 (CST)

In our final days of testing Pine 3.91 before making it public (here at U 
of Arkansas), we have found what seems to be a small problem. When an 
inbox is corrupted, Pine 3.89 notified the user that the inbox is 
corrupt.  Pine 3.91 does not seem to notify the user.  Instead, it opens 
the inbox and reports 0 messages.  It doesn't seem to tell the end user 
that there is a problem. Any suggestions on how to prevent this?

Specs:

using Pine 3.91
Sun SparcCenter 2000 
Solaris 2.3 (I think)

Thanks in advance,

Randy Holder

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 Randy V. Holder                              Phone: (501) 575-2905
 Electronic Mail Support Specialist             Fax:   (501) 575-4753  
 Lotus 1-2-3 Support                          Email: [email-masked] 
 University of Arkansas                       Fayetteville, Arkansas
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

---

From: Mark Crispin <[email-masked]>
Date: Mon, 28 Nov 1994 16:12:54 -0800 (PST)

Hello.

Thank you for reporting this problem.  At first, I was confused by your
report, but now I understand: if you open INBOX and the /usr/spool/mail/$USER
file is corrupted, you will get this behavior.  Opening the file explicitly
will give you the error.

I'll look into having this bug fixed in Pine 3.92.

---

From: Mark Crispin <[email-masked]>
Date: Tue, 29 Nov 1994 03:17:14 -0800 (PST)

The bug of not getting notified about corrupted /usr/spool/mail/$USER files
(seeing an empty INBOX instead) can be fixed by replacing the definition of
dummy_open() in file c-client/dummy.c with the following code:

{
  int fd;
  char err[MAILTMPLEN],tmp[MAILTMPLEN];
  struct stat sbuf;
				/* OP_PROTOTYPE call */
  if (!stream) return &dummyproto;
  err[0] = '\0';		/* no error message yet */
				/* can we open the file? */
  if ((fd = open (dummy_file (tmp,stream->mailbox),O_RDONLY,NIL)) < 0) {
				/* no, error unless INBOX */
    if (strcmp (ucase (strcpy (tmp,stream->mailbox)),"INBOX"))
      sprintf (err,"%s: %s",strerror (errno),stream->mailbox);
  }
  else {			/* file had better be empty then */
    fstat (fd,&sbuf);		/* sniff at its size */
    close (fd);
    if (sbuf.st_size)		/* bogus format if non-empty */
      sprintf (err,"%s (file %s) is not in valid mailbox format",
	       stream->mailbox,tmp);
  }
  if (!stream->silent) {	/* only if silence not requested */
    if (err[0]) mm_log (err,ERROR);
    else {
      mail_exists (stream,0);	/* say there are 0 messages */
      mail_recent (stream,0);	/* and certainly no recent ones! */
    }
  }
  return err[0] ? NIL : stream;	/* return success if no error */
}