blob: d83f394dcd3dcbb9b0d5d52dd1f3c75fb0d71374 (
plain)
- #!/bin/sh
- #
- # /usr/local/sbin/localshowmailreceivedfromdomain
- # Copyright 2007 Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: localshowmailreceivedfromdomain,v 1.2 2007-09-15 02:06:16 jonas Exp $
- #
- # List emails recently received from a certain domain
- #
- # TODO: Handle other indicatiors than AMaViS
- #
- logfiles=1
- find /var/log -name 'mail.log*' | sort -nr -t. -k3 | tail -n "$logfiles" | xargs zcat -f \
- | egrep -- '@'"$1"'> -> ' \
- | sed 's/^\(.\{15\}\) [^)]*) \([^,]*\), [^]]*] \([^ ]*\) -> .*Message-ID: \([^>,]*>\?\).*/\1 \3 (\4) \2/'
|