summaryrefslogtreecommitdiff
path: root/localmkpostfixvirtual
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-09-08 16:00:52 +0000
committerJonas Smedegaard <dr@jones.dk>2003-09-08 16:00:52 +0000
commit86edfa61305162fa24a0354abe20c5a7d6c83a87 (patch)
tree7273f205a42f7f997137426573e4bd08fc3db4de /localmkpostfixvirtual
parent34a219b8d53ef44469c3caa8e7eb642c20d679bf (diff)
use 'members maildomains' as default input, and add usual commands to header.
Diffstat (limited to 'localmkpostfixvirtual')
-rwxr-xr-xlocalmkpostfixvirtual18
1 files changed, 16 insertions, 2 deletions
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 <dr@jones.dk>
#
-# $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