Browse Source

Plan 9 from Bell Labs 2005-12-21

David du Colombier 15 years ago
parent
commit
a87a9496d3

+ 14 - 14
dist/replica/_plan9.db

@@ -362,13 +362,13 @@
 386/bin/png - 775 sys sys 1131646646 164272
 386/bin/ppm - 775 sys sys 1131646646 149447
 386/bin/pr - 775 sys sys 1132418764 77495
-386/bin/primes - 775 sys sys 1130384322 38811
+386/bin/primes - 775 sys sys 1135101636 38803
 386/bin/prof - 775 sys sys 1132418764 110968
 386/bin/proof - 775 sys sys 1132506869 178756
 386/bin/ps - 775 sys sys 1130594774 68017
 386/bin/pwd - 775 sys sys 1130384323 36915
 386/bin/ramfs - 775 sys sys 1134389873 89820
-386/bin/rc - 775 sys sys 1132506869 143275
+386/bin/rc - 775 sys sys 1135101637 143284
 386/bin/rdbfs - 775 sys sys 1134389874 174453
 386/bin/read - 775 sys sys 1130594776 58078
 386/bin/replica - 20000000775 sys sys 1018321168 0
@@ -444,11 +444,11 @@
 386/bin/upas/addhash - 775 sys sys 1130594796 71976
 386/bin/upas/aliasmail - 775 sys sys 1132506877 105106
 386/bin/upas/bayes - 775 sys sys 1130594796 74627
-386/bin/upas/deliver - 775 sys sys 1132506877 100133
-386/bin/upas/filter - 775 sys sys 1132506878 147676
+386/bin/upas/deliver - 775 sys sys 1135101637 100133
+386/bin/upas/filter - 775 sys sys 1135101637 147751
 386/bin/upas/fs - 775 sys sys 1134389879 334032
 386/bin/upas/isspam - 775 sys sys 1064598349 38
-386/bin/upas/list - 775 sys sys 1130594798 82799
+386/bin/upas/list - 775 sys sys 1135101638 82799
 386/bin/upas/marshal - 775 sys sys 1132506879 132971
 386/bin/upas/ml - 775 sys sys 1132506879 123917
 386/bin/upas/mlmgr - 775 sys sys 1132506880 104539
@@ -469,7 +469,7 @@
 386/bin/upas/token - 775 sys sys 1130594804 77586
 386/bin/upas/unesc - 775 sys sys 1134151361 132264
 386/bin/upas/unspam - 775 sys sys 1064598367 38
-386/bin/upas/vf - 775 sys sys 1130594804 97025
+386/bin/upas/vf - 775 sys sys 1135101638 97135
 386/bin/usb - 20000000775 sys sys 1019538890 0
 386/bin/usb/usbaudio - 775 sys sys 1134389880 185573
 386/bin/usb/usbd - 775 sys sys 1130594805 129878
@@ -7279,9 +7279,9 @@ sys/man/1/emacs - 664 sys sys 944959673 199
 sys/man/1/eqn - 664 sys sys 1134592617 5655
 sys/man/1/expect - 664 sys sys 1134557311 3014
 sys/man/1/faces - 664 sys sys 1113743326 2395
-sys/man/1/factor - 664 sys sys 957920005 1019
+sys/man/1/factor - 664 sys sys 1135084026 1015
 sys/man/1/file - 664 sys sys 1015024739 1578
-sys/man/1/filter - 664 sys sys 1124885098 4619
+sys/man/1/filter - 664 sys sys 1135083932 6142
 sys/man/1/fmt - 664 sys sys 1070032221 1557
 sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 944959673 735
@@ -12628,7 +12628,7 @@ sys/src/cmd/postscript/trofftable/trofftable.ps - 664 sys sys 944961073 3678
 sys/src/cmd/postscript/trofftable/trofftable.rc - 664 sys sys 984789206 2637
 sys/src/cmd/postscript/trofftable/trofftable.sh - 664 sys sys 984789206 2613
 sys/src/cmd/pr.c - 664 sys sys 1050689592 11172
-sys/src/cmd/primes.c - 664 sys sys 944961351 2126
+sys/src/cmd/primes.c - 664 sys sys 1135081181 2123
 sys/src/cmd/prof.c - 664 sys sys 1124305301 5547
 sys/src/cmd/proof - 20000000775 sys sys 944961622 0
 sys/src/cmd/proof/font.c - 664 sys sys 944961621 8525
