summaryrefslogtreecommitdiff
path: root/ansible/roles/mail-client
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/mail-client')
-rw-r--r--ansible/roles/mail-client/files/aliases2
-rw-r--r--ansible/roles/mail-client/tasks/main.yml50
-rw-r--r--ansible/roles/mail-client/templates/main.cf4
3 files changed, 47 insertions, 9 deletions
diff --git a/ansible/roles/mail-client/files/aliases b/ansible/roles/mail-client/files/aliases
new file mode 100644
index 0000000..040d695
--- /dev/null
+++ b/ansible/roles/mail-client/files/aliases
@@ -0,0 +1,2 @@
+root: liw
+liw: liw@liw.fi
diff --git a/ansible/roles/mail-client/tasks/main.yml b/ansible/roles/mail-client/tasks/main.yml
index 63df37e..ba40678 100644
--- a/ansible/roles/mail-client/tasks/main.yml
+++ b/ansible/roles/mail-client/tasks/main.yml
@@ -1,9 +1,45 @@
-- name: "install email stuff"
+- name: "install mail client packages"
apt:
name:
- - mutt
- - notmuch
- - notmuch-mutt
- - offlineimap
- - procmail
- - clab
+ - isync
+ - libsasl2-modules
+ - mailutils
+ - mutt
+ - notmuch
+ - notmuch-mutt
+ - postfix
+
+- name: "configure postfix"
+ template:
+ src: main.cf
+ dest: /etc/postfix/main.cf
+ notify: restart postfix
+
+- name: "set mailname"
+ copy:
+ content: "{{ mailname }}\n"
+ dest: /etc/mailname
+ owner: root
+ group: root
+ mode: 0644
+
+- name: "set smarthost relay credentials"
+ template:
+ src: sasl_passwd
+ dest: /etc/postfix/sasl_passwd
+ mode: 0600
+
+- name: "postmap relay credentials"
+ shell: |
+ postmap /etc/postfix/sasl_passwd
+
+- name: "install aliases"
+ copy:
+ src: aliases
+ dest: /etc/aliases
+ owner: root
+ group: root
+ mode: 0644
+
+- name: "run newaliases"
+ shell: newaliases
diff --git a/ansible/roles/mail-client/templates/main.cf b/ansible/roles/mail-client/templates/main.cf
index 2c026ad..af8e058 100644
--- a/ansible/roles/mail-client/templates/main.cf
+++ b/ansible/roles/mail-client/templates/main.cf
@@ -10,7 +10,7 @@ smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
-append_dot_mydomain = no
+append_dot_mydomain = yes
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
@@ -32,7 +32,7 @@ myhostname = {{ mailname }}
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
-mydestination = {{ mailname }}, {{ hostname }}, localhost.localdomain, localhost
+mydestination = {{ mailname }}, {{ sane_debian_system_hostname }}, localhost.localdomain, localhost
relayhost = {{ relayhost }}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"