---
- name: Install neomutt
  pacman: name=neomutt state=present

- name: Make neomutt available as mutt
  file: src=/usr/bin/neomutt
        dest=/usr/local/bin/mutt
        state=link

- name: Verify mutt firejail local profile exists
  file: path=/etc/firejail/mutt.local state=touch
  tags:
    - firejail

- name: Whitelist mutt related files
  blockinfile:
    dest: /etc/firejail/mutt.local
    block: |
        noblacklist ~/.config/vdirsyncer
        noblacklist ~/.vdirsyncer
        noblacklist ~/.calendars
        noblacklist ~/.contacts
        noblacklist ~/.mbsyncrc
        noblacklist ~/.offlineimap
        noblacklist ~/.offlineimaprc
  tags:
    - firejail

- name: Install urlview
  aur: name=urlview user={{ user.name }}
  tags:
    - aur

- name: Install notmuch
  pacman: name=notmuch state=present

- include: msmtp.yml
- include: isync.yml
- include: offlineimap.yml
- include: mailsync.yml
