diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-03-14 12:15:33 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-03-14 12:15:33 +0000 |
commit | c6589189b417de33b4bfcce2d48772cbfa51ad3c (patch) | |
tree | 0eecd1b1e968f29ff3e58f36733e0591e110bdbd /user-mailaddr | |
parent | 38bb077b9cca1fca6874177cd2dcf33ecb9ddf1f (diff) |
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*).
Diffstat (limited to 'user-mailaddr')
-rwxr-xr-x | user-mailaddr | 18 |
1 files changed, 18 insertions, 0 deletions
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 <dr@jones.dk> +# +# $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 |