refactor common role
This commit is contained in:
3
roles/common/templates/opensmtpd/smtpd-secret.j2
Normal file
3
roles/common/templates/opensmtpd/smtpd-secret.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for account in smtp_accounts %}
|
||||
{{ account.name }} {{ account.username | default(account.from) }}:{{ account.password }}
|
||||
{% endfor %}
|
||||
11
roles/common/templates/opensmtpd/smtpd.conf.j2
Normal file
11
roles/common/templates/opensmtpd/smtpd.conf.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
listen on localhost
|
||||
|
||||
table aliases file:/etc/aliases
|
||||
table secrets file:/etc/smtpd-secret
|
||||
|
||||
action "local" mbox alias <aliases>
|
||||
{% for account in smtp_accounts %}
|
||||
action "{{ account.name }}_relay" relay host "smtps://{{ account.name }}@{{ account.host }}" auth <secrets> mail-from "{{ account.from }}"
|
||||
{% endfor %}
|
||||
match for local action "local"
|
||||
match for any action "{{ smtp_default_account }}_relay"
|
||||
Reference in New Issue
Block a user