thias / puppet-postfix

Puppet Postfix module
Other
17 stars 117 forks source link

Add param and template for Regex check_recipient_access #56

Open waydenie opened 9 years ago

waydenie commented 9 years ago

Hello,

I'd like to configure and manage the check_recipient_access feature of postfix via your puppet-postfix module.

This pull request (attempts to...) add these as server params and an associated template erb, as modelled by the header_checks and body_checks features already provided...

Sample hieradata config for new params; ( implements a check_recipient_access regex to cause all submitted email to be held in the hold queue, except for mail to example.com as seen in: http://serverfault.com/questions/460905/postfix-stop-outgoing-delivery-but-accept-all-incoming )

postfix::server::smtpd_sender_restrictions:
    - check_recipient_access regexp:/etc/postfix/check_recipient_access 
postfix::server::check_recipient_access:
   - /example\.com$/ DUNNO
   - /^/ HOLD

Thanks, Wayde.

waydenie commented 9 years ago

Also added param to set contents of /etc/postfix/virtual_regex file used like:

postfix::server::virtual_alias_maps:

[ Not sure if this is the way you intend/want to implement file handling in general... I've modelled these two additions after the preexisting body_ and header_checks file templates... ]

thias commented 9 years ago

The name of the template file virtual-regex.erb should also have an underscore for redundancy. This approach is very iterative... maybe I should add a simple 'postfix::files' class with a create_resources(postfix::file,...) inside in order to let people manage any files using hiera?

waydenie commented 9 years ago

A more general way to create/manage arbitrary postfix files would be nice... Especially if a change to one of the files could trigger a postmap run for dbm type files...