NAME

postmulti - Postfix multi-instance manager

SYNOPSIS



ppoossttmmuullttii --ll [--aaRRvv] [--gg _g_r_o_u_p]
[--ii _n_a_m_e]
        

ppoossttmmuullttii --pp [--aavv] [--gg _g_r_o_u_p] [--ii _n_a_m_e] _c_o_m_m_a_n_d_._._.

ppoossttmmuullttii --xx [--aaRRvv] [--gg _g_r_o_u_p] [--ii _n_a_m_e] _c_o_m_m_a_n_d_._._.

ppoossttmmuullttii --ee iinniitt [--vv]

ppoossttmmuullttii --ee ccrreeaattee [--aavv] [--gg _g_r_o_u_p] [--ii _n_a_m_e] [--GG _g_r_o_u_p] [--II _n_a_m_e] [_p_a_r_a_m_=_v_a_l_u_e ...]

ppoossttmmuullttii --ee iimmppoorrtt [--aavv] [--gg _g_r_o_u_p] [--ii _n_a_m_e] [--GG _g_r_o_u_p] [--II _n_a_m_e] [ccoonnffiigg__ddiirreeccttoorryy==_/_p_a_t_h]

ppoossttmmuullttii --ee ddeessttrrooyy [--vv] --ii _n_a_m_e

ppoossttmmuullttii --ee ddeeppoorrtt [--vv] --ii _n_a_m_e

ppoossttmmuullttii --ee eennaabbllee [--vv] --ii _n_a_m_e

ppoossttmmuullttii --ee ddiissaabbllee [--vv] --ii _n_a_m_e

ppoossttmmuullttii --ee aassssiiggnn [--vv] --ii _n_a_m_e [--II _n_a_m_e] [-G _g_r_o_u_p]

DESCRIPTION

The ppoossttmmuullttii(1) command allows a Postfix administrator to manage multiple Postfix instances on a single host.

ppoossttmmuullttii(1) implements two fundamental modes of operation. In iitteerraattoorr mode, it executes the same command for multiple Postfix instances. In lliiffee--ccyyccllee mmaannaaggeemmeenntt mode, it adds or deletes one instance, or changes the multi-instance status of one instance.

Each mode of operation has its own command syntax. For this reason, each mode is documented in separate sections below.

BACKGROUND



A multi-instance configuration consists of one primary
Postfix instance, and one or more secondary instances whose
configuration directory pathnames are recorded in the primary
instance's main.cf file. Postfix instances share program
files and documentation, but have their own configuration,
queue and data directories.
        

Currently, only the default Postfix instance can be used as primary instance in a multi-instance configuration. The ppoossttmmuullttii(1) command does not currently support a --cc option to select an alternative primary instance, and exits with a fatal error if the MMAAIILL__CCOONNFFIIGG environment variable is set to a non-default configuration directory.

See the MULTI_INSTANCE_README tutorial for a more detailed discussion of multi-instance management with ppoossttmmuullttii(1).

ITERATOR MODE



In iterator mode, ppoossttmmuullttii performs the same operation
on all Postfix instances in turn.
        

If multi-instance support is not enabled, the requested command is performed just for the primary instance.

Iterator mode implements the following command options:

Instance selection

--aa Perform the operation on all instances. This is the default.
--gg _g_r_o_u_p Perform the operation only for members of the named _g_r_o_u_p.
--ii _n_a_m_e Perform the operation only for the instance with the specified
_n_a_m_e. You can specify either the instance name or the absolute pathname of the instance's configuration directory. Specify "-" to select the primary Postfix instance.
--RR Reverse the iteration order. This may be appropriate when
updating a multi-instance system, where "sink" instances are started before "source" instances.

This option cannot be used with --pp.

List mode

--ll List Postfix instances with their instance name, instance
group name, enable/disable status and configuration directory.

Postfix-wrapper mode

--pp Invoke ppoossttffiixx((11)) to execute the specified _c_o_m_m_a_n_d.
This option implements the ppoossttffiixx--wwrraappppeerr(5) interface.
· With "start"-like commands, "postfix check" is executed for
instances that are not enabled. The full list of commands is specified with the postmulti_start_commands parameter.
· With "stop"-like commands, the iteration order is reversed,
and disabled instances are skipped. The full list of commands is specified with the postmulti_stop_commands parameter.
· With "reload" and other commands that require a started
instance, disabled instances are skipped. The full list of commands is specified with the postmulti_control_commands parameter.
· With "status" and other commands that don't require a started
instance, the command is executed for all instances.
The --pp option can also be used interactively to
start/stop/etc. a named instance or instance group. For example, to start just the instances in the group "msa", invoke ppoossttmmuullttii(1) as follows:
# postmulti -g msa -p start

