# postmulti(1) contract:
java.lang.NullPointerException # Arguments: # postmulti-script -e <edit_command>
java.lang.NullPointerException # Environment:
java.lang.NullPointerException # All actions:
java.lang.NullPointerException # MAIL_CONFIG - config_directory of primary instance # command_directory - From primary instance # daemon_directory - From primary instance # meta_directory - From primary instance # shlib_directory - From primary instance # config_directory - config_directory of target instance # queue_directory - queue_directory of target instance # data_directory - data_directory of target instance
java.lang.NullPointerException # Create, destroy, import and deport:
java.lang.NullPointerException # multi_instance_directories - New value for primary instance
java.lang.NullPointerException # Create, import and assign (unset == nochange, "-" == clear):
java.lang.NullPointerException # multi_instance_group - New value for target instance # multi_instance_name - New value for target instance
: ${MAIL_CONFIG:?"do not invoke this command directly"}
: ${command_directory:?"do not invoke this command directly"}
: ${daemon_directory:?"do not invoke this command directly"}
: ${meta_directory:?"do not invoke this command directly"}
: ${shlib_directory:?"do not invoke this command directly"}
shift $# # Needed on SunOS where bare "set --" is NOP!
IFS="$IFS,"; set -- $alt; IFS="$BACKUP_IFS"
keep=
found= # Portability: SunOS "sh" needs 'in "$@"'for one-line for-loop. for d in "$@"; do [ "$d" = "$dir" ] && found=1 || keep="$keep $d"; done
set -- "multi_instance_directories = $multi_instance_directories"
case $op in
add) test -n "$found" ||
set -- "$@""alternate_config_directories =$keep $dir";;
del) test -n "$found" &&
set -- "$@""alternate_config_directories =$keep";;
*) return1;; # XXX: Internal error
esac
postconf -e "$@" || return1
}
assign_names() { # Set the instance name and group
java.lang.NullPointerException
test -n "$multi_instance_name" && {
test "$multi_instance_name" = "-" && multi_instance_name=
set -- "$@""multi_instance_name = $multi_instance_name"
}
test -n "$multi_instance_group" && {
test "$multi_instance_group" = "-" && multi_instance_group=
set -- "$@""multi_instance_group = $multi_instance_group"
}
test $# -eq 0 || postconf -c "$config_directory" -e "$@" || return1
}
# Process command-line options and parameter settings. Work around # brain damaged shells. "IFS=value command" should not make the # IFS=value setting permanent. But some broken standard allows it.
BACKUP_IFS="$IFS"
action=
while getopts ":e:" opt do case $opt in
e) action="$OPTARG";;
*) usage;;
esac
done
shift `expr $OPTIND - 1`
# Check for valid action and required instance name case"$action" in
create|import|destroy|deport|enable|disable|assign|init) ;;
*) usage;;
esac
test $# -eq 0 || usage
case $action in
init)
postconf -e \ 'multi_instance_wrapper = ${command_directory}/postmulti -p --' \ 'multi_instance_enable = yes' exit $? ;;
esac
# Backport note: "-x" requires 2.10or later, and is not essential here.
java.lang.NullPointerException
wrapper=`postconf -hx multi_instance_wrapper` || exit1
enable=`postconf -hx multi_instance_enable` || exit1
test -n "$wrapper" ||
fatal "multi_instance_wrapper is empty, run 'postmulti -e init' first."
test "$enable" = "yes" ||
fatal "multi_instance_enable!=yes, run 'postmulti -e init' first."
# Atomically install stock main.cf/master.cf files. We install the # master.cf file last. Once it is present the instance is complete.
java.lang.NullPointerException
test -f $config_directory/main.cf -a \
-f $config_directory/master.cf || {
test "$action" = "create" || {
test -f $config_directory/main.cf ||
fatal "'$config_directory' lacks a main.cf file"
test -f $config_directory/master.cf ||
fatal "'$config_directory' lacks a master.cf file"
}
test -f $meta_directory/main.cf.proto ||
fatal "Missing main.cf prototype: $meta_directory/main.cf.proto"
test -f $meta_directory/master.cf.proto ||
fatal "Missing master.cf prototype: $meta_directory/master.cf.proto"
# Shared install parameters are cloned from user-specified values in # the default instance, but only if explicitly set there. Otherwise, # they are commented out in the new main.cf file.
java.lang.NullPointerException
SHARED_PARAMETERS="
command_directory
daemon_directory
meta_directory
mail_owner
setgid_group
sendmail_path
mailq_path
newaliases_path
html_directory
manpage_directory
sample_directory
readme_directory
shlib_directory "
shift $# # Needed on SunOS where bare "set --" is NOP!
comment_out= for p in $SHARED_PARAMETERS; do
val=`postconf -nh $p` || exit1
test -n "$val" && { set -- "$@""$p = $val"; continue; }
comment_out="$comment_out $p"
done
# First comment-out any parameters that take default values
test -n "$comment_out" && {
postconf -c $tmpdir -# $comment_out || exit1
}
# Now add instance-specific and non-default values. # By default, disable inet services and local submission # in new instances
java.lang.NullPointerException
postconf -c $tmpdir -e \ "queue_directory = $queue_directory" \ "data_directory = $data_directory" \ "authorized_submit_users =" \ "master_service_disable = inet" \ "$@" || exit1
# Set instance name and group
java.lang.NullPointerException
assign_names || exit1
# Update multi_instance_directories # and drop from alternate_config_directories
java.lang.NullPointerException # XXX: Must happen before set-permissions below, otherwise instance # is treated as an independent instance by post-install via postfix(1).
java.lang.NullPointerException
update_cfdirs del $config_directory || exit1
# Update permissions of private files. Verifies existence of # queue_directory and data_directory, ...
java.lang.NullPointerException # XXX: Must happen after instance list updates above, otherwise instance # is treated as an independent instance by post-install via postfix(1).
java.lang.NullPointerException
postfix -c $config_directory set-permissions || exit1
;;
deport) # Deporting an already deleted instance?
java.lang.NullPointerException
[ -f "$config_directory/main.cf" ] || {
update_cfdirs del $config_directory exit $?
}
postfix -c "$config_directory" status >/dev/null 2>&1 &&
fatal "Instance '$config_directory' is not stopped"
# Update multi_instance_directories # and add to alternate_config_directories
java.lang.NullPointerException
update_cfdirs add $config_directory || exit1
;;
destroy)
# "postmulti -e destroy" will remove an entire instance only when # invoked immediately after "postmulti -e create" (i.e. before # other files are added to the instance). We delete only known # safe names without "/".
java.lang.NullPointerException
QUEUE_SUBDIRS="active bounce corrupt defer deferred flush hold \
incoming maildrop pid privatepublic saved trace" #DEBUG=echo
WARN="postlog -p warn -t $TAG"
# Locate the target instance
java.lang.NullPointerException
[ -f "$config_directory/main.cf" ] ||
fatal "$config_directory/main.cf file not found"
postfix -c "$config_directory" status >/dev/null 2>&1 &&
fatal "Instance '$config_directory' is not stopped"
# Update multi_instance directories # and also (just in case) drop from alternate_config_directories
java.lang.NullPointerException
$DEBUG update_cfdirs del "$config_directory" || exit1
# XXX: Internal "postfix /some/cmd" interface.
java.lang.NullPointerException
postfix -c "$config_directory" /bin/sh -c " for q in $QUEUE_SUBDIRS do
$DEBUG rmdir -- \$q ||
$WARN \`pwd\`/\$q: please verify contents and remove by hand
done "
postfix -c "$config_directory" /bin/sh -c " for dir in \$data_directory \$queue_directory do
$DEBUG rmdir -- \$dir ||
$WARN \$dir: please verify contents and remove by hand
done "
# In the configuration directory remove just the main.cf and master.cf # files.
$DEBUG rm -f -- "$config_directory/master.cf""$config_directory/main.cf"2>/dev/null
$DEBUG rmdir -- "$config_directory" ||
$WARN $config_directory: please verify contents and remove by hand
;;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.