summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/mail.yml
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-09-18 17:55:33 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-09-18 17:55:33 +0200
commita4ecc629b38e9d9d4cf918d6095112347c141e55 (patch)
tree654def79ff5bab9a947887ee2ce2942ac3082d7d /roles/common/tasks/mail.yml
parent87dc808939fbc740c3742e10ce4d23a4c7099c07 (diff)
Postfix: ensure common aliases are present.
Diffstat (limited to 'roles/common/tasks/mail.yml')
-rw-r--r--roles/common/tasks/mail.yml11
1 files changed, 8 insertions, 3 deletions
diff --git a/roles/common/tasks/mail.yml b/roles/common/tasks/mail.yml
index 6f690e6..1877f21 100644
--- a/roles/common/tasks/mail.yml
+++ b/roles/common/tasks/mail.yml
@@ -36,10 +36,15 @@
notify:
- Reload Postfix
-- name: Add a 'root' alias
+- name: Add some common aliases
lineinfile: dest=/etc/aliases create=yes
- regexp="^root{{':'}} "
- line="root{{':'}} root@fripost.org"
+ regexp='^{{ item.src }}{{':'}} '
+ line='{{ item.src }}{{':'}} {{ item.dst }}'
+ with_items:
+ - { src: mailer-daemon, dst: 'postmaster' }
+ - { src: postmaster, dst: 'root' }
+ - { src: nobody, dst: 'root' }
+ - { src: root, dst: 'root@fripost.org' }
- name: Compile the static local Postfix database
postmap: cmd=postalias src=/etc/aliases db=cdb