[Logcheck-commits] martin f. krafft: Add Auto-Submitted header to outgoing mails (closes: #489172).

Martin F. Krafft madduck at alioth.debian.org
Sun Aug 31 19:24:21 UTC 2008


Module: logcheck
Branch: master
Commit: 8e4852089a6ee4a8caf5d8fdd42ce6dc58082568
URL:    http://git.debian.org/?p=logcheck/logcheck.git;a=commit;h=8e4852089a6ee4a8caf5d8fdd42ce6dc58082568

Author: martin f. krafft <madduck at debian.org>
Date:   Sun Aug 31 19:35:53 2008 +0100

Add Auto-Submitted header to outgoing mails (closes: #489172).

---

 debian/changelog |    2 ++
 src/logcheck     |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0d0b018..44d9d83 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ logcheck (1.3) unstable; urgency=low
   * Remove most messages from cracking.d/logcheck and split up the remaining
     ones into separate files.
 
+  * Add Auto-Submitted header to outgoing mails (closes: #489172).
+
   * Thanks to Hanspeter Kunz for all his patches.
 
   * ignore.d.server/dovecot:
diff --git a/src/logcheck b/src/logcheck
index ee94707..573e244 100755
--- a/src/logcheck
+++ b/src/logcheck
@@ -59,6 +59,9 @@ REPORTLEVEL="server"
 # default to sent mails to local root
 SENDMAILTO="root"
 
+# by default, append a header
+MAILARGS="-a 'Auto-Submitted: auto-generated'"
+
 # Set the default subject lines
 ATTACKSUBJECT="Security Alerts"
 SECURITYSUBJECT="Security Events"
@@ -171,7 +174,7 @@ Also verify that the logcheck user can read all files referenced in
 
 $(export)
 EOF
-	} | mail -s "Logcheck: $HOSTNAME $DATE exiting due to errors" \
+	} | mail $MAILARGS -s "Logcheck: $HOSTNAME $DATE exiting due to errors" \
 	    "$SENDMAILTO"
     
     elif [ $MAILOUT -eq 1 ]; then
@@ -306,7 +309,7 @@ sendreport() {
             echo Could not send report as attachment, nail not installed >> $TMPDIR/report
           fi
         fi
-        cat $TMPDIR/report | mail -s "$subject" "$SENDMAILTO"
+        cat $TMPDIR/report | mail $MAILARGS -s "$subject" "$SENDMAILTO"
     fi
 }
 




More information about the Logcheck-commits mailing list