summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2007-09-27 21:43:37 +0000
committerJonas Smedegaard <dr@jones.dk>2007-09-27 21:43:37 +0000
commit6e3c734e05959e2865d8ebce78735e1ce00ef6a3 (patch)
tree774ef02d5ca423f422372ff4794afa60c98a8b21
parent190df74d4481e42879e28db390baeb82f1ef052f (diff)
Allow logfiles to be overridden on commandline.
-rwxr-xr-xlocalshowmaildelivered4
-rwxr-xr-xlocalshowmailreceived4
-rwxr-xr-xlocalshowmailreceivedfromdomain4
3 files changed, 6 insertions, 6 deletions
diff --git a/localshowmaildelivered b/localshowmaildelivered
index 6e683eb..4d3bc5a 100755
--- a/localshowmaildelivered
+++ b/localshowmaildelivered
@@ -3,14 +3,14 @@
# /usr/local/sbin/localshowmaildelivered
# Copyright 2007 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localshowmaildelivered,v 1.3 2007-09-15 02:06:16 jonas Exp $
+# $Id: localshowmaildelivered,v 1.4 2007-09-27 21:43:37 jonas Exp $
#
# List recently delivered emails
#
# TODO: Handle other delivery methods than dovecot
#
-logfiles=1
+logfiles="${logfiles:-1}"
find /var/log -name 'mail.log*' | sort -nr -t. -k3 | tail -n "$logfiles" | xargs zcat -f \
| egrep -- 'deliver\(('"$1"')\).*saved mail to ' \
diff --git a/localshowmailreceived b/localshowmailreceived
index b1a6511..468f106 100755
--- a/localshowmailreceived
+++ b/localshowmailreceived
@@ -3,14 +3,14 @@
# /usr/local/sbin/localshowmailreceived
# Copyright 2007 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localshowmailreceived,v 1.2 2007-09-27 21:32:22 jonas Exp $
+# $Id: localshowmailreceived,v 1.3 2007-09-27 21:43:37 jonas Exp $
#
# List recently received emails
#
# TODO: Handle other indicatiors than AMaViS
#
-logfiles=1
+logfiles="${logfiles:-1}"
maildomain=$(if [ -r /etc/mailname ]; then head -n 1 /etc/mailname; fi;)
find /var/log -name 'mail.log*' | sort -nr -t. -k3 | tail -n "$logfiles" | xargs zcat -f \
diff --git a/localshowmailreceivedfromdomain b/localshowmailreceivedfromdomain
index d83f394..ab84bb8 100755
--- a/localshowmailreceivedfromdomain
+++ b/localshowmailreceivedfromdomain
@@ -3,14 +3,14 @@
# /usr/local/sbin/localshowmailreceivedfromdomain
# Copyright 2007 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localshowmailreceivedfromdomain,v 1.2 2007-09-15 02:06:16 jonas Exp $
+# $Id: localshowmailreceivedfromdomain,v 1.3 2007-09-27 21:43:37 jonas Exp $
#
# List emails recently received from a certain domain
#
# TODO: Handle other indicatiors than AMaViS
#
-logfiles=1
+logfiles="${logfiles:-1}"
find /var/log -name 'mail.log*' | sort -nr -t. -k3 | tail -n "$logfiles" | xargs zcat -f \
| egrep -- '@'"$1"'> -> ' \