#! /bin/sh # (C) Copyright 2003 Rahul Dhesi, All rights reserved. # # "As is" -- No warranty. # # Copying, use, and modification are permitted, governed by # the GNU General Public License, by only those who agree # to use this program at their own risk. # Enable or disable postfix softbounce. # # Will check or update multiple instances of Postfix, assumed to be in # /etc/postfix and /etc/pf? directories. # # Without an argument, prints softbounce status. # # With a 'yes' or 'no' argument sets softbounce to that value in # each Postfix instance, by editing main.cf, via postconf -c. # # The postconf command must be in the user's path. # $Source: /mi/maincvs/mail/softbounce,v $ # $Id: softbounce,v 1.2 2003/01/19 12:00:14 dhesi Exp $ LIST='/etc/postfix /etc/pf1 /etc/pf2 /etc/pf3 /etc/pf4 /etc/pf5 /etc/pf6' DIRS='' for dir in $LIST; do if test -f $dir/main.cf; then DIRS="$DIRS $dir" fi done case "x$1" in xyes) arg=yes ;; xno) arg=no ;; *) arg=xxx ;; esac case $arg in yes|no) for dir in $DIRS; do postconf -c $dir -e "soft_bounce=$arg" done ;; esac for dir in $DIRS; do echo "`postconf -c $dir soft_bounce` : $dir" done