Skip to content

Commit

Permalink
Make mydestination configurable
Browse files Browse the repository at this point in the history
And remove $mydomain from it (by default)
  • Loading branch information
tersmitten committed Jul 13, 2017
1 parent 6cfd3ef commit 73835a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ None
* `postfix_aliases` [default: `[]`]: Aliases to ensure present in `/etc/aliases`
* `postfix_virtual_aliases` [default: `[]`]: Virtual aliases to ensure present in `/etc/postfix/virtual`
* `postfix_sender_canonical_maps` [default: `[]`]: Sender address rewriting in `/etc/postfix/sender_canonical_maps` ([see](http://www.postfix.org/postconf.5.html#sender_canonical_maps))
* `postfix_mydestination` [default: `["{{ postfix_hostname }}", 'localdomain', 'localhost', 'localhost.localdomain']`]: Specifies what domains this machine will deliver locally, instead of forwarding to another machine
* `postfix_mynetworks` [default: `['127.0.0.0/8', '[::ffff:127.0.0.0]/104', '[::1]/128']`]: The list of "trusted" remote SMTP clients that have more privileges than "strangers"
* `postfix_inet_interfaces` [default: `all`]: Network interfaces to bind ([see](http://www.postfix.org/postconf.5.html#inet_interfaces))
* `postfix_inet_protocols` [default: `all`]: The Internet protocols Postfix will attempt to use when making or accepting connections ([see](http://www.postfix.org/postconf.5.html#inet_protocols))
Expand Down Expand Up @@ -56,7 +57,13 @@ A simple example with virtual aliases for mail forwarding that doesn't use SASL
roles:
- postfix
vars:
- postfix_virtual_aliases:
postfix_mydestination:
- "{{ postfix_hostname }}"
- '$mydomain'
- localdomain
- localhost
- localhost.localdomain
postfix_virtual_aliases:
- virtual: [email protected]
alias: [email protected]
- virtual: [email protected]
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ postfix_sasl_password: 'k8+haga4@#pR'
postfix_sasl_security_options: noanonymous
postfix_inet_interfaces: all
postfix_inet_protocols: all
postfix_mydestination:
- "{{ postfix_hostname }}"
- localdomain
- localhost
- localhost.localdomain
postfix_mynetworks:
- 127.0.0.0/8
- '[::ffff:127.0.0.0]/104'
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/postfix/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ virtual_alias_maps = hash:/etc/postfix/virtual
{% if postfix_sender_canonical_maps %}
sender_canonical_maps = hash:/etc/postfix/sender_canonical_maps
{% endif %}
mydestination = {{ postfix_hostname }}, $mydomain, localdomain, localhost, localhost.localdomain
mydestination = {{ postfix_mydestination | join(', ') }}
mynetworks = {{ postfix_mynetworks | join(' ') }}
mailbox_size_limit = 0
recipient_delimiter = +
Expand Down

0 comments on commit 73835a5

Please sign in to comment.