Tony Rolfe worte on 12 Apr 2000 11:53:56 +1100
about [netconnect] MD Problems
> Using MDII 1.4.4, I tried to forward a message with attachments.
I think you lost the header information, so it would have treated it as a plain text
mail.
When I have a mail with single attachments, I just save it to 'Ram', but when there
are
multiple attachments I run the attached ARexx script. It needs 'Snoopdos', and you may
need to enter it's path if it is not in your system path.
--- 8< --- cut here --- 8< ---
/*
$VER: 2.00 Attch_MD.mdrx (17-02-2000)
$AUTHOR: Jules �2000
$DESCRIPTION: Parsing on attachments.
Make sure you have entered the correct path for 'Snoopdos'.
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< --- and here --- 8< ---
--
Regards
Jules
--
I will not conduct my own firedrills.
-- Bart Simpson
_____________________________________________________________
NetConnect mailing list. To unsubscribe, send an 'unsubcribe'
message to <[EMAIL PROTECTED]>