From c6589189b417de33b4bfcce2d48772cbfa51ad3c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 14 Mar 2002 12:15:33 +0000 Subject: Revert the rename of user-mailaddr - to avoid the need of explaining to sudoers the difference between official debian stuff and local hacks (which is the reason for the prepending local*). --- user-mailaddr | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 user-mailaddr (limited to 'user-mailaddr') diff --git a/user-mailaddr b/user-mailaddr new file mode 100755 index 0000000..801d147 --- /dev/null +++ b/user-mailaddr @@ -0,0 +1,18 @@ +#!/bin/sh +# +# /usr/local/sbin/localusermailaddr +# Copyright 2002 Jonas Smedegaard +# +# $Id: user-mailaddr,v 1.1 2002-03-14 12:15:33 jonas Exp $ +# +# List mail addresses attached to an account +# + +for uid in $@; do + echo "$uid@`cat /etc/mailname`" + grep "[[:space:]]$uid\$" `ls /etc/postfix/virtual* | egrep -v '\.(bak|db|dpkg-new|dpkg-old|old)$'` | sed -e 's/.*://' -e 's/[[:space:]].*//' | sort + for otheruid in `grep "^[[:alnum:]-]\+:[[:space:]]\+$uid" /etc/aliases | sed 's/:.*//'`; do + echo "$otheruid@`cat /etc/mailname`" + grep "[[:space:]]$otheruid\$" `ls /etc/postfix/virtual* | egrep -v '\.(bak|db|dpkg-new|dpkg-old|old)$'` | sed -e 's/.*://' -e 's/[[:space:]].*//' | sort + done +done -- cgit v1.2.3