On Thu, 2013-07-25 at 01:10 +0200, Mark Martinec wrote: > The SA 3.3.2 and the current 3.4.0 both contain a code > that copies stdin to a temporary file in order to make the > ArchiveIterator happy, which only accepts files or directories. > > So the only current advantage of passing a message on stdin is a > more comfortable use, but there is no speed or disk I/O advantage. > > I'm not sure when this feature was introduced but left undocumented.
Dunno either, but I'd guess around the time AI was introduced and sa-learn --dir and --file options got deprecated. > I very much doubt it will ever go away, so you can use it, unless > you want to comply with the current official documentation, > which only mentions files. Only files, in a rather fuzzy way. The -f and (ignored) --dir options indicate support for directories, without the docs mentioning it. Another one to document properly. I too very much doubt it will ever go away. The simple 'spamassassin' front-end accepts STDIN, as documented in the man-page and in probably every single example for debugging. And both share the same code that supports STDIN for SA in the first place... # ArchiveIterator doesn't really like STDIN, so if "-" is specified # as a target, make it a temp file instead. There's quite a blob duplicated in sa-learn.raw and spamassassin.raw. Candidate for moving to AI? -- char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1: (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}