Command mode

--xx Execute the specified _c_o_m_m_a_n_d for all Postfix instances.
The command runs with appropriate environment settings for MAIL_CONFIG, command_directory, daemon_directory, config_directory, queue_directory, data_directory, multi_instance_name, multi_instance_group and multi_instance_enable.

Other options

--vv Enable verbose logging for debugging purposes. Multiple
--vv options make the software increasingly verbose.

LIFE-CYCLE MANAGEMENT MODE



With the --ee option ppoossttmmuullttii(1) can be used to
add or delete a Postfix instance, and to manage the
multi-instance status of an existing instance.

The following options are implemented:

Existing instance selection

--aa When creating or importing an instance, place the new
instance at the front of the secondary instance list.
--gg _g_r_o_u_p When creating or importing an instance, place the new
instance before the first secondary instance that is a member of the specified group.
--ii _n_a_m_e When creating or importing an instance, place the new
instance before the matching secondary instance.

With other life-cycle operations, apply the operation to the named existing instance. Specify "-" to select the primary Postfix instance.

New or existing instance name assignment

--II _n_a_m_e Assign the specified instance _n_a_m_e to an existing
instance, newly-created instance, or imported instance. Instance names other than "-" (which makes the instance "nameless") must start with "postfix-". This restriction reduces the likelihood of name collisions with system files.
--GG _g_r_o_u_p Assign the specified _g_r_o_u_p name to an existing instance
or to a newly created or imported instance.

Instance creation/deletion/status change

--ee _a_c_t_i_o_n "Edit" managed instances. The following actions are supported:
iinniitt This command is required before ppoossttmmuullttii(1) can be
used to manage Postfix instances. The "postmulti -e init" command updates the primary instance's main.cf file by setting:

multi_instance_wrapper =
        ${command_directory}/postmulti -p --
multi_instance_enable = yes
You can set these by other means if you prefer.
ccrreeaattee Create a new Postfix instance and add it to the
multi_instance_directories parameter of the primary instance. The "--II _n_a_m_e" option is recommended to give the instance a short name that is used to construct default values for the private directories of the new instance. The "--GG _g_r_o_u_p" option may be specified to assign the instance to a group, otherwise, the new instance is not a member of any groups.

The new instance main.cf is the stock main.cf with the parameters that specify the locations of shared files cloned from the primary instance. For "nameless" instances, you should manually adjust "syslog_name" to yield a unique "logtag" starting with "postfix-" that will uniquely identify the instance in the mail logs. It is simpler to assign the instance a short name with the "--II _n_a_m_e" option.

Optional "name=value" arguments specify the instance config_directory, queue_directory and data_directory. For example:

# postmulti -I postfix-mumble \
        -G mygroup -e create \
        config_directory=/my/config/dir \
        queue_directory=/my/queue/dir \
        data_directory=/my/data/dir
If any of these pathnames is not supplied, the program
attempts to generate the pathname by taking the corresponding primary instance pathname, and by replacing the last pathname component by the value of the --II option.

If the instance configuration directory already exists, and contains both a main.cf and master.cf file, ccrreeaattee will "import" the instance as-is. For existing instances, ccrreeaattee and iimmppoorrtt are identical.
iimmppoorrtt Import an existing instance into the list of instances
managed by the ppoossttmmuullttii(1) multi-instance manager. This adds the instance to the multi_instance_directories list of the primary instance. If the "--II _n_a_m_e" option is provided it specifies the new name for the instance and is used to define a default location for the instance configuration directory (as with ccrreeaattee above). The "--GG _g_r_o_u_p" option may be used to assign the instance to a group. Add a "ccoonnffiigg__ddiirreeccttoorryy==_/_p_a_t_h" argument to override a default pathname based on "--II _n_a_m_e".
ddeessttrrooyy Destroy a secondary Postfix instance. To be a candidate for
destruction an instance must be disabled, stopped and its queue must not contain any messages. Attempts to destroy the primary Postfix instance trigger a fatal error, without destroying the instance.

The instance is removed from the primary instance main.cf file's alternate_config_directories parameter and its data, queue and configuration directories are cleaned of files and directories created by the Postfix system. The main.cf and master.cf files are removed from the configuration directory even if they have been modified since initial creation. Finally, the instance is "deported" from the list of managed instances.

