summaryrefslogtreecommitdiff
path: root/localmkpostfixvirtual
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-03-05 02:25:56 +0000
committerJonas Smedegaard <dr@jones.dk>2002-03-05 02:25:56 +0000
commit7ab8617fdf4d9cc482ed03ed7168480de96550c2 (patch)
treebe20508938b30718ba24b1c834090ca5e0001b23 /localmkpostfixvirtual
parent4ee37b76bd3c95ac754a9c9ae11cd118fd465b27 (diff)
localmkpostfixvirtual: Alow dash ("-") in email domainpart as well. Look for localpart hints in root account.
Diffstat (limited to 'localmkpostfixvirtual')
-rwxr-xr-xlocalmkpostfixvirtual13
1 files changed, 11 insertions, 2 deletions
diff --git a/localmkpostfixvirtual b/localmkpostfixvirtual
index 099852d..4a996e6 100755
--- a/localmkpostfixvirtual
+++ b/localmkpostfixvirtual
@@ -14,7 +14,7 @@ function get_fullname_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F
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_domain() { echo $1 | egrep "^@[\.[:alnum:]-]+$" | sed -e 's/@//'; }
function get_account() { echo $1 | egrep "^[\.[:alnum:]-]+@($gid)?$" | sed -e 's/@.*//'; }
loop=""
@@ -28,7 +28,16 @@ for gid in $@; do
fi
loop=true
echo "$maildomain VIRTUAL"
- echo "postmaster@$maildomain root"
+ uid_seen=""
+ for mailaccountchunk in `get_other_field root`; do
+ for mailaccount in `get_account $mailaccountchunk`; do
+ echo "$mailaccount@$maildomain root"
+ uid_seen=true
+ done
+ done
+ if [ ! $uid_seen ]; then
+ echo "postmaster@$maildomain root"
+ fi
echo
mailusers=""
for mailgroup in `get_roomnumber_field $gid`; do