I worte on 16 Feb 2000 22:29:43 +0100
about [md-2] Attachments and sending them on

> Hello All
>
>   There has been a problem with sending on Emails which contain attachments, and
> them becoming scrambled when you try to 'Forward' them. So I have found a way,
> which sends on the body of the message, with attachments, all in tacked, to a
> new address.
>
  There is now only one script, the instructions are within the script. You will
need 'Snoopdos', if it is in your system path, you can use the script,
un-altered, if it isn't, then you will need to change the path in the script.

  The same script is now run twice, with each run having an arguement appended
to the command line.
    RX rexx:Attach_MD.mdrx 1
 then
    RX rexx:Attach_MD.mdrx 2
 If you supply anything or nothing else the script will fail and do nothing.

--- 8< --- cut --- ARexx --- here --- 8< ---
 /*
 $VER: 2.00 Attch_MD.mdrx (17-02-2000)
 $AUTHOR: by Jules ([EMAIL PROTECTED]) ©2000
 $DESCRIPTION: Parsing on attachments.

 Instructions
 1) Make sure you are not on line, and you can 'Queue' any message.
 2) In the 'message list window' select, but do not open, the message you
     intend to send on.
 3) Run 'Attch_MD.mdrx' with the argument of '1'
 4) When the new message window opens, select the destination address.
     Do not worry that there is no body to the text, as this is added
     by the second run of the script.
 5) 'Queue', but do not 'Send' the message.
 6) Close the current group, and open the 'Spool'.
 7) Select but do not open the new message in the 'Spool'.
 8) Run 'Attch_MD.mdrx' with the arguement of '2'.
    Wait for disk activity to stop before you do anything else, please.
 9) To see if the script has worked you will need to close and then re-open
    the new message.
 */

/*
 Please enter the path of 'Snoopdos'
 Example SNOOP="SYS:Tools/Snoopdos"
 */

SNOOP="SNOOPDOS"

OPTIONS RESULTS

PARSE ARG WHICHPART

WHICHPART=TRIM(WHICHPART)

IF ~SHOW('P','MD.1') THEN DO
 EXIT
END

IF WHICHPART == 1 THEN DO

 SETCLIP('SNP',SNOOP)

 ADDRESS 'MD.1' ; EXTRACTSELECTEDMSGS 'T:Messageheld NOREQ'

/*
 Find the correct line.
 */
 DETEC=0 ; PDRAW="" ; DFILE=""
 CALL OPEN('MH','T:Messageheld','R')
 DO UNTIL DETEC>0
  DFILE=READLN('MH')
    IF POS('Subject:',DFILE) THEN DO
     SBJCT='"'||STRIP(DFILE,,'Subject: ')||'"'
    END
  DETEC=POS('Content-Type',DFILE)
 END

/*
 Write the new file
 */
 CALL OPEN('MHT','T:MessHeldTarget','W')
   CALL WRITELN('MHT',DFILE)
 DO UNTIL EOF('MH')
   DFILE=READLN('MH') ; CALL WRITELN('MHT',DFILE)
 END
 CALL CLOSE('MH') ; CALL CLOSE('MHT')

/*
 Read the message in MD-II
 */
 ADDRESS MD.1 ; NewMsgWindow SUBJECT SBJCT
END

IF WHICHPART == 2 THEN DO
 SNOOP=GETCLIP('SNP')
/*
 Check if SnoopDos is running; if not, then start it
 */
 SNOOPPATH="RUN >NIL: "||SNOOP||" HIDEMETHOD=TOOLSMENU HIDE"
 IF ~SHOW('P','SNOOPDOS') THEN DO
  ADDRESS COMMAND SNOOPPATH
  ADDRESS COMMAND "WAITFORPORT SNOOPDOS"
 END

/*
 Set up Snoopdos
 */
 ADDRESS SNOOPDOS ; CLEARBUFFER ; FORMAT "%50n"

/*
 Read the message in MD-II
 */
 ADDRESS MD.1 ; READSELECTEDMSGS ; ADDRESS COMMAND 'WAIT'

/*
 Save the SnoopDos Buffer
 */
 ADDRESS SNOOPDOS ; SAVEBUFFER "T:SnoopMD"

/*
 Find the correct line.
 */
 DETEC=0 ; PDRAW="" ; DFILE=""
 CALL OPEN('MD','T:SnoopMD','R')
 DO UNTIL DETEC>1 ; PDRAW=READLN('MD') ; DETEC=POS('DBX_',PDRAW) ; END
 DFILE=READLN('MD') ; CALL CLOSE('MD') ; QUIT

/*
 Give it a hair cut
 */
 TARGETFILE=TRIM(PDRAW)||"/"||TRIM(DFILE)

/*
 TARGETFILE
*/
 DFILE=""
 CALL OPEN('MDT',TARGETFILE,'R') ; CALL OPEN('MDHT','T:PARTONE','W')
 DETEC=0
  DO UNTIL DETEC>0
   DFILE=READLN('MDT') ; CALL WRITELN('MDHT',DFILE)
   DETEC=POS('Mime-Version: ',DFILE)
  END
 CALL CLOSE('MDT') ; CALL CLOSE('MDHT')

/*
 EDIT FILE
 */
 DFILE=""
 CALL OPEN('PRTO','T:PARTONE','R')
 CALL OPEN('PRTT','T:MessHeldTarget','R')
 CALL OPEN('MDT',TARGETFILE,'W')
 DETEC=0
  DO UNTIL DETEC>0
   DFILE=READLN('PRTO') ; CALL WRITELN('MDT',DFILE)
   DETEC=POS('Mime-Version: ',DFILE)
  END
  DO UNTIL EOF('PRTT')
   DFILE=READLN('PRTT') ; CALL WRITELN('MDT',DFILE)
  END
 CALL CLOSE('MDT') ; CALL CLOSE('PRTT') ; CALL CLOSE('PRTO')

 ADDRESS COMMAND 'DELETE T:MessHeldTarget T:PARTONE QUIET'
 ADDRESS COMMAND 'DELETE T:SnoopMD T:Messageheld QUIET'
END
EXIT
--- 8< --- cut --- ARexx --- here --- 8< ---

--
Regards
  Jules
________________________________________________________________
MicroDot-II Mailing List - Info & Archive: http://www.vapor.com/
For Listserver Help: <[EMAIL PROTECTED]>, "HELP"
To Unsubscribe: <[EMAIL PROTECTED]>, "UNSUBSCRIBE"

Reply via email to