From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 15-SEP-1989 18:04
To:	MRGATE::"ARISIA::EVERHART"
Subj:	MAIL-DUMP.COM

Message-Id:  <8909152153.AA07096@crdgw1.ge.com>
Received: From CORNELLC.CIT.CORNELL.EDU by CRVAX.SRI.COM with TCP; Fri, 15 SEP 89 14:25:20 PDT
Received: from gallua.bitnet by CORNELLC.cit.cornell.edu (IBM VM SMTP R1.2.1MX) with BSMTP id 8764; Fri, 15 Sep 89 17:23:25 EDT
Date: Fri, 15 Sep 89 17:23 EST
From: "Kevin Cole at Gallaudet U. Washington DC" <CADS_COLE%GALLUA.BITNET@CORNELLC.cit.cornell.edu>
Subject: MAIL-DUMP.COM
To: INFO-VAX@SRI.COM
X-Vms-To: IN%"INFO-VAX@SRI.COM"

Date sent:  15-SEP-1989 17:16:53

---------------------------------<Cut here>-----------------------------------
$!      *** MAIL-DUMP ***       Written by Kevin Cole at Gallaudet U.  09/89
$!
$!   This accepts a folder name and a file extension, and dumps the folder
$! AND a directory of the folder to a file named YYMMDD.extension, where YYMMDD
$! is today's date (YY/MM/DD) and the extension is either what you specified or
$! the folder name you chose.
$!
$! NOTE:  Then, it blithely assumes all is well, deletes the dumped messages,
$!        compresses the mail and deletes any MAIL.OLD that it can find.  This
$!        MAY not be a feature you would appreciate.  ;-)  (No warrentees, no
$!        refunds, etc, etc.)
$!
$!  It could probably use a lot of improvement...  I just claim credit for the
$!  idea, not necessarily the implementation.  Please send improvements my way.
$!
$!                                     Kevin Cole    (CADS_COLE@GALLUA.BITNET)
$!-----------------------------------------------------------------------------
$! To use, type:
$!
$!      @MAIL-DUMP [folder] [extension]
$!
$!  If both the folder name and the extension are ommitted, you'll get your
$!  MAIL folder and the filename will be yymmdd.TXT.  If only the extension is
$!  ommitted, you'll get a filename of yymmdd.folder
$!
$!-----------------------------------------------------------------------------
$!
$!  Build me some commands and a filename with today's date in it.
$!
$         FOLDER = "SEL MAIL"
$         EXTENS = "TXT"
$         IF P1 .NES. "" THEN FOLDER = "SEL "+P1
$         IF P1 .NES. "" THEN EXTENS = P1
$         IF P2 .NES. "" THEN EXTENS = P2
$         FID    = F$CVTIME(F$TIME()) - "19" - "-" - "-"
$         FID    = F$EXTRACT(0,6,FID) + "." + EXTENS
$         DUMPTO = "EXTRACT/ALL/APPEND " + FID
$!
$!  Write the directory out to the file.
$!
$         OPEN/WRITE    KLUDGE CANNED.RESPONSES
$         WRITE/SYMBOL  KLUDGE FOLDER
$         WRITE         KLUDGE "DIR"
$         WRITE         KLUDGE "EXIT"
$         CLOSE         KLUDGE
$         DEFINE/USER SYS$INPUT   CANNED.RESPONSES
$         DEFINE/USER SYS$OUTPUT  'FID'
$         MAIL
$         DELETE CANNED.RESPONSES;*
$!
$!  Append the messages to the directory/table of contents and wipe 'em.
$!
$         OPEN/WRITE    KLUDGE CANNED.RESPONSES
$         WRITE/SYMBOL  KLUDGE FOLDER
$         WRITE         KLUDGE DUMPTO
$         IF P1 .EQS. "" THEN GOTO SAVE
$         WRITE         KLUDGE "DEL/ALL"
$         WRITE         KLUDGE "COMPRESS"
$ SAVE:
$         WRITE         KLUDGE "EXIT"
$         CLOSE         KLUDGE
$         DEFINE/USER SYS$INPUT CANNED.RESPONSES
$         MAIL
$         DELETE CANNED.RESPONSES;*
$!
$!  Scrap the uncompressed mail file (DELETE MAIL.OLD)
$!
$         DELETE [...]MAIL.OLD;*