@@ -12711,7 +12711,7 @@ sys/src/cmd/rc/getflags.h - 664 sys sys 944961082 185
 sys/src/cmd/rc/glob.c - 664 sys sys 1055698770 4540
 sys/src/cmd/rc/havefork.c - 664 sys sys 1055698771 3473
 sys/src/cmd/rc/haventfork.c - 664 sys sys 1055698771 3122
-sys/src/cmd/rc/here.c - 664 sys sys 1055698771 2497
+sys/src/cmd/rc/here.c - 664 sys sys 1135080780 2504
 sys/src/cmd/rc/io.c - 664 sys sys 1132448641 3752
 sys/src/cmd/rc/io.h - 664 sys sys 1132448641 535
 sys/src/cmd/rc/lex.c - 664 sys sys 1100894085 6100
@@ -13337,8 +13337,8 @@ sys/src/cmd/upas/common/process.c - 664 sys sys 1098803900 3012
 sys/src/cmd/upas/common/sys.h - 664 sys sys 1055699577 2223
 sys/src/cmd/upas/filterkit - 20000000775 sys sys 1018549521 0
 sys/src/cmd/upas/filterkit/dat.h - 664 sys sys 1018549520 107
-sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1075069156 1075
-sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1020313488 4751
+sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1135083942 1070
+sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1135083949 4754
 sys/src/cmd/upas/filterkit/mkfile - 664 sys sys 1048645255 264
 sys/src/cmd/upas/filterkit/pipefrom.sample - 775 sys sys 1041184939 380
 sys/src/cmd/upas/filterkit/pipeto.sample - 664 sys sys 1045505695 1765
@@ -13401,7 +13401,7 @@ sys/src/cmd/upas/send/authorize.c - 664 sys sys 944961322 569
 sys/src/cmd/upas/send/bind.c - 664 sys sys 944961322 3252
 sys/src/cmd/upas/send/cat_mail.c - 664 sys sys 1016904916 1190
 sys/src/cmd/upas/send/dest.c - 664 sys sys 1109511268 4789
-sys/src/cmd/upas/send/filter.c - 664 sys sys 1116769185 2311
+sys/src/cmd/upas/send/filter.c - 664 sys sys 1135083956 2365
 sys/src/cmd/upas/send/gateway.c - 664 sys sys 944961322 499
 sys/src/cmd/upas/send/local.c - 664 sys sys 1031707305 2584
 sys/src/cmd/upas/send/log.c - 664 sys sys 944961322 2090
@@ -13432,7 +13432,7 @@ sys/src/cmd/upas/unesc/mkfile - 664 sys sys 1075080255 164
 sys/src/cmd/upas/unesc/unesc.c - 664 sys sys 1075080255 789
 sys/src/cmd/upas/vf - 20000000775 sys sys 1015096796 0
 sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
-sys/src/cmd/upas/vf/vf.c - 664 sys sys 1124885103 20004
+sys/src/cmd/upas/vf/vf.c - 664 sys sys 1135083959 20043
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166

+ 14 - 14
dist/replica/plan9.db

@@ -362,13 +362,13 @@
 386/bin/png - 775 sys sys 1131646646 164272
 386/bin/ppm - 775 sys sys 1131646646 149447
 386/bin/pr - 775 sys sys 1132418764 77495
-386/bin/primes - 775 sys sys 1130384322 38811
+386/bin/primes - 775 sys sys 1135101636 38803
 386/bin/prof - 775 sys sys 1132418764 110968
 386/bin/proof - 775 sys sys 1132506869 178756
 386/bin/ps - 775 sys sys 1130594774 68017
 386/bin/pwd - 775 sys sys 1130384323 36915
 386/bin/ramfs - 775 sys sys 1134389873 89820
-386/bin/rc - 775 sys sys 1132506869 143275
+386/bin/rc - 775 sys sys 1135101637 143284
 386/bin/rdbfs - 775 sys sys 1134389874 174453
 386/bin/read - 775 sys sys 1130594776 58078
 386/bin/replica - 20000000775 sys sys 1018321168 0
