Oefenweb / ansible-postfix

Ansible role to set up postfix in Debian-like systems
MIT License
174 stars 82 forks source link

New features: configurable default_database_type, recipient_canonical_maps, header_checks #59

Closed toebivankenoebi closed 5 years ago

toebivankenoebi commented 5 years ago

default_database_type

Added the possibility of configuring the default_database_type for all database type that support postmap.

defaults/main.yml: postfix_default_database_type: hash templates/etc/postfix/main.j2: replace hash with variable name {{ postfix_default_database_type }} handlers/main.yml: replace hash with variable name {{ postfix_default_database_type }}

Can be configured in playbook for example like: postfix_default_database_type: btree

recipient_canonical_maps

can be configured the same way as sender_canonical_maps

header_checks

Added the possibility to add header checks

Needs at least two options: pattern, action Optionally can handle a third option: text

Added task, handler, lines in main.cfg and a header_checks.j2 template  It can be configured like the following:

postfix_header_checks:
   - pattern: '<some pattern>' 
     action: "<action>" , action like "REPLACE"
     text: "<some optional text if needed>"
   - pattern ....

Additional option: postfix_header_check_format default: regexp

Configures /etc/postfix/main.cfg: smtp_header_checks = {{ postfix_header_check_format }}:/etc/postfix/header_checks

Configures /etc/postfix/header_checks: {{ pattern }} {{ action }} {{ text }}

rgarrigue commented 5 years ago

Hi, what's the ETA for this PR ?

tersmitten commented 5 years ago

Can someone make this PR up-2-date?

tersmitten commented 5 years ago

Looks good! Thanks for resolving the conflicts