summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalmkpostfixvirtual3
1 files changed, 2 insertions, 1 deletions
diff --git a/localmkpostfixvirtual b/localmkpostfixvirtual
index 7c37f4d..0328b09 100755
--- a/localmkpostfixvirtual
+++ b/localmkpostfixvirtual
@@ -13,6 +13,7 @@
function get_fullname_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $1}'; }
function get_roomnumber_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $2}'; }
function get_other_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $5}'; }
+function get_groups() { groups $1 | sed -e 's/^.*: //' -e "s/\( \+\|^\)$1\( \+\|$\)/\1/"; }
function get_domain() { echo $1 | egrep "^@[\.[:alnum:]]+$" | sed -e 's/@//'; }
function get_account() { echo $1 | egrep "^[\.[:alnum:]]+@($gid)?$" | sed -e 's/@.*//'; }
@@ -35,7 +36,7 @@ for gid in $@; do
done
# for uid in `members $gid | sort`; do
for uid in `echo $mailusers | tsort | uniq | sort`; do
- echo "# `get_fullname_field $uid` (`get_roomnumber_field $uid`)"
+ echo "# `get_fullname_field $uid` (`get_groups $uid`)"
uid_seen=""
for mailaccountchunk in `get_other_field $uid`; do
for mailaccount in `get_account $mailaccountchunk`; do