summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalshowmailreceived5
1 files changed, 3 insertions, 2 deletions
diff --git a/localshowmailreceived b/localshowmailreceived
index 3d8fe19..b1a6511 100755
--- a/localshowmailreceived
+++ b/localshowmailreceived
@@ -3,7 +3,7 @@
# /usr/local/sbin/localshowmailreceived
# Copyright 2007 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localshowmailreceived,v 1.1 2007-09-15 02:06:16 jonas Exp $
+# $Id: localshowmailreceived,v 1.2 2007-09-27 21:32:22 jonas Exp $
#
# List recently received emails
#
@@ -11,7 +11,8 @@
#
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 \
- | egrep -- ' -> <'"$1"'@homebase.dk>' \
+ | egrep -- ' -> <'"$1"'@'"$maildomain" \
| sed 's/^\(.\{15\}\) [^)]*) \([^,]*\), [^]]*] \([^ ]*\) -> .*Message-ID: \([^>,]*>\?\).*/\1 \3 (\4) \2/'