[Techtalk] perl help

Emma Rath emma at kiddiesgames.com
Wed Oct 15 12:31:45 UTC 2008


Hi,

I recently joined this email group, because I am trying to use Linux all
the time as my working computer now instead of Windows, but there are
still a few things I need that I haven't got to work technically yet on
Linux.

I think that if your perl program is executing the entire following
line :

if (!defined $FILE) { $FILE='^mail.log$' }  # regex

then the mail log file it will be trying to read further down will be :

^maillog$

But you said that your mail log file is called :

mail.log

So I think that the line should read :

if (!defined $FILE) { $FILE='mail.log' }  

I don't think that the regex (regular expression) characters of ^ and $
have any place there in the assignment line $FILE='mail.log'

Emma

> Message: 6
> Date: Tue, 14 Oct 2008 22:22:04 -0700
> From: Maria McKinley <maria at shadlen.org>
> Subject: [Techtalk] perl help
> To: 'Techtalk' <techtalk at linuxchix.org>
> Message-ID: <48F57DFC.9000203 at shadlen.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hello all,
> 
> This talk about spam got me started looking at my spam filter again, 
> since it has been a while. I ran across a perl script to analyze mail 
> logs to see how the spamfilter is doing.
> 
> http://www.rulesemporium.com/programs/sa-stats-1.0.txt
> 
> Unfortunately, I'm not too good with perl, and I can't figure out why I 
> am not getting any good stats. I assume it is probably because it is 
> looking in the wrong logs or something. The default directory seems 
> correct, /var/log, so I changed this line
> 
> if (!defined $FILE) { $FILE='^maillog$' }  # regex
> 
> to this:
> 
> if (!defined $FILE) { $FILE='^mail.log$' }  # regex
> 
> because my mail log is called mail.log (I also tried using just mail), 
> but this didn't help.
> 
> Here is the output, which cannot possibly be coming from my mail log.
> 
> ella:~# ./sa-stats.pl -r @shadlen.org
> 
> SPAM STATS FOR @shadlen.org
> ------------------------------------------------------------
> Email:        0  Autolearn:     0  AvgScore:   0.00  AvgScanTime:  0.00 sec
> Spam:         0  Autolearn:     0  AvgScore:   0.00  AvgScanTime:  0.00 sec
> Ham:          0  Autolearn:     0  AvgScore:   0.00  AvgScanTime:  0.00 sec
> 
> Time Spent Running SA:         0.00 hours
> Time Spent Processing Spam:    0.00 hours
> Time Spent Processing Ham:     0.00 hours
> 
> TOP SPAM RULES FIRED FOR @shadlen.org
> ----------------------------------------------------------------------
> RANK	RULE NAME               	COUNT  %OFMAIL %OFSPAM  %OFHAM
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> 
> TOP HAM RULES FIRED FOR @shadlen.org
> ----------------------------------------------------------------------
> RANK	RULE NAME               	COUNT  %OFMAIL %OFSPAM  %OFHAM
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> 
> Any hints? Maybe just tell me how to print out what directory/file it 
> thinks it is suppose to use?
> 
> thanks,
> maria
> 
> 




More information about the Techtalk mailing list