@@ -444,11 +444,11 @@
 386/bin/upas/addhash - 775 sys sys 1130594796 71976
 386/bin/upas/aliasmail - 775 sys sys 1132506877 105106
 386/bin/upas/bayes - 775 sys sys 1130594796 74627
-386/bin/upas/deliver - 775 sys sys 1132506877 100133
-386/bin/upas/filter - 775 sys sys 1132506878 147676
+386/bin/upas/deliver - 775 sys sys 1135101637 100133
+386/bin/upas/filter - 775 sys sys 1135101637 147751
 386/bin/upas/fs - 775 sys sys 1134389879 334032
 386/bin/upas/isspam - 775 sys sys 1064598349 38
-386/bin/upas/list - 775 sys sys 1130594798 82799
+386/bin/upas/list - 775 sys sys 1135101638 82799
 386/bin/upas/marshal - 775 sys sys 1132506879 132971
 386/bin/upas/ml - 775 sys sys 1132506879 123917
 386/bin/upas/mlmgr - 775 sys sys 1132506880 104539
@@ -469,7 +469,7 @@
 386/bin/upas/token - 775 sys sys 1130594804 77586
 386/bin/upas/unesc - 775 sys sys 1134151361 132264
 386/bin/upas/unspam - 775 sys sys 1064598367 38
-386/bin/upas/vf - 775 sys sys 1130594804 97025
+386/bin/upas/vf - 775 sys sys 1135101638 97135
 386/bin/usb - 20000000775 sys sys 1019538890 0
 386/bin/usb/usbaudio - 775 sys sys 1134389880 185573
 386/bin/usb/usbd - 775 sys sys 1130594805 129878
@@ -7279,9 +7279,9 @@ sys/man/1/emacs - 664 sys sys 944959673 199
 sys/man/1/eqn - 664 sys sys 1134592617 5655
 sys/man/1/expect - 664 sys sys 1134557311 3014
 sys/man/1/faces - 664 sys sys 1113743326 2395
-sys/man/1/factor - 664 sys sys 957920005 1019
+sys/man/1/factor - 664 sys sys 1135084026 1015
 sys/man/1/file - 664 sys sys 1015024739 1578
-sys/man/1/filter - 664 sys sys 1124885098 4619
+sys/man/1/filter - 664 sys sys 1135083932 6142
 sys/man/1/fmt - 664 sys sys 1070032221 1557
 sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 944959673 735
@@ -12628,7 +12628,7 @@ sys/src/cmd/postscript/trofftable/trofftable.ps - 664 sys sys 944961073 3678
 sys/src/cmd/postscript/trofftable/trofftable.rc - 664 sys sys 984789206 2637
 sys/src/cmd/postscript/trofftable/trofftable.sh - 664 sys sys 984789206 2613
 sys/src/cmd/pr.c - 664 sys sys 1050689592 11172
-sys/src/cmd/primes.c - 664 sys sys 944961351 2126
+sys/src/cmd/primes.c - 664 sys sys 1135081181 2123
 sys/src/cmd/prof.c - 664 sys sys 1124305301 5547
 sys/src/cmd/proof - 20000000775 sys sys 944961622 0
 sys/src/cmd/proof/font.c - 664 sys sys 944961621 8525
@@ -12711,7 +12711,7 @@ sys/src/cmd/rc/getflags.h - 664 sys sys 944961082 185
 sys/src/cmd/rc/glob.c - 664 sys sys 1055698770 4540
 sys/src/cmd/rc/havefork.c - 664 sys sys 1055698771 3473
 sys/src/cmd/rc/haventfork.c - 664 sys sys 1055698771 3122
-sys/src/cmd/rc/here.c - 664 sys sys 1055698771 2497
+sys/src/cmd/rc/here.c - 664 sys sys 1135080780 2504
 sys/src/cmd/rc/io.c - 664 sys sys 1132448641 3752
 sys/src/cmd/rc/io.h - 664 sys sys 1132448641 535
 sys/src/cmd/rc/lex.c - 664 sys sys 1100894085 6100
@@ -13337,8 +13337,8 @@ sys/src/cmd/upas/common/process.c - 664 sys sys 1098803900 3012
 sys/src/cmd/upas/common/sys.h - 664 sys sys 1055699577 2223
 sys/src/cmd/upas/filterkit - 20000000775 sys sys 1018549521 0
 sys/src/cmd/upas/filterkit/dat.h - 664 sys sys 1018549520 107
-sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1075069156 1075
-sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1020313488 4751
+sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1135083942 1070
+sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1135083949 4754
 sys/src/cmd/upas/filterkit/mkfile - 664 sys sys 1048645255 264
 sys/src/cmd/upas/filterkit/pipefrom.sample - 775 sys sys 1041184939 380
 sys/src/cmd/upas/filterkit/pipeto.sample - 664 sys sys 1045505695 1765
@@ -13401,7 +13401,7 @@ sys/src/cmd/upas/send/authorize.c - 664 sys sys 944961322 569
 sys/src/cmd/upas/send/bind.c - 664 sys sys 944961322 3252
 sys/src/cmd/upas/send/cat_mail.c - 664 sys sys 1016904916 1190
 sys/src/cmd/upas/send/dest.c - 664 sys sys 1109511268 4789
-sys/src/cmd/upas/send/filter.c - 664 sys sys 1116769185 2311
+sys/src/cmd/upas/send/filter.c - 664 sys sys 1135083956 2365
 sys/src/cmd/upas/send/gateway.c - 664 sys sys 944961322 499
 sys/src/cmd/upas/send/local.c - 664 sys sys 1031707305 2584
 sys/src/cmd/upas/send/log.c - 664 sys sys 944961322 2090
@@ -13432,7 +13432,7 @@ sys/src/cmd/upas/unesc/mkfile - 664 sys sys 1075080255 164
 sys/src/cmd/upas/unesc/unesc.c - 664 sys sys 1075080255 789
 sys/src/cmd/upas/vf - 20000000775 sys sys 1015096796 0
 sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
-sys/src/cmd/upas/vf/vf.c - 664 sys sys 1124885103 20004
+sys/src/cmd/upas/vf/vf.c - 664 sys sys 1135083959 20043
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166

+ 14 - 0
dist/replica/plan9.log

@@ -23647,3 +23647,17 @@
 1134671489 1 c 386/bin/aux/msexceltables - 775 sys sys 1134669748 81264
 1134909030 0 c sys/src/cmd/tar.c - 664 sys sys 1134907488 22101
 1134930637 0 c 386/bin/tar - 775 sys sys 1134928898 97221
+1135081817 0 c sys/src/cmd/primes.c - 664 sys sys 1135081181 2123
+1135081817 1 c sys/src/cmd/rc/here.c - 664 sys sys 1135080780 2504
+1135085417 0 c sys/man/1/factor - 664 sys sys 1135084026 1015
+1135085417 1 c sys/man/1/filter - 664 sys sys 1135083932 6142
+1135085417 2 c sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1135083942 1070
+1135085417 3 c sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1135083949 4754
+1135085417 4 c sys/src/cmd/upas/send/filter.c - 664 sys sys 1135083956 2365
+1135085417 5 c sys/src/cmd/upas/vf/vf.c - 664 sys sys 1135083959 20043
+1135103422 0 c 386/bin/primes - 775 sys sys 1135101636 38803
+1135103422 1 c 386/bin/rc - 775 sys sys 1135101637 143284
+1135103422 2 c 386/bin/upas/deliver - 775 sys sys 1135101637 100133
+1135103422 3 c 386/bin/upas/filter - 775 sys sys 1135101637 147751
+1135103422 4 c 386/bin/upas/list - 775 sys sys 1135101638 82799
+1135103422 5 c 386/bin/upas/vf - 775 sys sys 1135101638 97135

+ 0 - 2
sys/man/1/factor

@@ -9,12 +9,10 @@ factor, primes \- factor a number, generate large primes
 ]
 .PP
 .B primes
-[
 .I start
 [
 .I finish
 ]
-]
 .SH DESCRIPTION
 .I Factor
 prints

+ 132 - 29
sys/man/1/filter

@@ -9,14 +9,17 @@ filter, list, deliver, token, vf \-  filtering mail
 ]
 .I rcvr
 .I mailbox
-.I "regexp file
 [
 .I "regexp file
-]*
+] ...
 .PP
-.B upas/list add|check
-.I patterns
-.I addrfile ...
+.B upas/list
+[
+.B -d
+]
+.B add|check
+.I patternfile
+.I addressfile ...
 .PP
 .B upas/deliver 
 .I recipient
@@ -30,6 +33,13 @@ filter, list, deliver, token, vf \-  filtering mail
 ]
 .PP
 .B upas/vf
+[
+.B -r
+]
+[
+.B -s 
+.I savefile
+]
 .SH DESCRIPTION
 .PP
 A user may filter all incoming mail by creating
@@ -51,15 +61,20 @@ follows the expression.  The file must be world writable and should
 be append only.
 A message that matches none of the expressions is delivered into
 the user's standard mail box.
-The flags are:
-.TP
-.B h
-the regular expression is matched against the message header
-rather than the address.
-.TP
-.B b
-the regular expression is matched against both the header and the body
-of the message.
+.PP
+By default, 
+.I filter
+matches each regular expression against the message's sender.
+The 
+.B -h
+flag causes 
+.I filter
+to match against the entire header,
+and the
+.B -b
+flag causes
+.I filter
+to match against the entire message (header and body).
 .PP
 For example, to delete any messages of precedence bulk, place in
 your
@@ -133,7 +148,7 @@ directs
 to add a pattern to
 .I patternfile
 for each address in the
-.IR addrssfile 's
+.I addressfiles
 that doesh't already match a pattern.
 .PP
 .IR Token ,
@@ -168,22 +183,110 @@ bound by your profile onto
 .BR /bin .
 .PP
 .I Vf
-takes a mail message as standard input, searches for executable
-MIME attachments, wraps them in a warning message, and appends
-.B .suspect
-to any related filenames.
+(virus filter)
+takes a mail message as standard input
+and searches for executable MIME attachments,
+either rewriting them to be non-executable or
+rejecting the message.
+The behavior depends on the attachment's file name
+extension and MIME content type.
 .B /sys/lib/mimetype
-contains the list of known MIME content types and file extensions.
+contains the list of known extensions and MIME content types.
+The fifth field of each line specifies the 
+safety of a particular file type:
+.B y
+(yes),
+.B m
+(maybe; treated same as yes),
+.B n
+(no),
+.B p
+(previous),
+or
+.B r
+(reject).
 .I Vf
-considers all those for which the fifth field of
-.B mimetype
-is
-.BR n .
-If the script
+allows attachments with safety
+.B y
+or
+.B m
+to pass through unaltered.
+Attachments with safety
+.B n
+both are wrapped in extra MIME headers
+and have
+.B .suspect
+appended to their file names, to avoid
+automatic execution by mail readers.
+Attachments with safety
+.B r
+(currently,
+.BR .bat ,
+.BR .com ,
+.BR .exe ,
+and
+.BR .scr ,
+all Microsoft executable extensions)
+are taken as 
+cause for the entire message to be rejected.
+A safety of
+.B p
+(used for the 
+.B x-gunzip
+mime type)
+causes the previous extension to be tested,
+so that
+.B x.tar.gz
+is treated the same as
+.BR x.tar .
+.PP
+If
 .B /mail/lib/validateattachment
-exists and is executable, each attachment
-is passed, as a mail message, to the script
-for further examination.
+exists and is executable, 
+.B vf
+runs it on all attachments with safety 
+.B n
+(attachments it would normally sanitize).
+If
+.IR validateattachment 's
+exit status contains the string
+.L discard ,
+.I vf
+rejects the entire message.
+If the status contains the string
+.L accept ,
+.I vf 
+does not sanitize the attachment.
+Otherwise, 
+.I vf 
+sanitizes the attachment as before.
+The standard 
+.I validateattachment
+uses
+.IR file (1)
+to determine the file type.
+It accepts text and image files
+and discards messages containing
+executables or
+.I zip
+(see
+.IR gzip(1))
+archives of executables.
+.PP
+The
+.B -r
+option causes
+.I vf
+not to sanitize MIME attachments, only to
+reject messages it determines to be viruses.
+The
+.B -s
+option causes
+.I vf
+to log all attachments of safety
+.B r
+in the mail box 
+.IR savefile .
 .SH FILES
 .TF /mail/box/*/dead.letter
 .TP
@@ -191,7 +294,7 @@ for further examination.
 mail filter
 .TP
 .B /sys/lib/mimetype
-mime content types
+MIME content types
 .TP
 .B /mail/lib/validateattachment
 attachment checker

+ 1 - 1
sys/src/cmd/primes.c

@@ -40,7 +40,7 @@ main(int argc, char *argp[])
 	double k, temp, v, limit, nn;
 
 	if(argc <= 1) {
-		fprint(2, "usage: primes starting [ending]\n");
+		fprint(2, "usage: primes start [finish]\n");
 		exits("usage");
 	}
 	nn = atof(argp[1]);

+ 1 - 1
sys/src/cmd/rc/here.c

@@ -62,7 +62,7 @@ readhere(void)
 		while((c = rchr(runq->cmdfd))!=EOF){
 			if(c=='\n' || s==&line[NLINE]){
 				*s='\0';
-				if(strcmp(line, tag)==0) break;
+				if(tag && strcmp(line, tag)==0) break;
 				if(subst)
 					psubst(f, line);
 				else pstr(f, line);

+ 1 - 1
sys/src/cmd/upas/filterkit/deliver.c

@@ -4,7 +4,7 @@
 void
 usage(void)
 {
-	fprint(2, "usage: %s recipient fromaddr-file mbox\n", argv0);
+	fprint(2, "usage: %s recipient fromfile mbox\n", argv0);
 	exits("usage");
 }
 

+ 1 - 1
sys/src/cmd/upas/filterkit/list.c

@@ -30,7 +30,7 @@ String	*mbox;
 static void
 usage(void)
 {
-	fprint(2, "usage: %s 'check|add' patternfile addr [addr*]\n", argv0);
+	fprint(2, "usage: %s add|check patternfile [addressfile ...]\n", argv0);
 	exits("usage");
 }
 

+ 11 - 4
sys/src/cmd/upas/send/filter.c

@@ -7,6 +7,13 @@ char *subjectarg;
 
 char *findbody(char*);
 
+void
+usage(void)
+{
+	fprint(2, "usage: upas/filter [-bh] rcvr mailbox [regexp file] ...\n");
+	exits("usage");
+}
+
 void
 main(int argc, char *argv[])
 {
@@ -31,13 +38,13 @@ main(int argc, char *argv[])
 		header = 1;
 		body = 1;
 		break;
+	default:
+		usage();
 	} ARGEND
 
 	Binit(&bin, 0, OREAD);
-	if(argc < 2){
-		fprint(2, "usage: filter rcvr mailfile [regexp mailfile ...]\n");
-		exits("usage");
-	}
+	if(argc < 2)
+		usage();
 	mp = m_read(&bin, 1, 0);
 
 	/* get rid of local system name */

+ 18 - 11
sys/src/cmd/upas/vf/vf.c

@@ -116,6 +116,13 @@ Mtype *mtypes;
 int justreject;
 char *savefile;
 
+void
+usage(void)
+{
+	fprint(2, "usage: upas/vf [-r] [-s savefile]\n");
+	exits("usage");
+}
+
 void
 main(int argc, char **argv)
 {
@@ -124,11 +131,14 @@ main(int argc, char **argv)
 		justreject = 1;
 		break;
 	case 's':
-		savefile = ARGF();
-		if(savefile == nil)
-			exits("usage");
+		savefile = EARGF(usage());
 		break;
-	}ARGEND;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc)
+		usage();
 
 	Binit(&in, 0, OREAD);
 	Binit(&out, 1, OWRITE);
@@ -415,8 +425,7 @@ savetmp(Part *p)
 }
 
 /*
- * XXX save the decoded file, run 9 unzip -tf on it, and then
- * look at the file list.
+ * Run the external checker to do content-based checks.
  */
 static int
 runchecker(Part *p)
@@ -483,6 +492,9 @@ problemchild(Part *p)
 	if(runchecker(p) > 0)
 		return p;
 
+	if(justreject)
+		return p;
+
 fprint(2, "x\n");
 	syslog(0, "mail", "vf wrapped %s %s", p->type?s_to_c(p->type):"?",
 		p->filename?s_to_c(p->filename):"?");
@@ -871,8 +883,6 @@ badfile(char *name)
 				return 2;
 			}
 		}
-	if(justreject)
-		return 0;
 	return 1;
 }
 
@@ -887,9 +897,6 @@ badtype(char *type)
 	char *s, *fix;
 	int rv = 1;
 
-	if(justreject)
-		return 0;
-
 	fix = s = strchr(type, '/');
 	if(s != nil)
 		*s++ = 0;