summaryrefslogtreecommitdiffstats
path: root/tasks/mail.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/mail.yml')
-rw-r--r--tasks/mail.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/tasks/mail.yml b/tasks/mail.yml
new file mode 100644
index 0000000..89d8530
--- /dev/null
+++ b/tasks/mail.yml
@@ -0,0 +1,38 @@
+- name: Install Postfix
+ apt: pkg=postfix
+
+- name: Add some common aliases
+ lineinfile: dest=/etc/aliases create=yes
+ 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: 'hostmaster@{{ ansible_domain }}' }
+ notify:
+ - Run newaliases
+
+- name: Configure Postfix
+ template: src=etc/postfix/main.cf.j2
+ dest=/etc/postfix/main.cf
+ owner=root group=root
+ mode=0644
+ notify:
+ - Reload Postfix
+
+- name: Start Postfix
+ service: name=postfix.service enabled=true state=started
+
+- name: Copy /etc/postfix/tls_policy
+ copy: src=etc/postfix/tls_policy
+ dest=/etc/postfix/tls_policy
+ owner=root group=root
+ mode=0644
+ notify:
+ - Compile /etc/postfix/tls_policy
+
+- meta: flush_handlers
+
+- name: Install s-nail
+ apt: pkg=s-nail