*** hdrs/defs.h.orig	Fri Oct  7 14:19:18 1994
--- hdrs/defs.h	Fri Oct  7 14:28:25 1994
***************
*** 309,330 ****
  
  /** some defines for the "status" field of the header and alias record **/
  
! #define ACTION		1		/* bit masks, of course */
! #define CONFIDENTIAL	2
! #define DELETED		4
! #define EXPIRED		8
! #define FORM_LETTER	16
! #define NEW		32
! #define PRIVATE		64
! #define TAGGED		128
! #define URGENT		256
! #define VISIBLE		512
! #define UNREAD		1024
! #define STATUS_CHANGED	2048
! #define MIME_MESSAGE	4096	/* indicates existence of MIME Header */
! #define MIME_NEEDDECOD	8192	/* indicates that we need to call mmdecode */
! #define	MIME_NOTPLAIN	16384	/* indicates that we have a content-type,
  				   for which we need metamail anyway. */
  
  /** some defines for the "type" field of the alias record **/
  
--- 309,336 ----
  
  /** some defines for the "status" field of the header and alias record **/
  
! #define ACTION		0x00001		/* bit masks, of course */
! #define CONFIDENTIAL	0x00002
! #define DELETED		0x00004
! #define EXPIRED		0x00008
! #define FORM_LETTER	0x00010
! #define NEW		0x00020
! #define PRIVATE		0x00040
! #define TAGGED		0x00080
! #define URGENT		0x00100
! #define VISIBLE		0x00200
! #define UNREAD		0x00400
! #define STATUS_CHANGED	0x00800
! #define MIME_MESSAGE	0x01000	/* indicates existence of MIME Header */
! #define MIME_NEEDDECOD	0x02000	/* indicates that we need to call mmdecode */
! #define	MIME_NOTPLAIN	0x04000	/* indicates that we have a content-type,
  				   for which we need metamail anyway. */
+ #if defined(_M_UNIX) || defined(_SCO_DS)
+ /* SCO specific state flags */
+ #define MSG_SAVED	0x08000
+ #define MSG_FORW	0x10000
+ #define MSG_PLIED	0x20000
+ #endif
  
  /** some defines for the "type" field of the alias record **/
  
*** src/fileio.c.orig	Fri Oct  7 14:19:57 1994
--- src/fileio.c	Fri Oct  7 14:35:31 1994
***************
*** 258,276 ****
  	}
  	if (end_header) {
  	  if (update_status) {
  	      if (isoff(current_header->status, NEW)) {
  		if (ison(current_header->status, UNREAD)) {
! 		  if (fprintf(dest_file, "%sStatus: O\n", prefix) == EOF) {
! 		    copy_write_error_exit();
! 		  }
  		} else	/* read */
  #ifdef BSD
! 		  if (fprintf(dest_file, "%sStatus: OR\n", prefix) == EOF) {
  #else
! 		  if (fprintf(dest_file, "%sStatus: RO\n", prefix) == EOF) {
  #endif
! 		    copy_write_error_exit();
! 		  }
  		update_status = FALSE; /* do it only once */
  	      }	/* else if NEW - indicate NEW with no Status: line. This is
  		 * important if we resync a mailfile - we don't want
--- 258,288 ----
  	}
  	if (end_header) {
  	  if (update_status) {
+ 	      char statusBuffer[SLEN];
+ 
  	      if (isoff(current_header->status, NEW)) {
  		if (ison(current_header->status, UNREAD)) {
! 			strcpy(statusBuffer, "O");
  		} else	/* read */
  #ifdef BSD
! 		  strcpy(statusBuffer, "OR");
  #else
! 		  strcpy(statusBuffer, "RO");
  #endif
! 
! #if defined(_M_UNIX) || defined(_SCO_DS)
! 		/* Set SCO specific flags */
! 		if (ison(current_header->status, MSG_SAVED))
! 			strcat(statusBuffer, "S");
! 		if (ison(current_header->status, MSG_FORW))
! 			strcat(statusBuffer, "F");
! 		if (ison(current_header->status, MSG_PLIED))
! 			strcat(statusBuffer, "P");
! #endif
! 
! 		if (fprintf(dest_file, "%sStatus: %s\n", prefix, statusBuffer) == EOF) {
! 		  copy_write_error_exit();
! 		}
  		update_status = FALSE; /* do it only once */
  	      }	/* else if NEW - indicate NEW with no Status: line. This is
  		 * important if we resync a mailfile - we don't want
*** src/newmbox.c.orig	Fri Oct  7 14:20:07 1994
--- src/newmbox.c	Fri Oct  7 14:36:28 1994
***************
*** 973,978 ****
--- 973,988 ----
  		current_header->status &= ~NEW;
  		current_header->status |= UNREAD;
  	      }
+ 
+ #if defined(_M_UNIX) || defined(_SCO_DS)
+ 	      /* Get SCO specific flags */
+ 	      if (index(current_header->mailx_status, 'S') != NULL)
+ 		current_header->status |= MSG_SAVED;
+ 	      if (index(current_header->mailx_status, 'F') != NULL)
+ 		current_header->status |= MSG_FORW;
+ 	      if (index(current_header->mailx_status, 'P') != NULL)
+ 		current_header->status |= MSG_PLIED;
+ #endif
  	    }
  
  	    else if (buffer[0] == LINE_FEED || buffer[0] == '\0') {
