[Logcheck-devel] Bug#344832: correct subject header

General Stone generalstone at gmx.net
Mon Dec 26 19:16:36 UTC 2005


Package: logcheck
Version: Version: 1.2.3
Severity: wishlist

The subject line is not correct, if any of these options
'ATTACKSUBJECT', 'SECURITYSUBJECT' and 'EVENTSSUBJECT' are combined in
a report. The subject line only include the first event of a report.
This is not so good for report mail filtering. The patch in the
attachment correct this.

-- 
Bill Gates said: "It requires Windows XP or better", so I installed Linux.
-------------- next part --------------
--- logcheck	2005-04-19 17:58:39.000000000 +0200
+++ /usr/sbin/logcheck	2005-12-26 16:04:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /bin/bash
 #
 # Copyright (C) 2004-2005 Debian Logcheck Team 
 #                         <logcheck-devel at alioth.lists.debian.org>
@@ -6,6 +6,8 @@
 # Copyright (C) 1999-2002 Rene Mayrhofer <rmayr at debian.org>
 # Copyright (C) 1996-1997 Craig Rowland <crowland at psionic.com>
 
+# Modified by Markus Nass <generalstone at gmx.net>
+
 # This file is part of Logcheck
 
 # Logcheck is free software; you can redistribute it and/or modify
@@ -740,10 +742,21 @@
 fi
 
 # If there are results, mail them to sysadmin
+SUBJECT=""
+
 if [ $ATTACK -eq 1 ]; then
-    sendreport "$ATTACKSUBJECT"
+    SUBJECT="$ATTACKSUBJECT"
+fi
+if [[ $SUBJECT != "" ]] && [ $SECURITY -eq 1 ]; then
+    SUBJECT="$SUBJECT, $SECURITYSUBJECT"
 elif [ $SECURITY -eq 1 ]; then
-    sendreport "$SECURITYSUBJECT"
+    SUBJECT="$SECURITYSUBJECT"
+fi
+if [[ $SUBJECT != "" ]] && [ $SYSTEM -eq 1 ]; then
+    SUBJECT="$SUBJECT, $EVENTSSUBJECT"
 elif [ $SYSTEM -eq 1 ]; then
-    sendreport "$EVENTSSUBJECT"
+    SUBJECT="$EVENTSSUBJECT"
+fi
+if [[ $SUBJECT != "" ]]; then
+    sendreport "$SUBJECT"
 fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20051226/a05df06b/attachment.pgp 


More information about the Logcheck-devel mailing list