You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.1 KiB
YAML

---
- name: Read existing Uberspace domains
command: uberspace mail domain list
register: uberspace_mail_domain_result
changed_when: false
- name: Add configured domains to Uberspace config
shell: "uberspace mail domain add $(idn {{ item }})"
when: item not in uberspace_mail_domain_result.stdout_lines
loop: "{{ mail_domains.get(ansible_facts.user_id, []) }}"
- name: Set up .qmail file
copy:
content: "{{ ansible_facts.user_id }}-lukas"
dest: "{{ ansible_facts.env.HOME }}/.qmail"
- name: Delete system Maildir
file:
path: "{{ ansible_facts.env.HOME }}/Maildir"
state: absent
- name: Set up local mail user
import_role:
name: snapstromegon.uberspace_mail_user
vars:
user: lukas
password: "{{ mail_passwords[ansible_facts.user_id] }}"
- name: Enable catchall mode
import_role:
name: snapstromegon.uberspace_mail_catchall
vars:
user: lukas
- name: Create mailfilter config
template:
src: mailfilters/{{ ansible_facts.user_id }}.j2
dest: "{{ ansible_facts.env.HOME }}/.config/mailfilter"
mode: 0600
- name: Use custom mailfilter in .qmail-default
copy:
content: "|maildrop /home/{{ ansible_facts.user_id }}/.config/mailfilter"
dest: "{{ ansible_facts.env.HOME }}/.qmail-default"
- name: Delete Uberspace .spamfolder config
file:
path: "{{ ansible_facts.env.HOME }}/.spamfolder"
state: absent
- name: Create qdated key
command:
cmd: qdated-makekey
creates: "{{ ansible_facts.env.HOME }}/.qdated-key"
- name: Read qdated key
slurp:
src: "{{ ansible_facts.env.HOME }}/.qdated-key"
register: qdated_key
no_log: yes
- name: Register qdated key as fact
set_fact:
qdated_key: "{{ qdated_key.content | b64decode }}"
no_log: yes
- name: Set up .qmail-dated-default file
template:
src: qmail-dated.j2
dest: "{{ ansible_facts.env.HOME }}/.qmail-dated-default"
- name: Create mutt config directory
file:
path: "{{ ansible_facts.env.HOME }}/.mutt"
state: directory
- name: Set up mutt config
template:
src: muttrc.j2
dest: "{{ ansible_facts.env.HOME }}/.mutt/muttrc"