MailScanner logwatch script

Denis Beauchemin Denis.Beauchemin at
Fri Jul 28 18:39:12 IST 2006

Tony Stocker a écrit :
> Hello All,
> I'm getting a lot of things listed under "Unmatched Entries" with the
> logwatch script for MailScanner.  They fall into a couple of
> categories:
> ...
> Does anyone have any ideas how to tune things so this stuff doesn't
> end up in there?  There are a lot of entry types here so I'm loathe to
> rewrite the mailscanner logwatch script and I'm not even sure how to
> write a filter for what I called the "Message conversion" entries that
> wouldn't catch everything.
The script is in /etc/log.d/scripts/services/mailscanner and is a 
standard Perl script.  I modify them every time they don't catch the 
things that annoy me.  At the beginning of the script there is a loop 
that just tosses lines away:
         ( $ThisLine =~ m/Message .+ added TNEF contents/ ) or
         ( $ThisLine =~ m/Content Checks: Detected and will convert 
HTML/ ) ) {
      # We don't care about these

Just add your own patterns BEFORE the last line:
         ( $ThisLine =~ m/Message .+ added TNEF contents/ ) or
         ( $ThisLine =~ m/this is my first patterm match/ ) or
         ( $ThisLine =~ m/this is my second patterm match/ ) or
         ( $ThisLine =~ m/Content Checks: Detected and will convert 
HTML/ ) ) {
      # We don't care about these

If you want the script to count some lines you'll have to look further 
down in the script and copy the behaviour of some other pattern match.  
Then you also have to add a block to print out the totals you counted.  
It's really simple.


  °v°   Denis Beauchemin, analyste
 /(_)\  Université de Sherbrooke, S.T.I.
  ^ ^   T: 819.821.8000x2252 F: 819.821.8045

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3226 bytes
Desc: S/MIME Cryptographic Signature
Url :

More information about the MailScanner mailing list