blob: 4d3bc5a9dbe8b09d2c69a2e5735392344b343f43 (
plain)
- #!/bin/sh
- #
- # /usr/local/sbin/localshowmaildelivered
- # Copyright 2007 Jonas Smedegaard <dr@jones.dk>
- #
- # $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="${logfiles:-1}"
- find /var/log -name 'mail.log*' | sort -nr -t. -k3 | tail -n "$logfiles" | xargs zcat -f \
- | egrep -- 'deliver\(('"$1"')\).*saved mail to ' \
- | sed 's/^\(.\{15\}\) [^)]*): msgid=/\1 (/;s/: saved mail to/)/;s/ INBOX$//'
|