On Fri, 2012-12-28 at 16:51 -0800, Sean Tout wrote: > Hi John, > > Thank you much for the help. I have been trying to avoid executing > spamassassin shell commands from perl since it takes a significant amount of > time~=12 seconds for each email. I have tried the below script, which works > but of course not in a favorable especially for processing 20,000+ emails in > spfiles folder. > > @files = </home/sean/code/spam/spfiles/*>; > my $outfile = '>>mailrep_out.txt'; > open (MYFILE, $outfile); > foreach $file (@files) { > $cmd = "spamassassin --test-mode < ".$file." >>mail_out.txt"; > system ($cmd); > } > close(MYFILE); > > Regards, > > -Sean. > As, from this, it seems that you have already got the messages held as individual files in the /home/sean/code/spam/spfiles/ directory, why not feed them directly to spamd with a small bash script:
for m in /home/sean/code/spam/spfiles/* do spamc <$m | pipeline to analyse and store spamd replies done which should run a lot faster than calling spamassassin directly because spamd will only need to be loaded once at the start of the run. ... or did I miss something obvious? Martin