> -----Original Message----- > From: Bart Schaefer > Sent: Sunday, August 24, 2003 3:02 PM > > > On Sun, 24 Aug 2003, Gary Funck wrote: > > > # Otherwise, just test an excerpt, and deliver spam > > # directly into big-spam.mbox. > > :0E: > > * ! ?(head -c 7500; echo ""; tail -c 7500) | spamassassin -e > > big-spam.mbox > > Even that won't work, because "head -c 7500" will consume the entire > message so "tail -c 7500" will return nothing. All that aside from the > fact that this is processing only the header, not the body. >
Actually no. This may or may not be implementation specific, but consider the following example: % seq 1 10 | ( head -c 6 ; tail -c 7) 1 2 3 8 9 10 It seems that 'head' when invoked with the -c switch doesn't read until end-of-file, and leaves the input pointer positioned where it left off. However, in normal operation, when operating on full lines, head reads until EOF. That said, I did leave HB off the flags for the filter rule (which you corrected in your example), which means the invocation of head/tail would only operate on the header, because that is what is passed to the tests by default. > So you really need something along the lines of > > ------ > SATEMP = "/tmp/sa$$" > TRAP = "rm -f $SATEMP" > > :0EHB: > * ? head -c 7500 > $SATEMP > * ? (echo ""; tail -c 7500) >> $SATEMP > * ! ? spamassassin -e < $SATEMP > big-spam.mbox > ------ Rewriting your rule above, :0EHB: * ! ? (head -c 7500; echo ""; tail -7500) | spamassassin -e big-spam.mbox should have the intended effect. > > I experimented in the past with passing only the headers of large spams > through SA (with content-type deleted so it won't try to parse MIME). > That was actually fairly accurate, but I stopped doing it when Bayes > came along to avoid feeding mangled messages to the auto-learner. > > That's a good point. This approach would be quite incompatible with auto-learn. Would probably confuse Razor in no small way as well. When I ran my tests, I used local tests only, as a base line. ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk