On Wed, 2009-05-06 at 01:43 -0600, ɹןʇnqן wrote: > The trouble appears to me to be that sa-learn has no concept of > whether or not it has learned a message or not. Since all IMAP > messages are stored with unique names, is there some easy way to > create a cache of the messages it has checked and have it ignore those > messages?
SA does know about mail it already learned. However, for various reasons it is *not* based on the file name. An obvious reason would be support for mbox format. :) And auto-learning before the mail has been passed on to the MDA. Then there's the problem that even with Maildir format, file names (think flags) are not guaranteed to remain static... To determine if a mail already has been learned, SA needs to have a look at the mail. > I suppose I could do something like: > > find $HOME/Maildir/.SPAM/{cur,new} -type f -ctime -1 -exec /usr/local/ > bin/sa-learn --spam {} \; Something like that, yes. It definitely makes sense to 'find' the messages delivered since the last sa-learn run. That line however is *way* too inefficient, spawning an sa-learn Perl process for each message. Instead, call sa-learn a single time only. Probably by snipering the last day's spam into a temp folder first, and simply pointing sa-learn at that dir. -- char *t="\10pse\0r\0dtu...@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; }}}