opensmtpd: configure root mail alias
And add a README.
This commit is contained in:
parent
b64a5880b9
commit
7bb27acd2c
2 changed files with 9 additions and 0 deletions
3
roles/opensmtpd/README.md
Normal file
3
roles/opensmtpd/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Install opensmtpd and configure it for sending local mail through a relay.
|
||||||
|
|
||||||
|
The NetBox configuration context must define `mail_relay` with the relay hostname and `mail_root` with the email address where mail for root should be forwarded.
|
|
@ -27,6 +27,12 @@
|
||||||
follow: true
|
follow: true
|
||||||
notify: restart smtpd
|
notify: restart smtpd
|
||||||
|
|
||||||
|
- name: Configure root mail alias
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/smtpd/aliases
|
||||||
|
regexp: "^#? *root:"
|
||||||
|
line: "root: {{ mail_root }}"
|
||||||
|
|
||||||
- name: Enable mail server
|
- name: Enable mail server
|
||||||
service:
|
service:
|
||||||
name: "{% if ansible_os_family == 'Alpine' %}smtpd{% else %}opensmtpd{% endif %}"
|
name: "{% if ansible_os_family == 'Alpine' %}smtpd{% else %}opensmtpd{% endif %}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue