diff --git a/roles/neomutt/templates/account.neomuttrc.j2 b/roles/neomutt/templates/account.neomuttrc.j2 index 14f8768..dcb7003 100644 --- a/roles/neomutt/templates/account.neomuttrc.j2 +++ b/roles/neomutt/templates/account.neomuttrc.j2 @@ -1,11 +1,8 @@ # neomuttrc file for {{ account.fulladdress }} -set hostname = "{{ account.fulladdress.split('@') | last }}" - # SMTP -#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 }}" +set smtp_pass = "`pass {{ account.passlocation }}`" {% if neomutt_version | int >= 20211015 %} set real_name = "{{ account.realname }}" {% else %} @@ -13,6 +10,7 @@ set realname = "{{ account.realname }}" {% endif %} set from = "{{ account.fulladdress }}" set use_from = yes +set hostname = "{{ account.fulladdress.split('@') | last }}" # IMAP {% if account.imap %} @@ -36,3 +34,5 @@ set imap_check_subscribed set ssl_starttls = yes set ssl_force_tls = yes + +account-hook $folder "set imap_user={{ account.imap.login }} imap_pass=`pass {{ account.passlocation }}`" diff --git a/roles/neomutt/templates/neomuttrc.j2 b/roles/neomutt/templates/neomuttrc.j2 index 0c1708e..f8e47bd 100644 --- a/roles/neomutt/templates/neomuttrc.j2 +++ b/roles/neomutt/templates/neomuttrc.j2 @@ -6,20 +6,21 @@ #set smtp_authenticators = 'gssapi:login' #set query_command = "abook --mutt-query '%s'" #set rfc2047_parameters = yes -#set sleep_time = 0 # Pause 0 seconds for informational messages -#set markers = no # Disables the `+` displayed at line wraps -#set mark_old = no # Unread mail stay unread until read -#set mime_forward = yes # attachments are forwarded with mail -#set wait_key = no # mutt won't ask "press key to continue" -#set fast_reply # skip to compose when replying -#set fcc_attach # save attachments with the body -#set forward_format = "Fwd: %s" # format of subject when forwarding -#set forward_quote # include message in forwards -#set reverse_name # reply as whomever it was to -#set include # include message in replies +#set sleep_time = 0 # pause 0 seconds for informational messages +#set markers = no # disables the `+` displayed at line wraps +#set mark_old = no # unread mail stay unread until read +#set mime_forward = yes # attachments are forwarded with mail +#set wait_key = no # don't ask "press key to continue" +#set fast_reply # skip to compose when replying +#set fcc_attach # save attachments with the body +#set forward_format = "Fwd: %s" # format of subject when forwarding +#set forward_quote # include message in forwards +#set reverse_name # reply as whomever it was to +#set include # include message in replies set mail_check = 120 # how often to check for new mail (in seconds) set imap_keepalive = 300 # intermittent polling to keep connection alive (in seconds) -#auto_view text/html # automatically show html (mailcap uses lynx) +unset imap_passive # open imap connection when checking for mail +#auto_view text/html # automatically show html (mailcap uses lynx) #auto_view application/pgp-encrypted #alternative_order text/plain text/enriched text/html @@ -58,10 +59,10 @@ set imap_keepalive = 300 # intermittent polling to keep connection alive #bind index,pager,browser u half-up #bind index,pager S sync-mailbox #bind index,pager R group-reply -#bind index \031 previous-undeleted # Mouse wheel -#bind index \005 next-undeleted # Mouse wheel -#bind pager \031 previous-line # Mouse wheel -#bind pager \005 next-line # Mouse wheel +#bind index \031 previous-undeleted # Mouse wheel +#bind index \005 next-undeleted # Mouse wheel +#bind pager \031 previous-line # Mouse wheel +#bind pager \005 next-line # Mouse wheel #bind editor complete-query #macro index,pager gi "=INBOX" "go to inbox" @@ -177,5 +178,8 @@ set sidebar_visible = yes {% for account in accounts %} source ~/.config/neomutt/accounts/{{ account.fulladdress }}.neomuttrc -#macro index,pager i1 'source ~/.config/neomutt/accounts/{{ account.fulladdress }}.neomuttrc!;' "switch to {{ account.fulladdress }}" +folder-hook $folder source ~/.config/neomutt/accounts/{{ account.fulladdress }}.neomuttrc +macro index,pager 'source ~/.config/neomutt/accounts/{{ account.fulladdress }}.neomuttrc!;' "switch to {{ account.fulladdress }}" + {% endfor %} +#macro index 'c' '? ='