From: Ken Hornstein Date: Fri, 17 May 2019 18:27:28 +0000 (-0400) Subject: Remove final traces of TMA support X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/612f63b11fa4ac1d97d41943d48702bf16eed947 Remove final traces of TMA support TMA (the TTI Trusted Mail Agent) was an early implementation of encrypted mail and is long gone. There were a few vestigial bits of this support left in nmh, and this is finally removing them. This includes the check for the "Encrypted" header field in various scan formats and some code to return the code SCNENC from scan() function where it would have special handling by programs like inc(1). --- diff --git a/etc/scan.MMDDYY b/etc/scan.MMDDYY index f4a20bd5..96c122bf 100644 --- a/etc/scan.MMDDYY +++ b/etc/scan.MMDDYY @@ -3,7 +3,7 @@ %; Like scan.default, but the date is printed in MM/DD/YY format rather than %; MM/DD. %; -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/etc/scan.YYYYMMDD b/etc/scan.YYYYMMDD index 97016c2c..f106a8ab 100644 --- a/etc/scan.YYYYMMDD +++ b/etc/scan.YYYYMMDD @@ -3,7 +3,7 @@ %; Like scan.default, but the date is printed in YYYY-MM-DD format rather than %; MM/DD. %; -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/etc/scan.curses b/etc/scan.curses index f2d5d137..ec8e356e 100644 --- a/etc/scan.curses +++ b/etc/scan.curses @@ -25,10 +25,9 @@ %4(msg)\ %; %; If it's the current message, output a '+' in the next column, otherwise -%; a space. Also use '-' if it's got a "Replied" header and 'E' if it's -%; encrypted (not currently supported) +%; a space. Also use '-' if it's got a "Replied" header. %; -%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%<(cur)+%| %>%<{replied}-%| %>\ %; %; Output the date, but mark it with a '*' if it's missing and was synthesized. %; Note the use of 02 to make sure the date is padded with a leading zero. diff --git a/etc/scan.default b/etc/scan.default index adca1fcb..8a6ed742 100644 --- a/etc/scan.default +++ b/etc/scan.default @@ -4,7 +4,7 @@ %; format string (for non-UK sites) which was compiled into the %; command "scan". See the source file "h/scansbr.h" for details. %; -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/etc/scan.highlighted b/etc/scan.highlighted index 944dbce8..751821e8 100644 --- a/etc/scan.highlighted +++ b/etc/scan.highlighted @@ -34,7 +34,7 @@ %; %<(cur)%(zputlit(lit ))%>\ %<(unseen)%(zputlit(lit ))%>\ -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/etc/scan.mailx b/etc/scan.mailx index 942e2653..b051f0d6 100644 --- a/etc/scan.mailx +++ b/etc/scan.mailx @@ -1,6 +1,6 @@ %<(cur)>%| %>\ %<{status} %|N%>\ -%<{replied}R%?{encrypted}E%| %>\ +%<{replied}R%| %>\ %4(msg) \ %<(mymbox{from})%<{to}To: %13(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/etc/scan.nomime b/etc/scan.nomime index 8e2cedf6..49662289 100644 --- a/etc/scan.nomime +++ b/etc/scan.nomime @@ -4,7 +4,7 @@ %; format for scan, that doesn't do any RFC-2047 decoding of %; header components. %; -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(friendly{to})%>%>%<(zero)%17(friendly{from})%> \ %{subject}%<{body}<<%{body}>>%> diff --git a/etc/scan.size b/etc/scan.size index 9b48078c..60ebbb27 100644 --- a/etc/scan.size +++ b/etc/scan.size @@ -1,4 +1,4 @@ -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %5(size) \ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ diff --git a/etc/scan.time b/etc/scan.time index ff376285..9b082c11 100644 --- a/etc/scan.time +++ b/etc/scan.time @@ -1,4 +1,4 @@ -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date}) \ %02(hour{date}):%02(min{date})%3(tzone{date})\ %<{date} %|*%>\ diff --git a/etc/scan.timely b/etc/scan.timely index de09b8b7..2d7aa9f8 100644 --- a/etc/scan.timely +++ b/etc/scan.timely @@ -1,4 +1,4 @@ -%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %(void(rclock{date}))\ %<(gt 15768000)%03(month{date})%(void(year{date}))%02(modulo 100)\ %?(gt 604800)%02(mday{date})%03(month{date})\ diff --git a/etc/scan.unseen b/etc/scan.unseen index 1b254d4d..df7561c1 100644 --- a/etc/scan.unseen +++ b/etc/scan.unseen @@ -1,4 +1,4 @@ -%4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%?{encrypted}E%| %>\ +%4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ %<(zero)%17(unquote(decode(friendly{from})))%> \ diff --git a/test/format/test-fmtdump b/test/format/test-fmtdump index 0e723dce..eded0362 100755 --- a/test/format/test-fmtdump +++ b/test/format/test-fmtdump @@ -85,12 +85,8 @@ L1: LS_COMP, comp "replied" IF_S continue else goto L2 CHAR '-' GOTO L3 -L2: LS_COMP, comp "encrypted" - IF_S continue else goto L4 - CHAR 'E' -L3: GOTO L5 -L4: CHAR ' ' -L5: PARSEDATE, c_name "date", c_type +L2: CHAR ' ' +L3: PARSEDATE, c_name "date", c_type LV_MON, c_name "date", c_type NUMF, width 2, fill '0' CHAR '/' @@ -98,35 +94,35 @@ L5: PARSEDATE, c_name "date", c_type LV_MDAY, c_name "date", c_type NUMF, width 2, fill '0' LS_COMP, comp "date", c_type - IF_S continue else goto L6 + IF_S continue else goto L4 CHAR ' ' - GOTO L7 -L6: CHAR '*' -L7: MYMBOX, c_name "from", c_type + GOTO L5 +L4: CHAR '*' +L5: MYMBOX, c_name "from", c_type LV_COMPFLAG, comp "from", c_type - IF_V_NE 0 continue else goto L8 + IF_V_NE 0 continue else goto L6 LS_COMP, comp "to", c_type - IF_S continue else goto L8 + IF_S continue else goto L6 LIT "To:" PARSEADDR, c_name "to", c_type LS_FRIENDLY, c_name "to", c_type LS_DECODE STRF, width 14, fill ' ' -L8: IF_V_EQ 0 continue else goto L9 +L6: IF_V_EQ 0 continue else goto L7 PARSEADDR, c_name "from", c_type LS_FRIENDLY, c_name "from", c_type LS_DECODE STRF, width 17, fill ' ' -L9: LIT " " +L7: LIT " " LS_COMP, comp "subject" LS_DECODE STR LS_COMP, comp "body" - IF_S continue else goto L10 + IF_S continue else goto L8 LIT "<<" COMP, comp "body" LIT ">>" -L10: CHAR '\n' +L8: CHAR '\n' DONE EOF @@ -146,12 +142,8 @@ L1: LS_COMP, comp "replied" IF_S continue else goto L2 CHAR '-' GOTO L3 -L2: LS_COMP, comp "encrypted" - IF_S continue else goto L4 - CHAR 'E' -L3: GOTO L5 -L4: CHAR ' ' -L5: PARSEDATE, c_name "date", c_type +L2: CHAR ' ' +L3: PARSEDATE, c_name "date", c_type LV_MON, c_name "date", c_type NUMF, width 2, fill '0' CHAR '/' @@ -159,37 +151,37 @@ L5: PARSEDATE, c_name "date", c_type LV_MDAY, c_name "date", c_type NUMF, width 2, fill '0' LS_COMP, comp "date", c_type - IF_S continue else goto L6 + IF_S continue else goto L4 CHAR ' ' - GOTO L7 -L6: CHAR '*' -L7: MYMBOX, c_name "from", c_type + GOTO L5 +L4: CHAR '*' +L5: MYMBOX, c_name "from", c_type LV_COMPFLAG, comp "from", c_type - IF_V_NE 0 continue else goto L8 + IF_V_NE 0 continue else goto L6 LS_COMP, comp "to", c_type - IF_S continue else goto L8 + IF_S continue else goto L6 LIT "To:" PARSEADDR, c_name "to", c_type LS_FRIENDLY, c_name "to", c_type LS_DECODE LS_UNQUOTE STRF, width 14, fill ' ' -L8: IF_V_EQ 0 continue else goto L9 +L6: IF_V_EQ 0 continue else goto L7 PARSEADDR, c_name "from", c_type LS_FRIENDLY, c_name "from", c_type LS_DECODE LS_UNQUOTE STRF, width 17, fill ' ' -L9: LIT " " +L7: LIT " " LS_COMP, comp "subject" LS_DECODE STR LS_COMP, comp "body" - IF_S continue else goto L10 + IF_S continue else goto L8 LIT "<<" COMP, comp "body" LIT ">>" -L10: CHAR '\n' +L8: CHAR '\n' DONE EOF diff --git a/uip/inc.c b/uip/inc.c index e40b7306..bac44429 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -655,7 +655,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: default: if (aud) fputs (charstring_buffer (scanl), aud); @@ -717,7 +716,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: /* * Run the external program hook on the message. */ @@ -799,7 +797,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: default: /* * Run the external program hook on the message. diff --git a/uip/scan.c b/uip/scan.c index b999378b..12879050 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -195,7 +195,7 @@ main (int argc, char **argv) hdrflag ? file : NULL, 0L, 1, &scanl); if (scanl) charstring_clear(scanl); - if (state != SCNMSG && state != SCNENC) + if (state != SCNMSG) break; } charstring_free (scanl); @@ -283,7 +283,6 @@ main (int argc, char **argv) msgnum == mp->curmsg, unseen, folder, 0L, 1, &scanl)) { case SCNMSG: - case SCNENC: case SCNERR: break; diff --git a/uip/scansbr.c b/uip/scansbr.c index 38b2ca41..8030715f 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -57,7 +57,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, { static bool deja_vu; static int tty_width; - int i, compnum, encrypted, state; + int i, compnum, state; char *cp, *tmpbuf, *startbody, **nxtbuf; char *saved_c_text = NULL; struct comp *cptr; @@ -96,9 +96,6 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, cptr = fmt_findcomp("folder"); if (cptr && folder) cptr->c_text = mh_xstrdup(folder); - if (fmt_addcompentry("encrypted")) { - ncomps++; - } cptr = fmt_findcomp("dtimenow"); if (cptr) cptr->c_text = getcpy(dtimenow (0)); @@ -343,9 +340,6 @@ finished: if (noisy) fputs (charstring_buffer (*scanl), stdout); - cptr = fmt_findcomp ("encrypted"); - encrypted = cptr && cptr->c_text; - /* return dynamically allocated buffers to pool */ while ((cptr = *savecomp++)) { cptr->c_text = NULL; @@ -354,7 +348,7 @@ finished: if (scnout && (ferror(scnout) || fclose (scnout) == EOF)) DIEWRERR(); - return state != FILEEOF ? SCNERR : encrypted ? SCNENC : SCNMSG; + return state != FILEEOF ? SCNERR : SCNMSG; } diff --git a/uip/scansbr.h b/uip/scansbr.h index a7c8aed9..cb2c060e 100644 --- a/uip/scansbr.h +++ b/uip/scansbr.h @@ -4,7 +4,6 @@ * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ -#define SCNENC 2 /* message just fine, but encrypted(!!) */ #define SCNMSG 1 /* message just fine */ #define SCNEOF 0 /* empty message */ #define SCNERR (-1) /* error message */ @@ -17,14 +16,14 @@ #ifndef UK #define FORMAT \ -"%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +"%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%>\n" #else #define FORMAT \ -"%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +"%4(msg)%<(cur)+%| %>%<{replied}-%| %>\ %02(mday{date})/%02(mon{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \