Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ postfix::lookup::ldap { '/etc/postfix/virtualrecipients.cf':
}
```

## Service management

By default this module restarts the postfix service on config changes.

To prevent clients being disconnected during mail delivery,
this behaviour can be changed using the parameter `service_restart_command` of class `postfix::init`.

Note, some changes need a restart to get effect:
[http://www.postfix.org/postconf.5.html](http://www.postfix.org/postconf.5.html)

Example in Hiera for reloading postfix on changes:
```
postfix::service_restart_command: '/usr/bin/systemctl reload postfix.service'
```

## Reference

The reference documentation is generated with
Expand Down
7 changes: 7 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ The following parameters are available in the `postfix` class:
* [`lookup_packages`](#lookup_packages)
* [`package_name`](#package_name)
* [`service_name`](#service_name)
* [`service_restart_command`](#service_restart_command)
* [`twobounce_notice_recipient`](#twobounce_notice_recipient)
* [`access_map_defer_code`](#access_map_defer_code)
* [`access_map_reject_code`](#access_map_reject_code)
Expand Down Expand Up @@ -878,6 +879,12 @@ Data type: `String`



##### <a name="service_restart_command"></a>`service_restart_command`

Data type: `String`



##### <a name="twobounce_notice_recipient"></a>`twobounce_notice_recipient`

Data type: `Optional[String]`
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ postfix::conf_dir: '/etc/postfix'
postfix::lookup_packages: {}
postfix::package_name: 'postfix'
postfix::service_name: 'postfix'
postfix::service_restart_command: ~
postfix::services: {}
postfix::twobounce_notice_recipient: ~
postfix::access_map_defer_code: ~
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# @param lookup_packages
# @param package_name
# @param service_name
# @param service_restart_command
# @param twobounce_notice_recipient `2bounce_notice_recipient` is a violation
# of Puppet variable naming conventions.
# @param access_map_defer_code
Expand Down Expand Up @@ -781,6 +782,7 @@
Hash[Postfix::Type::Lookup, String] $lookup_packages,
String $package_name,
String $service_name,
Optional[String] $service_restart_command,
# main.cf parameters below
Optional[String] $twobounce_notice_recipient,
Optional[String] $access_map_defer_code,
Expand Down
1 change: 1 addition & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
enable => true,
hasstatus => true,
hasrestart => true,
restart => $postfix::service_restart_command,
}
}