From:	HENRY::IN%"EMAILDEV%UKACRL.BITNET%ucbvax.berkeley.edu%kl.sri.com%csnet-relay.CSNET%relay.cs.net@RCA.COM"  5-JUN-1987 16:53
To:	INFO-VAX@kl.sri.com
Subj:	Un-digesting digest format messages.

 Here is a COM file which I use to un-digest digest format messages.
It seems to work, but as usual I accept no responsibility for its use...
The program reads and deletes one digest format message from the folder
DIGEST in your MAIL.MAI, and puts the individual messages into the folder
UNDIGEST. It MUST be edited to suit your requirements. CHECKSUM on the file
as sent is 2070036852, for the paranoids amongst you.
 This file is only slightly modified from a version which comes with
a VMS bulletin-board system written by Mark London at MIT PFC,
(MRL%PFCVAX@MC.LCS.MIT.EDU), and therefore the credit is his.

Ronan Flood, Liverpool Polytechnic Computer Services Dept.

ARPA: 114RONAN%SPOOL.LIVPOL.AC.UK@UCL-CS.ARPA
BITNET: 114RONAN%LIVPOL.SPOOL@AC.UK

------------------------------------ CUT -------------------------------
$ SET NOVER
$ FF[0,8] = 12   ! Define a form feed character
$ PID = F$GETJPI("","PID")
$ USER = F$GETJPI("","USERNAME")
$ EXTRACT_FILE = "''PID'" + ".TXT"
$ DEFINE/USER EXTRACT_FILE 'PID'
$ MAIL
SELECT DIGEST
READ
EXTRACT EXTRACT_FILE
DELETE
$ OPEN/READ INPUT 'EXTRACT_FILE'
$ OPEN/WRITE OUTPUT 'EXTRACT_FILE'
$ READ INPUT FROM_USER
$AGAIN:
$ READ INPUT BUFFER
$ IF F$EXTRACT(0,15,BUFFER) .NES. "---------------" THEN GOTO AGAIN
$ FROM = " "
$ SUBJ = " "
$NEXT:
$ READ INPUT BUFFER
$FROM:
$ IF F$EXTRACT(0,5,BUFFER) .NES. "From:" THEN GOTO SUBJECT
$ FROM = BUFFER
$ GOTO NEXT
$SUBJECT:
$ IF F$EXTRACT(0,8,BUFFER) .NES. "Subject:" THEN GOTO NEXT
$ SUBJ = BUFFER - "Subject:"
$F2:
$ IF F$LENGTH(SUBJ) .EQ. 0 THEN GOTO WRITE
$ IF F$EXTRACT(0,1,SUBJ) .NES. " " THEN GOTO WRITE
$ SUBJ = F$EXTRACT(1,F$LENGTH(SUBJ),SUBJ)
$ GOTO F2
$WRITE:
$ WRITE SYS$OUTPUT FROM_USER
$ IF FROM .NES. " " THEN $ WRITE SYS$OUTPUT FROM
$ WRITE SYS$OUTPUT SUBJ
$ WRITE SYS$OUTPUT ""
$ WRITE OUTPUT FF
$ WRITE OUTPUT FROM_USER
    ! Write From: + TAB + USERNAME
$ WRITE OUTPUT "To: " + USER
    ! Write To: + TAB + BBOARDUSERNAME
$ WRITE OUTPUT "Subj: " + SUBJ
    ! Write Subject: + TAB + mail subject
$ WRITE OUTPUT ""  ! Write one blank line
$ IF FROM .NES. " " THEN WRITE OUTPUT FROM
$READ:
$ READ/END=EXIT/ERR=EXIT INPUT BUFFER
$ IF F$EXTRACT(0,15,BUFFER) .EQS. "---------------" THEN GOTO READ1
$ WRITE OUTPUT BUFFER
$ GOTO READ
$READ1:
$ READ/END=EXIT/ERR=EXIT INPUT BUFFER
$ IF F$LOCATE(":",BUFFER) .EQ. F$LENGTH(BUFFER) THEN GOTO READ1
$ FROM = " "
$ SUBJ = " "
$ GOTO FROM
$EXIT:
$ CLOSE INPUT
$ CLOSE OUTPUT
$ PUR 'EXTRACT_FILE'
$ !
$ DEFINE/USER EXTRACT_FILE []'EXTRACT_FILE'
$ MAIL
SET FILE EXTRACT_FILE
COPY/ALL/NOCONFIRM UNDIGEST [CSD.RONAN.MAIL]MAIL.MAI
$ DELETE 'EXTRACT_FILE';*
