Check neomutt version to adapt template accordingly
This commit is contained in:
parent
3035ff46ed
commit
a683a8ee7c
3 changed files with 12 additions and 1 deletions
|
@ -15,6 +15,10 @@
|
|||
- neomutt
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
|
||||
- name: Get installed neomutt version
|
||||
set_fact:
|
||||
neomutt_version: "{{ lookup('pipe', 'neomutt -v') | regex_search('NeoMutt 20\\d{6}') | split | last }}"
|
||||
|
||||
- name: Create neomutt config directory
|
||||
file:
|
||||
path: ~/.config/neomutt
|
||||
|
|
|
@ -6,7 +6,11 @@ set hostname = "{{ account.fulladdress.split('@') | last }}"
|
|||
#set sendmail = "msmtp -a {{ account.fulladdress }}"
|
||||
set smtp_pass = "`pass {{ account.passlocation }}`"
|
||||
set smtp_url = "{{ account.smtp.proto }}://{{ account.smtp.login }}@{{ account.smtp.server }}:{{ account.smtp.port }}"
|
||||
{% if neomutt_version | int >= 20211015 %}
|
||||
set real_name = "{{ account.realname }}"
|
||||
{% else %}
|
||||
set realname = "{{ account.realname }}"
|
||||
{% endif %}
|
||||
set from = "{{ account.fulladdress }}"
|
||||
set use_from = yes
|
||||
|
||||
|
@ -20,7 +24,11 @@ set folder = "~/.local/share/mail/{{ account.fulladdress }}"
|
|||
{% endif %}
|
||||
set header_cache = "~/.cache/neomutt/{{ account.fulladdress }}/headers"
|
||||
set mbox_type = Maildir
|
||||
{% if neomutt_version | int >= 20211015 %}
|
||||
set spool_file = "{{ account.other_vars.spool_file | default('+INBOX') }}"
|
||||
{% else %}
|
||||
set spoolfile = "{{ account.other_vars.spool_file | default('+INBOX') }}"
|
||||
{% endif %}
|
||||
set record = "{{ account.other_vars.record | default('+Sent') }}"
|
||||
set postponed = "{{ account.other_vars.postponed | default('+Drafts') }}"
|
||||
set trash = "{{ account.other_vars.trash | default('+Trash') }}"
|
||||
|
|
1
todo
1
todo
|
@ -1,3 +1,2 @@
|
|||
support multiple remotes in git clones
|
||||
add upstream to i3blocks-contrib repo
|
||||
neomutt: prior to NeoMutt 2021-10-15, use realname and spoolfile, after, use real_name and spool_file
|
||||
|
|
Loading…
Add table
Reference in a new issue