From: Phillip Helbig [HELBPHI@sysdev.deutsche-boerse.com] Sent: Tuesday, July 23, 2002 10:16 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Mail degraded from VAX 6.2 to VAX 7.3 > This last weekend, I upgraded my sole remaining VAXstation from 6.2 to 7.3. > It is on this machine that I read my mail, including listservers like > Info-VAX. > > I noticed the following differences in DECWindows mail which I do not like. I'm not sure when the BLISS-to-C rewrite (why oh why?!?!) was done; I jumped from 5.5-2 to 7.1. This introduced so many bugs that MAIL/OLD was introduced. :-) Perhaps you can get your DECwindows MAIL to run MAIL_OLD.EXE instead of MAIL.EXE and see if the problem is still there. > I may have overlooked earlier discussion here about this, since I am sure that > VMS mail afficiendos like Phillip H. would have noticed this. (Though I > vaguely remember he prefers character cell.) Indeed. Since I am reading comp.os.vms via infovax and not via NNTP, I wrote the code below to allow me to select threads and read from character-cell MAIL. The idea is to cut and paste the line printed on the screen to select the thread. Not completely bug-free, but works more or less. ---------------------8<------------------------------------------------- $! THREAD_EMAIL_FOLDER.COM $! $! handy for efficiently reading email $! $! $! parameter existence $! $ IF F$LENGTH(P1) .EQ. 0 $ THEN $ WSO "" $ WSO "pass name of folder to be read as P1" $ WSO "optionally pass name of temporary folder as P2" $ EXIT $ ELSE $ READ_FOLDER = P1 $ ENDIF $ IF F$LENGTH(P2) .GT. 0 $ THEN $ FILE_FOLDER = P2 $ ELSE $ FILE_FOLDER := ZYXW $ ENDIF $! $! $! temporary files $! $ MF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_MAI.LIS; $ LF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_DIR.LIS; $ XF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_XXX.LIS; $ NF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_NEW.LIS; $ DF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_DEL.LIS; $ RF := SYS$SCRATCH:THREAD_EMAIL_FOLDER_REA.LIS; $ IF F$SEARCH(MF) .NES. "" THEN DELETE 'MF'* $ IF F$SEARCH(LF) .NES. "" THEN DELETE 'LF'* $ IF F$SEARCH(LF) .NES. "" THEN DELETE 'XF'* $ IF F$SEARCH(LF) .NES. "" THEN DELETE 'NF'* $ IF F$SEARCH(DF) .NES. "" THEN DELETE 'DF'* $ IF F$SEARCH(RF) .NES. "" THEN DELETE 'RF'* $! $! $! parameters OK? $! $!check for existence of folder to be read and exit if not present? $! $! $ CLOSE/NOLOG MAIL_FILE $ OPEN/WRITE MAIL_FILE 'MF' $ WRITE MAIL_FILE "$ MAIL" $ WRITE MAIL_FILE " SELECT ''READ_FOLDER'" $ WRITE MAIL_FILE " QUIT" $ WRITE MAIL_FILE "$ EXIT" $ CLOSE/NOLOG MAIL_FILE $ DEFINE/USER_MODE SYS$OUTPUT 'LF' $ @ 'MF' $ DELETE/NOLOG 'MF' $ SEA/OUT='XF' 'LF' "%MAIL-" $ DELETE 'LF' $ CLOSE/NOLOG MAIL_STATUS $ OPEN/READ MAIL_STATUS 'XF' $ READ MAIL_STATUS MESSAGE $ CLOSE/NOLOG MAIL_STATUS $ DELETE 'XF' $ IF MESSAGE .EQS. "%MAIL-E-NOTEXIST, folder ''READ_FOLDER' does not exist" $ THEN $ WSO "" $ WSO "the specified folder to be read (''READ_FOLDER') does not exist" $ EXIT $ ENDIF $! $! $!check for existence of temporary folder and exit if present? $! $ CLOSE/NOLOG MAIL_FILE $ OPEN/WRITE MAIL_FILE 'MF' $ WRITE MAIL_FILE "$ MAIL" $ WRITE MAIL_FILE " SELECT ''FILE_FOLDER'" $ WRITE MAIL_FILE " QUIT" $ WRITE MAIL_FILE "$ EXIT" $ CLOSE/NOLOG MAIL_FILE $ DEFINE/USER_MODE SYS$OUTPUT 'LF' $ @ 'MF' $ DELETE/NOLOG 'MF' $ SEA/OUT='XF' 'LF' "%MAIL-" $ DELETE 'LF' $ CLOSE/NOLOG MAIL_STATUS $ OPEN/READ MAIL_STATUS 'XF' $ READ MAIL_STATUS MESSAGE $ CLOSE/NOLOG MAIL_STATUS $ DELETE 'XF' $ IF F$EXTRACT(0,18,MESSAGE) .EQS. "%MAIL-I-SELECTED, " $ THEN $ WSO "" $ WSO "the specified temporary folder (''FILE_FOLDER') already exists" $ EXIT $ ENDIF $! $! $! symbols needed later $! $ QUOTE = """" $ MAX_LENGTH = F$GETDVI("SYS$OUTPUT","DEVBUFSIZ") - F$LENGTH(FILE_FOLDER) - 11 $! $! $! move to the temporary folder $! not really necessary, but allows incoming mail to be stored in $! the original, presumably familiar folder name $! $ CLOSE/NOLOG MAIL_FILE $ OPEN/WRITE MAIL_FILE 'MF' $ WRITE MAIL_FILE "$ MAIL" $ WRITE MAIL_FILE " SELECT ''READ_FOLDER'" $ WRITE MAIL_FILE " FILE/ALL/NOCONFIRM ''FILE_FOLDER'" $ WRITE MAIL_FILE " QUIT" $ WRITE MAIL_FILE "$ EXIT" $ CLOSE/NOLOG MAIL_FILE $ @ 'MF' $ DELETE/NOLOG 'MF' $! $! $! get a list of subjects $! $ OPEN/WRITE MAIL_FILE 'MF' $ WRITE MAIL_FILE "$ MAIL" $ WRITE MAIL_FILE " DIR ''FILE_FOLDER'" $ WRITE MAIL_FILE " QUIT" $ WRITE MAIL_FILE "$ EXIT" $ CLOSE/NOLOG MAIL_FILE $ DEFINE/USER_MODE SYS$OUTPUT 'LF' $ @ 'MF' $ DELETE/NOLOG 'MF' $ SORT/NODUPLICATES/KEY=(POSITION:40,SIZE=41) 'LF' 'LF' $! $! $! we want only the real subject, i.e. treat original message $! and replies equally $ CLOSE/NOLOG DIR_LIS $ OPEN/READ DIR_LIS 'LF' $ CLOSE/NOLOG NEW_LIS $ OPEN/WRITE NEW_LIS 'NF' $RE_LOOP: $ READ/END=END_RE_LOOP DIR_LIS SUBJECT $ LENGTH = F$LENGTH(SUBJECT) $ TOPIC = F$EXTRACT(40,LENGTH-40,SUBJECT) $ LENGTH = F$LENGTH(TOPIC) $ IF F$EDIT(F$EXTRACT(0,4,TOPIC),"UPCASE") .EQS. "RE: " $ THEN $ BARE_SUBJECT = F$EXTRACT(4,LENGTH,TOPIC) $ SUBJECT = F$EXTRACT(0,40,SUBJECT) + BARE_SUBJECT $ ENDIF $ WRITE NEW_LIS SUBJECT $GOTO RE_LOOP $END_RE_LOOP: $ CLOSE/NOLOG DIR_LIS $ DELETE 'LF'* $ CLOSE/NOLOG NEW_LIS $! the double sort is needed to retain empty subjects but put them last $ SORT/NODUPLICATES/KEY=(POSITION:41,SIZE=40) 'NF' 'NF' $ SORT/NODUPLICATES/KEY=(POSITION:41,SIZE=40,DESC) 'NF' 'NF' $! $! $! take some action $! $ OPEN/READ NEW_LIS 'NF' $ R = 0 $ D = 0 $ACTION_LOOP: $! get rid of bogus records $ READ/END=DELETE_SUBJECTS NEW_LIS SUBJECT $ IF F$EXTRACT(0,8,SUBJECT) .EQS. "You have" .OR. - F$EXTRACT(0,8,SUBJECT) .EQS. " " .OR. - F$EXTRACT(0,8,SUBJECT) .EQS. " # Fr" .OR. - F$LENGTH(SUBJECT) .EQS. 0 - THEN GOTO ACTION_LOOP $! we want only the real subject $ LENGTH = F$LENGTH(SUBJECT) $ SUBJECT = F$EXTRACT(40,LENGTH-40,SUBJECT) $ WSO "" $ IF F$LENGTH(SUBJECT) .EQ. 0 $ THEN $! handle empty subject lines $! later, get this from some "include" file $ ESC[0,8] = 27 $ BOLD = ESC + "[1m" $ NORM = ESC + "[0m" $ WSO BOLD + "[none]" + NORM + " (will be added to read list automatically)" $ ANSWER := R $ GOTO ALREADY_ANSWERED $ ELSE $ WSO SUBJECT $ ENDIF $READ_IT: $ WSO "" $ READ/PROMPT="Read or Delete? " SYS$COMMAND ANSWER $ ANSWER=F$EDIT(F$EXTRACT(0,1,ANSWER),"UPCASE") ALREADY_ANSWERED: $ IF ANSWER .EQS. "R" $ THEN $ R = R + 1 $ IF R .EQ. 1 $ THEN $ CLOSE/NOLOG READ_FILE $ OPEN/WRITE READ_FILE 'RF' $ ENDIF $ WRITE READ_FILE SUBJECT $ ELSE $ IF ANSWER .EQS. "D" $ THEN $ D = D + 1 $ IF D .EQ. 1 $ THEN $ CLOSE/NOLOG DELETE_FILE $ OPEN/WRITE DELETE_FILE 'DF' $ WRITE DELETE_FILE "$ MAIL" $ ENDIF $ GOSUB REPLACE_QUOTES $ WRITE DELETE_FILE " SELECT ''FILE_FOLDER'/SUBJ=""''SUBJECT'""" $ WRITE DELETE_FILE " DELETE/ALL" $ ELSE $ GOTO READ_IT $ ENDIF $ ENDIF $GOTO ACTION_LOOP $DELETE_SUBJECTS: $! $! $! delete messages to be deleted $! $ CLOSE/NOLOG NEW_LIS $ DELETE 'NF'* $ IF D .GT. 0 $ THEN $ WRITE DELETE_FILE " QUIT" $ WRITE DELETE_FILE "$ EXIT" $ CLOSE/NOLOG DELETE_FILE $ @ 'DF' $ DELETE 'DF' $ ENDIF $ IF R .EQ. 0 THEN GOTO READ_LOOP_END $! $! $! read messages to be read $! $ CLOSE/NOLOG READ_FILE $ OPEN/READ READ_FILE 'RF' $ I = -1 $READ_LOOP: $ READ/END=READ_LOOP_END READ_FILE SUBJECT $ I = I + 1 $ K = R - I $ WSO "" $ WSO "''I' of ''R' threads read; ''K' remaining" $ WSO "" $ SUBJECT = F$EXTRACT(0,MAX_LENGTH,SUBJECT) $ GOSUB REPLACE_QUOTES $! not only the length, but also the allowed length has perhaps changed $ NEW_LENGTH = MAX_LENGTH + 2*REPLACED $ SUBJECT = F$EXTRACT(0,NEW_LENGTH,SUBJECT) $! make sure quotes are matched $! this assumes that a quoted string is at least three characters long $! I will add more sophisticated code if a shorter string not just $! appears but actually causes me any problems $ IF F$EXTRACT(NEW_LENGTH-1,1,SUBJECT) .EQS. QUOTE .AND. - F$EXTRACT(NEW_LENGTH-4,1,SUBJECT) .NES. QUOTE THEN - SUBJECT = F$EXTRACT(0,NEW_LENGTH-3,SUBJECT) $ WSO "SEL ''FILE_FOLDER'/SUB=""''SUBJECT'""" $ DEFINE/USER SYS$INPUT SYS$COMMAND $ MAIL $GOTO READ_LOOP $READ_LOOP_END: $ IF R .GT. 0 $ THEN $ CLOSE/NOLOG READ_FILE $ DELETE 'RF' $ ENDIF $ EXIT $! $! $! GOSUB $! $set ver $REPLACE_QUOTES: $ REPLACED = 0 $LOOP_QUOTES: $ GRAVE = "`" $ LENGTH = F$LENGTH(SUBJECT) $ LOC = F$LOCATE(QUOTE,SUBJECT) $ IF LOC .LT. LENGTH $ THEN $ REPLACED = REPLACED + 1 $ SUBJECT[LOC,1] := "''GRAVE'" $ GOTO LOOP_QUOTES $ ELSE $ GOTO INSERT_QUOTES $ ENDIF $INSERT_QUOTES: $ LENGTH = F$LENGTH(SUBJECT) $ LOC = F$LOCATE(GRAVE,SUBJECT) $ IF LOC .LT. LENGTH $ THEN $ SUBJECT = F$EXTRACT(0,LOC,SUBJECT) + """""""""" + - F$EXTRACT(LOC+1,LENGTH,SUBJECT) $ GOTO INSERT_QUOTES $ ELSE $ RETURN $ ENDIF $! ------------------------end of code----------------------------------