Forge Home


Postfix Mail Transport Agent module


9,538 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.3.4 (latest)
released May 21st 2015

Start using this module

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

Add this module to your Puppetfile:

mod 'jgazeley-postfix', '0.3.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install jgazeley-postfix --version 0.3.4

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.



jgazeley/postfix — version 0.3.4 May 21st 2015


This is a temporary fork of thias/postfix which includes support for CentOS 7. This fork will be removed when the author responds to #40


This module is meant for Red Hat Enterprise Linux, its clones and FreeBSD. It still requires some major clean up, but is currently fully functional.

  • postfix::dbfile : Manage Postfix DB configuration files
  • postfix::file : Manage flat text Postfix configuration files
  • postfix::server : Manage the main Postfix instance


class { '::postfix::server':
  myhostname              => '',
  mydomain                => '',
  mydestination           => "\$myhostname, localhost.\$mydomain, localhost, $fqdn",
  inet_interfaces         => 'all',
  message_size_limit      => '15360000', # 15MB
  mail_name               => 'example mail daemon',
  virtual_mailbox_domains => [
  virtual_alias_maps      => [
  virtual_transport         => 'dovecot',
  # if you want dovecot to deliver to,
  # uncomment this: (c.f.
  # dovecot_destination     => '${user}@${nexthop}',
  smtpd_sender_restrictions => [
  smtpd_recipient_restrictions => [
  smtpd_sasl_auth       => true,
  sender_canonical_maps => 'regexp:/etc/postfix/sender_canonical',
  ssl                   => '',
  submission            => true,
  header_checks         => [
    '# Remove LAN (Webmail) headers',
    '/^Received: from .*\.example\.ici/ IGNORE',
    '# Sh*tlist',
    '/^From: .*@(example\.com|example\.net)/ REJECT Spam, go away',
    '/^From: .*@(lcfnl\.com|.*\.cson4\.com|.*\.idep4\.com|.*\.gagc4\.com)/ REJECT user unknown',
  postgrey              => true,
  spamassassin          => true,
  sa_skip_rbl_checks    => '0',
  spampd_children       => '4',
  # Send all emails to spampd on 10026
  smtp_content_filter   => 'smtp:',
  # This is where we get emails back from spampd
  master_services       => [ ' inet n  -       n       -      20       smtpd'],

Parameters for

The most common parameters are supported as parameters to the postfix::server class, but any other ones may be added using the $extra_main_parameters hash parameter, to which keys are parameter names and values can be either a value string or array of strings.

Example :

class { '::postfix::server':
  extra_main_parameters => {
    'virtual_mailbox_lock' => [
    virtual_minimum_uid => '1000',


  • The service will only be reloaded on configuration change, meaning that changes requiring a full restart won't be applied, such as changes to listening interfaces.