Forge Home


Installs and manages the postfix service


9,394 latest version

5.0 quality score

Version information

  • 0.9.0 (latest)
  • 0.8.1
  • 0.8.0
released Jan 11th 2016
This version is compatible with:
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'jlambert121-postfix', '0.9.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jlambert121-postfix
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jlambert121-postfix --version 0.9.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Tags: postfix, smtp


jlambert121/postfix — version 0.9.0 Jan 11th 2016

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with postfix
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module


A puppet module to install and configure postfix.

Module Description

A puppet module that installs and configures postfix to either accept mail on locahost only and forward it on to a server responsible for sending it to its final destination, or as a server accepting mail and responsible to forwarding it to its final destination. This is to keep this module simple and is not intended to handle mailboxes, spam/av filtering, or any advanced postfix configs, but rather to configure internal email servers for utility purposes.


What postfix affects

  • postfix package
  • postfix configuration
  • postfix service

Beginning with postfix

postfix can be installed simply by including the module:

    class { 'postfix': }


If you have a webserver that sends mail and you would like a local SMTP server running you trust not to loose the message if upstream is down:

  class { 'postfix':
    relay_domains => '',

Note: This assumes $::domain has proper MX records in place and the configured MX hosts will accept mail from this host.

To configure a relay server responsible for delivering all of those messages (and assuming your internal network is 10/8):

  class { 'postfix':
    smtp_relay      => true,
    relay_networks  => '',


Public classes

Class: postfix


Boolean. If true, this host will forward to final destination. If false, postfix will forward to relayhost Default: true


String. If smtp_relay == false, what is the next hop for mail? Default: $::domain


String. Local domain of this machine Default: $::domain


String. Networks that are allowed to relay mail through this host. Default:


String. Domains this machine will relay mail for. Default: undef


String. Username for relayhosts that require SMTP AUTH. Default: undef


String. Password for relayhosts that require SMTP AUTH. Default: undef


String. Port for relayhosts that require SMTP AUTH. Default: 25


Boolean. Enable TLS for SMTP connections. Default: false


String. Path to TLS certificate bundle. Default: Sensible defaults for RedHat and Debian systems, otherwise false.


String. Package containing TLS certificate bundle.. Default: Sensible defaults for RedHat and Debian systems, otherwise false.


Array. List of additional services to be included in the Default: []


Hash. Additional options to specify in the Format is {'parameter' => 'value'} Default: {}


String. Value of the smtpd_client_restrictions parameter. Default: 'permit_mynetworks, reject'


String. Value of the smtpd_helo_restrictions parameter. Default: undef


String. Value of the smtpd_sender_restrictions parameter. Default: undef


String. Value of the smtpd_recipient_restrictions parameter. Default: 'permit_mynetworks, reject_unauth_destination'


String Value of the smtpd_data_restrictions parameter.
Default: 'reject_unauth_pipelining'

Private classes

Class: postfix::cofing

Writes the postfix configuration

Class: postfix::install

Manages the postfix package

Class: postfix::service

Manages the postfix service


This has only been tested on CentOS 6 and 7.


Improvements and bug fixes are greatly appreciated. See the contributing guide for information on adding and validating tests for PRs.

Changelog / Contributors