On Mon, 2011-10-10 at 15:36 +0000, Sharma, Ashish wrote: > I want to create a report of sample emails with the spam scores > generated in accordance with permissible limits after deploying the > spamassassin updated rulesets. > > For that I am trying out on a shell script providing with my test > email messages > I do something similar, but keep my test messages as separate text files in a directory because I find that easier to manage. I do approximately this on a computer that's entirely separate from my mail host and runs its own copy of spamd so I can mess around with its rule sets and configuration without upsetting the live copy of SA. The testing SA runs in effectively the same configuration as my live SA because the test rig has an identical set of SA config files: when I'm happy with the test operation I export the entire set of configuration files to the live system and then restart spamd. Here's the guts of the test system:
for f in testdata/*.txt do spamc <testdata/$f | grep '^X-spam-status: ' >>result.txt done analysis_prog result.txt rm result.txt My analysis program is an awk script: that or Perl are probably the weapons of choice for writing this type of program. You probably need to feed the messages to amavis-new since it is creating a special header, rather than to spamc/spamd as I do, but I question whether your command line is right since amavis has direct access to the Perl modules that make up spamassassin. Disclaimer: the previous paragraph contains almost everything I know about amavis-new. Somebody else may be able to help with the amavis-new command line, but not me since I don't use it. What I do know is that Postfix passes a message at a time to spamc/spamd so its entirely probable it does the same with amavis-new if you're running that as a Postfix service. Martin