If other files are present in instance private directories, the directories may not be fully removed, a warning is logged to alert the administrator. It is expected that an instance built using "fresh" directories via the ccrreeaattee action will be fully removed by the ddeessttrrooyy action (if first disabled). If the instance configuration and queue directories are populated with additional files (access and rewriting tables, chroot jail content, etc.) the instance directories will not be fully removed.

The ddeessttrrooyy action triggers potentially dangerous file removal operations. Make sure the instance's data, queue and configuration directories are set correctly and do not contain any valuable files.
ddeeppoorrtt Deport a secondary instance from the list of managed
instances. This deletes the instance configuration directory from the primary instance's multi_instance_directories list, but does not remove any files or directories.
aassssiiggnn Assign a new instance name or a new group name to the
selected instance. Use "--GG --" to specify "no group" and "--II --" to specify "no name". If you choose to make an instance "nameless", set a suitable syslog_name in the corresponding main.cf file.
eennaabbllee Mark the selected instance as enabled. This just sets the
multi_instance_enable parameter to "yes" in the instance's main.cf file.
ddiissaabbllee Mark the selected instance as disabled. This means that
the instance will not be started etc. with "postfix start", "postmulti -p start" and so on. The instance can still be started etc. with "postfix -c config-directory start".

Other options

--vv Enable verbose logging for debugging purposes. Multiple
--vv options make the software increasingly verbose.

ENVIRONMENT



The ppoossttmmuullttii(1) command exports the following environment
variables before executing the requested _c_o_m_m_a_n_d for a given
instance:
MMAAIILL__VVEERRBBOOSSEE This is set when the -v command-line option is present.
MMAAIILL__CCOONNFFIIGG The location of the configuration directory of the instance.

CONFIGURATION PARAMETERS



ccoonnffiigg__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The default location of the Postfix main.cf and master.cf
configuration files.
ddaaeemmoonn__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The directory with Postfix support programs and daemon programs.
iimmppoorrtt__eennvviirroonnmmeenntt ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The list of environment parameters that a Postfix process will
import from a non-Postfix parent process.
mmuullttii__iinnssttaannccee__ddiirreeccttoorriieess ((eemmppttyy)) An optional list of non-default Postfix configuration directories;
these directories belong to additional Postfix instances that share the Postfix executable files and documentation with the default Postfix instance, and that are started, stopped, etc., together with the default Postfix instance.
mmuullttii__iinnssttaannccee__ggrroouupp ((eemmppttyy)) The optional instance group name of this Postfix instance.
mmuullttii__iinnssttaannccee__nnaammee ((eemmppttyy)) The optional instance name of this Postfix instance.
mmuullttii__iinnssttaannccee__eennaabbllee ((nnoo)) Allow this Postfix instance to be started, stopped, etc., by a
multi-instance manager.
ppoossttmmuullttii__ssttaarrtt__ccoommmmaannddss ((ssttaarrtt)) The ppoossttffiixx(1) commands that the ppoossttmmuullttii(1) instance manager treats
as "start" commands.
ppoossttmmuullttii__ssttoopp__ccoommmmaannddss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The ppoossttffiixx(1) commands that the ppoossttmmuullttii(1) instance manager treats
as "stop" commands.
ppoossttmmuullttii__ccoonnttrrooll__ccoommmmaannddss ((rreellooaadd fflluusshh)) The ppoossttffiixx(1) commands that the ppoossttmmuullttii(1) instance manager
treats as "control" commands, that operate on running instances.
ssyysslloogg__ffaacciilliittyy ((mmaaiill)) The syslog facility of Postfix logging.
ssyysslloogg__nnaammee ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The mail system name that is prepended to the process name in syslog
records, so that "smtpd" becomes, for example, "postfix/smtpd".

FILES


$daemon_directory/main.cf, stock configuration file
$daemon_directory/master.cf, stock configuration file
$daemon_directory/postmulti-script, life-cycle helper program

SEE ALSO


postfix(1), Postfix control program
postfix-wrapper(5), Postfix multi-instance API

README FILES


Use "ppoossttccoonnff rreeaaddmmee__ddiirreeccttoorryy" or "ppoossttccoonnff
hhttmmll__ddiirreeccttoorryy" to locate this information.
MULTI_INSTANCE_README, Postfix multi-instance management

HISTORY



The ppoossttmmuullttii(1) command was introduced with Postfix
version 2.6.

LICENSE



The Secure Mailer license must be distributed with this software.

AUTHOR(S)


Victor Duchovni
Morgan Stanley

Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA