Subject: C-client removes header lines?

From: Peter Svanberg <[email-masked]>
Date: Wed, 21 Sep 1994 17:35:23 +0200

Given a bezerk-format file with a message containing

>From 
   :
From: ...
Status: RO
Subject: Test 3

<body>

I just noticed that C-client seems to remove all header lines
following a "Status:" header - Subject in this case! How come?

(I opened this file in Pine 3.90, flagged this message as
"Important" and afterwards it looked like

>From 
   :
From: ...
Status: RO
X-Status: F

<body>

.)

---
Peter Svanberg, NADA, KTH		    Email: [email-masked]
Dept of Num An & CS,
Royal Inst of Tech			    Phone: +46 8 790 71 40
S-100 44  Stockholm, SWEDEN		    Fax:   +46 8 790 09 30

---

From: Mark Crispin <[email-masked]>
Date: Wed, 21 Sep 1994 10:37:33 -0700 (PDT)

> following a "Status:" header - Subject in this case! How come?

I found, and fixed, a bug yesterday which caused c-client to crash when a
Status: or X-Status: header appeared in the middle of a header instead of at
the end of the header where it belongs.  Your problem is another symptom of
that same bug.  The problem is a dangling pointer.

The fix is to look for a comment which reads
				/* yuck!! calculate size of delete area */
in bezerk.c and mmdf.c.  Before the
	e = NIL;		/* no more delete area */
line, insert
	s = e;			/* back up pointer */

The latest mail/imap.tar.Z has this fix.  There are other important fixes in
as well.

-- Mark --

---

From: Peter Svanberg <[email-masked]>
Date: Thu, 22 Sep 1994 12:32:08 +0200

Quoting:  Mark Crispin <[email-masked]>
> The latest mail/imap.tar.Z has this fix.  There are other important fixes in

OK. Can this code be used instead of the C-client code
delivered with Pine 3.90?

Peter Svanberg, NADA, KTH

---

From: Mark Crispin <[email-masked]>
Date: Thu, 22 Sep 1994 11:58:28 -0700 (PDT)

> delivered with Pine 3.90?

Yes, it can.

However, please note that the latest version (which has the bugfix) of the
IMAP toolkit on the FTP server is very often updated on a *daily* basis, and
thus that code may be ALPHA TEST.

There are no known bugs in it, but there's a lot of new code that has not been
rigorously tested yet.

---

From: Peter Svanberg <[email-masked]>
Date: Fri, 14 Oct 1994 04:16:46 +0100

> that same bug.  The problem is a dangling pointer.

I still have this problem in Pine 3.91. Was this a different
bug, not yet killed, or have I done some Pine-installing-error?

Repeated by: an BSD mbox folder containing 3 messages, the
last of which has a Subject header after the X-Status
ditto. Open it in Pine 3.91, mark message 2 as Important,
exit. Then the Subject header in message 3 is gone.

Note: I load c-client with
DEFAULTDRIVERS=imap mbox nntp pop3 mh mtx tenex mmdf bezerk news phile dummy

Peter Svanberg

---

From: Mark Crispin <[email-masked]>
Date: Thu, 13 Oct 1994 21:08:15 -0700 (PDT)

> exit. Then the Subject header in message 3 is gone.

Peter -

     Thank you very much for your bug report, and especially for mentioning
the *very* important detail that it was a Subject: line that got lost.

Bug:	Removal of Status:/X-Status: header lines removes all lines which
	begin with X or S after a Status:/X-Status: line.

Diagnosis: Code which recognized the end of an Status:/X-Status: deletion was
	not called in the case of a line beginning with X or S.

Solution: Reorganize the switch statement so that X and S cases have failures
	that fall into the default case.  See attached patches.

-- Mark --

---

From: Peter Svanberg <[email-masked]>
Date: Fri, 14 Oct 1994 16:36:35 +0100

Quoting:  Mark Crispin <[email-masked]>
> the *very* important detail that it was a Subject: line that got lost.

You're welcome! I hope this is not an indication of the overall
quality of the C-client code... ;-)

My test case works fine with your patches. Thanks!

Peter Svanberg