Postfix (resource agent)
The postfix resource agent (ocf:heartbeat:postfix in CRM shell syntax) manages a Postfix MTA instance as a highly available cluster resource. It supports multiple instances of Postfix of which, if configured correctly, several may run concurrently on one node.
IMPORTANT: The current minimum required Postfix version for using this resource agent is Postfix 2.5.0 (see below).
Single managed instance, default
This example shows how to configure a Postfix instance. It uses Postfix's default configuration directory:
primitive postfix ocf:heartbeat:postfix \ op monitor interval="30" timeout="30"
IMPORTANT: If you're using Postfix as the system's primary MTA, additional care must be taken to ensure message delivery for system messages (e.g. cronjob output)!
Single managed instance, clustered environment
This example shows how to configure a Postfix instance using a different configuration directory (e.g. on a shared storage).
primitive m-mail-postfix ocf:ipax:postfix \ op monitor interval="30" timeout="30" \ params config_dir="/data/mail/conf/"
IMPORTANT: To successfully start Postfix with a different configuration directory, you have to add this information to your default main.cf file, e.g. /etc/postfix/main.cf:
alternate_config_directories = /data/mail/conf/
For further information on running multiple Postfix instances, please refer to
- man 5 postconf (read online)
Postfix as the system's default MTA
Note from the author: I would not advice to manage the default Postfix instance via Pacemaker, if you're using Postfix as the system's primary MTA!
Especially, when you're planning to build a fail-over cluster, where Postfix will be running solely on 1 out of n nodes, you might not receive any (!) system messages (e.g. output from cron, mdadm, smartd, fcheck, etc.). This also applies to cloned instances when pacemaker decides to stop the instance on a certain node (e.g. when switching to standby).
My personal advice would be:
- Start the system's MTA via an ordinary init script.
- Implement regular MTA checks in your monitoring environment, e.g. Nagios].
- Use different configuration, queue, data, etc. directories for your public Postfix service.
This resource agent has been originally developed and tested using Postfix 2.5.5 on Debian 5.0.
Further enhancements have been developed using Postfix 2.7.1 on Debian 6.0.
Because of the current implementation using the
postfix status command, the minimum required Postfix version for using this resource agent is Postfix 2.5.0.