From 190df74d4481e42879e28db390baeb82f1ef052f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 27 Sep 2007 21:32:22 +0000 Subject: Use /etc/mailname (not hardcoded homebase.dk). --- localshowmailreceived | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'localshowmailreceived') 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 # -# $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/' -- cgit v1.2.3