[Logcheck-devel] Bug#402739: attaching logcheck output instead of inline inclusion
Martin F Krafft
mail at martin-krafft.net
Tue Dec 12 12:07:44 UTC 2006
Package: logcheck
Version: 1.2.51
Severity: wishlist
Tags: patch
This patch add the ability to attach logcheck output to mails
instead of including it inline.
----- Forwarded message from Roland Kruggel <rkruggel at bbf7.de> -----
mail1:/etc/logcheck# diff -uprN logcheck.conf.org logcheck.conf
--- logcheck.conf.org 2006-11-28 20:37:22.918143500 +0100
+++ logcheck.conf 2006-11-28 21:03:31.604180250 +0100
@@ -28,6 +28,11 @@ REPORTLEVEL="server"
SENDMAILTO="root"
+# Send the results as attachment or not.
+# 0=not as attachment; 1=as attachment
+# Default ist 0
+MAILASATTACH=0
+
# Should the hostname in the subject of generated mails be fully
qualified?
FQDN=1
mail1:/usr/sbin# diff -uprN logcheck.org logcheck
--- logcheck.org 2006-11-28 19:52:15.892965000 +0100
+++ logcheck 2006-11-28 21:01:15.467672250 +0100
@@ -81,6 +81,7 @@ SYSLOG_SUMMARY="/usr/bin/syslog-summary"
INTRO=1
LOGCHECKDEBUG=0
MAILOUT=0
+MAILASATTACH=0
NOCLEANUP=0
REBOOT=0
FQDN=0
@@ -296,7 +297,11 @@ sendreport() {
debug "Sent report to STDOUT"
else
debug "Sending report: '$subject' to $SENDMAILTO"
+ if [ $MAILASATTACH -eq 1 ]; then
+ echo -e "Report at the attachment" |
nail -s "$subject" -a "$TMPDIR/report" "$SENDMAILTO"
+ else
cat $TMPDIR/report | mail -s "$subject" "$SENDMAILTO"
+ fi
fi
}
----- End forwarded message -----
--
Martin F. Krafft <mail at martin-krafft.net> http://martin-krafft.net/
Debian developer, open source software researcher
Author of "The Debian System" (http://debiansystem.info/)
Linux and network security consultant
Spamtraps: <mail.bogus at martin-krafft.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
Url : http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20061212/d9da283f/attachment.pgp
More information about the Logcheck-devel
mailing list