summaryrefslogtreecommitdiff
path: root/localshowmailreceivedfromdomain
blob: a671408e1d752f7682bc6b8147a331a254eeb04b (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/sbin/localshowmailreceivedfromdomain
  4. # Copyright 2007 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: localshowmailreceivedfromdomain,v 1.1 2007-09-15 01:53:15 jonas Exp $
  7. #
  8. # List emails recently received from a certain domain
  9. #
  10. # TODO: Handle other indicatiors than AMaViS
  11. #
  12. (zcat /var/log/syslog.{7,6,5,4,3,2,1}.gz; cat /var/log/syslog) | egrep -- '@'"$1"'> -> ' | sed 's/^\(.\{15\}\) [^)]*) \([^,]*\), [^]]*] \([^ ]*\) -> .*Message-ID: \([^>,]*>\?\).*/\1 \3 (\4) \2/'