From 86edfa61305162fa24a0354abe20c5a7d6c83a87 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 8 Sep 2003 16:00:52 +0000 Subject: use 'members maildomains' as default input, and add usual commands to header. --- localmkpostfixvirtual | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'localmkpostfixvirtual') diff --git a/localmkpostfixvirtual b/localmkpostfixvirtual index a4d2c83..3d8bb82 100755 --- a/localmkpostfixvirtual +++ b/localmkpostfixvirtual @@ -3,7 +3,7 @@ # /usr/local/sbin/localmkpostfixvirtual # Copyright 2001-2002 Jonas Smedegaard # -# $Id: localmkpostfixvirtual,v 1.12 2003-05-27 00:46:13 jonas Exp $ +# $Id: localmkpostfixvirtual,v 1.13 2003-09-08 16:00:52 jonas Exp $ # # Generate virtual file for postfix # @@ -15,6 +15,14 @@ # The user of each mailgroup should have hints like "@domain1 @domain2" # for each hosted maildomain. # +# Generate virtual file like this: +# +# # ( cd /etc/postfix && localmkpostfixvirtual > virtual.new && diff virtual virtual.new ) +# +# ..and if the changes are correct, activate the new virtual file: +# +# # ( cd /etc/postfix && mv virtual.new virtual && postmap virtual ) +# # Optional: Several mailgroups can be tied together (when amount of hints # exceeds the limit of the "Other" field: List them all in # "Office" or "roomnumber" field of primary mailgroup (include the @@ -69,7 +77,12 @@ function print_accounts() { } loop="" -for gid in $@; do +if [ $# -lt 1 ]; then + mailgroups="`members maildomains`" +else + mailgroups="$@" +fi +for gid in $mailgroups; do for maildomainchunk in `get_other_field $gid`; do for maildomain in `get_domain $maildomainchunk`; do if [ $loop ]; then @@ -98,3 +111,4 @@ for gid in $@; do done done done +test -f /etc/postfix/virtual.addon && cat /etc/postfix/virtual.addon -- cgit v1.2.3