This module requires Augeas.
include postfix
postfix::config { 'relay_domains':
ensure => present,
value => 'localhost host.foo.com',
}
In order to not have any path problem, you should add the following line in some globally included .pp file:
Exec {
path => '/some/relevant/path:/some/other:...',
}
For example:
Exec {
path => '/bin:/sbin:/usr/sbin:/usr/bin',
}
The top-level class, to install and configure Postfix.
A string defining the location of the alias map file.
Default: 'hash:/etc/aliases'.
Example: 'hash:/etc/other_aliases'.
A string defining the network interfaces that Postfix will listen on.
Default: 'all'.
Example: '127.0.0.1, [::1]'.
A Boolean defining whether to configure Postfix for LDAP use.
Default: false.
A string defining the LDAP search base to use. This parameter maps to the search_base parameter (ldap_table(5)).
Default: Undefined.
Example 'cn=Users,dc=example,dc=com'.
A string defining the LDAP host. This parameter maps to the server_host parameter (ldap_table(5)).
Default: Undefined.
Example: 'ldaps://ldap.example.com:636 ldap://ldap2.example.com'.
A free form string that can define any ldap options to be passed through (ldap_table(5)).
Default: Undefined.
Example: 'start_tls = yes'.
A string defining the mail user, and optionally group, to execute external commands as. This parameter maps to the user parameter (pipe(8)).
Default: 'vmail'.
Example: 'vmail:vmail'.
A Boolean defining whether to configure a basic smtp server that is able to work for the mailman mailing list manager.
Default: false.
A string defining the location of a skeleton main.cf file to be used. The default file supplied is blank. However, if the main.cf file already exists on the system the contents will NOT be replaced by the contents from maincf_source.
Default: "puppet:///modules/${module_name}/main.cf".
Example: 'puppet:///modules/some/other/location/main.cf'.
A Boolean defining whether the puppet module should replace the configuration files for postfix.
This setting currently effects only the following files:
- /etc/mailname
- /etc/postfix/master.cf
This setting does NOT effect the following files:
- /etc/aliases
- /etc/postfix/main.cf
Default: true.
A Boolean defining whether the puppet module should manage the mailx package. See also $mailx_ensure.
Default: true.
A string defining the location of a skeleton master.cf file to be used.
Default: Undefined.
Example: 'puppet:///modules/some/other/location/master.cf'.
A string to define the smtp line in the /etc/postfix/master.cf file. If this is defined the smtp_listen parameter will be ignored.
Default: Undefined.
Example: 'smtp inet n - n - - smtpd'.
A string to define the smtps line in the /etc/postfix/master.cf file.
Default: Undefined.
Example: 'smtps inet n - n - - smtpd'.
A string to define the submission line in the /etc/postfix/master.cf file.
Default: Undefined.
Example: 'submission inet n - n - - smtpd'.
A Boolean to define whether to configure Postfix as a mail transfer agent. This option is mutually exclusive with the satellite Boolean.
Default: False.
A string to define the mydestination parameter in main.cf (postconf(5)).
Default: The systems FQDN.
Example: 'example.com, foo.example.com'.
A string to define the mynetworks parameter that holds trusted remote smtp clients (postconf(5)).
Default: '127.0.0.0/8'.
Example: '127.0.0.0/8, [::1]/128'.
A string to define the myorigin parameter that holds the domain name that mail appears to come from (postconf(5)).
Default: The FQDN of the host.
Example: 'example.com'
A string to define the relayhost parameter (postconf(5)).
Default: Undefined.
Example: 'smtp.example.com'.
A string to define the e-mail address to which all mail directed to root should go (aliases(5)).
Default: 'nobody'.
Example: '[email protected]'.
A Boolean to define whether to configure postfix as a satellite relay host. This setting is mutually exclusive with the mta Boolean.
Default: False.
A string to define the IP on which to listen in master.cf. This can also be set to 'all' to listen on all interfaces. If master_smtp is defined smtp_listen will not be used.
Default: '127.0.0.1'.
Example: '::1'.
A Boolean to define whether to configure master.cf to allow the use of the amavisd scanner.
Default: False.
A Boolean to define whether to configure master.cf to use dovecot as the local delivery agent.
Default: False.
A Boolean to define whether to configure master.cf to use the Schleuder GPG-enabled mailing list.
Default: False.
A Boolean to define whether to configure master.cf to use the Sympa mailing list management software.
Default: False.
Add/alter/remove options in Postfix main configuration file (main.cf). This uses Augeas to do the editing of the configuration file, as such any configuration value can be used.
A string whose value can be any of 'present', 'absent', 'blank'.
Default: present.
Example: blank.
A string that can contain any text to be used as the configuration value.
Default: Undefined.
Example: 'btree:${data_directory}/smtp_tls_session_cache'.
postfix::config {
'smtp_tls_mandatory_ciphers': value => 'high';
'smtp_tls_security_level': value => 'secure';
'smtp_tls_CAfile': value => '/etc/pki/tls/certs/ca-bundle.crt';
'smtp_tls_session_cache_database': value => 'btree:${data_directory}/smtp_tls_session_cache';
}
postfix::config { 'disable_vrfy_command':
ensure => present,
value => 'yes',
}
Creates Postfix hashed "map" files, and builds the corresponding db file.
Defines whether the hash map file is present or not. Value can either be present or absent.
Default: present.
Example: absent.
A free form string that defines the contents of the file. This parameter is mutually exclusive with the source parameter.
Default: Undefined.
Example: '#Destination Credentials\nsmtp.example.com gssapi:nopassword'.
A string whose value is a location for the source file to be used. This parameter is mutually exclusive with the content parameter, one or the other must be present, but both cannot be present.
Default: Undefined.
Example: 'puppet:///modules/some/location/sasl_passwd'.
postfix::hash { '/etc/postfix/sasl_passwd':
ensure => 'present',
source => 'puppet:///modules/profile/postfix/client/sasl_passwd',
}
postfix::hash { '/etc/postfix/sasl_passwd':
ensure => 'present',
content => '#Destination Credentials\nsmtp.example.com gssapi:nopassword',
}
Manages content of the /etc/postfix/transport map.
Augeas is, of course, required.
The following code is required to use transport maps.
include postfix
postfix::hash { '/etc/postfix/transport':
ensure => present,
}
postfix::config { 'transport_maps'
ensure => present,
value => 'hash:/etc/postfix/transport',
}
Defines whether the transport entry is present or not. Value can either be present or absent.
Default: present.
Example: absent.
The destination to be delivered to (transport(5)).
Default: Undefined.
Example: 'mailman'.
A string to define where and how to deliver the mail (transport(5)).
Default: Undefined.
Example: '[smtp.google.com]:25'.
Manages the contents of the virtual map.
Augeas is, of course, required.
The following code is necessary to make virtual maps work:
include postfix
postfix::hash { '/etc/postfix/virtual':
ensure => present,
}
postfix::config { 'virtual_alias_maps':
ensure => present,
value => 'hash:/etc/postfix/virtual',
}
A string whose valid values are present or absent.
Default: present.
Example: absent.
A string defining the location of the virtual map, pre hash.
Default: '/etc/postfix/virtual'.
Example: '/etc/postfix/my_virtual_map'.
A string defining where the e-mails will be delivered to, (virtual(8)).
Default: Undefined.
Example: 'root'
Route mail bound for '[email protected]' to root.
postfix::virtual {'[email protected]':
ensure => present,
destination => 'root',
}
Manages postfix configuration files. With it, you could create configuration files (other than, main.cf, master.cf, etc.) restarting postfix when necessary.
A string whose valid values are present, absent or directory.
Default: present.
Example: absent.
A string with the source of the file. This is the source
parameter of the underlying file resource.
Default: undef
Example: 'puppet:///modules/postfix/configfile.cf'
The content of the postfix configuration file. This is an alternative to the source
parameter. If you don't provide source
neither content
parameters a default template is used and the content is created with values in the options
hash.
Default: undef
Path where to create the configuration file.
Default: '/etc/postfix/${name}'
Permissions of the configuration file. This option is useful if you want to create the file with specific permissions (for example, because you have passwords in it).
Default: '0644'
Example: '0640'
Hash with the options used in the default template that is used when neither source
neither content
parameters are provided.
Default: {}
Example:
postfix::conffile { 'ldapoptions.cf':
options => {
server_host => ldap.mydomain.com,
bind => 'yes',
bind_dn => 'cn=admin,dc=mydomain,dc=com',
bind_pw => 'password',
search_base => 'dc=example, dc=com',
query_filter => 'mail=%s',
result_attribute => 'uid',
}
}
Please report bugs and feature request using GitHub issue tracker.
For pull requests, it is very much appreciated to check your Puppet manifest with puppet-lint to follow the recommended Puppet style guidelines from the Puppet Labs style guide.
Copyright (c) 2015 mailto:[email protected] All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.