opensmtpd: support relaying mail
This commit is contained in:
parent
b252e451f6
commit
be8e47119f
5
roles/opensmtpd/handlers/main.yml
Normal file
5
roles/opensmtpd/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: restart smtpd
|
||||
service:
|
||||
name: smtpd
|
||||
state: restarted
|
||||
when: "'handler' not in ansible_skip_tags"
|
|
@ -1,7 +1,15 @@
|
|||
# this role is currently for alpine linux only
|
||||
|
||||
- name: Install mail server
|
||||
package:
|
||||
name: opensmtpd
|
||||
|
||||
- name: Configure mail server
|
||||
template:
|
||||
dest: /etc/smtpd/smtpd.conf
|
||||
src: smtpd.conf.j2
|
||||
notify: restart smtpd
|
||||
|
||||
- name: Enable mail server
|
||||
service:
|
||||
name: smtpd
|
||||
|
|
9
roles/opensmtpd/templates/smtpd.conf.j2
Normal file
9
roles/opensmtpd/templates/smtpd.conf.j2
Normal file
|
@ -0,0 +1,9 @@
|
|||
table aliases file:/etc/smtpd/aliases
|
||||
|
||||
listen on lo
|
||||
|
||||
action "local" maildir alias <aliases>
|
||||
action "relay" relay{% if mail_relay is defined %} host smtp+tls://{{ mail_relay }}{% endif +%}
|
||||
|
||||
match for local action "local"
|
||||
match from local for any action "relay"
|
Loading…
Reference in a new issue