From: Maximilian Friedersdorff Date: Tue, 4 Jun 2019 12:28:17 +0000 (+0100) Subject: Add mutt configuration X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=eb92f5193e54b929d16b2285077c236e2e0c1b74;p=max%2Fsaltfiles.git Add mutt configuration --- diff --git a/states/dotfiles.sls b/states/dotfiles.sls index 20c3fed..4770519 100644 --- a/states/dotfiles.sls +++ b/states/dotfiles.sls @@ -3,3 +3,4 @@ include: - git - sway - vim + - mail diff --git a/states/mail/files/mutt/alias.asc b/states/mail/files/mutt/alias.asc new file mode 100644 index 0000000..4ef9e9e --- /dev/null +++ b/states/mail/files/mutt/alias.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP MESSAGE----- + +hQEMA9IVNZ+aIWZ7AQf/ZmOBYqMfpPg2mVWFPi1GSj3INsmYB6K4NCbJg6rF4F38 +LQbnXL/leuWx2hwqoaAYioJrMea45Kf1eBzz6LQCt3pbq40y8kCqgMcq4BEq443q +U96J+we6jo9sC5SABEfpDkBozVl6NKB8XhHd2LAD2/ddCoxsFnq0YPIqZveu5ULm +hSgvLRYVrvBfHykiwfbI1w9mk0PDzJwZEQwU78VpOscXpsOSCgF2nhHbUDtGWeKJ +sZJrDiC4PXG92XoUhy0WF2mxN7zztg7N65Lis5nHpMjFJJ+finq6UNM6NKJnp3aA +Y1Ch0igKUS23gWXgBOaNCa8vZyUSCvbzYnTgXz5ZF9LAtwFwjY273YCb/tsp4V3z ++po9XOlPY3M4hATzcQ59YZg5krQcqFn4bq1QaIPG4XYR2Cyq1C82CPgVpz7V1PRZ +r/3EKfi4Bcik6X3jC1k7CZPbNO7DfhfcpfJouWND3X9cYFzLgfmUPjdUaZfr9Lfp +LULZ0FPy7XFYgU9Zs8eTpY7/U5hrho1EdrBrxcoH8g7x2XNovRg6e8thAYCHubhI +XCzMXwavkiLQW/7CkIUHXjhmTVg5ldfK7bcaqbXrW5XPb5mJzcZf58ASOClVgAc/ +JdN7OykvcA65a6oEUqyRB2dsnBzFl/TDP0S2+95B6IK67YPTrpxVekvTVdxma2Mk +1Glx6ZUbowKwrj7irjayXOVPvBffIce9kO9Xr5MNOOllq0PK59IlAgshok3YECre +2unN+b1/Rzf/baj4Bz8Tc9VFL292a3KJLMczWK4QC2vB/45TtWDX7VzsNzwF4Lsr +iWtDfCxva9JkHFKykwsPF54EdQc4nMkU7w== +=D+3n +-----END PGP MESSAGE----- diff --git a/states/mail/files/mutt/colors.mutt b/states/mail/files/mutt/colors.mutt new file mode 100644 index 0000000..4f97f8b --- /dev/null +++ b/states/mail/files/mutt/colors.mutt @@ -0,0 +1,22 @@ +# vim: filetype=muttrc + +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color indicator brightblack yellow +color tree yellow default # arrow in threads + +color index brightmagenta default "~Q" # messages that have been replied to +color index blue default "~U" # unread messages +color index blue default "~U~$" # unread, unreferenced messages +color index black red "~D" # deleted messages + +# Sidebar +color sidebar_indicator default color17 +color sidebar_highlight default color238 +color sidebar_new green default diff --git a/states/mail/files/mutt/common.mutt b/states/mail/files/mutt/common.mutt new file mode 100644 index 0000000..3e827a6 --- /dev/null +++ b/states/mail/files/mutt/common.mutt @@ -0,0 +1,62 @@ +# Automatically render html emails. Not sure if this is a good idea +auto_view text/html +alternative_order text/plain text/enriched text/html + +# use abook for aliases +set sort_alias= alias +source "gpg --decrypt --quiet ~/.mutt/alias.asc |" +set query_command = "abook --mutt-query '%s'" +macro index,pager A "abook --add-email-quiet" "add the sender address to abook" + +macro pager \cb "\ +:set my_tmp_pipe_decode=\$pipe_decode\n\ +:set pipe_decode\n\ +|urlview\n\ +:set pipe_decode=\$my_tmp_pipe_decode\n\ +:unset my_tmp_pipe_decode\n" \ +# call urlview to extract URLS out of a message + +set text_flowed=yes +set reflow_text=yes +set editor="vim -v +':set textwidth=72' +'set fo=awq' +'set comments+=n:>'" + +# Speed up folder switch +set sleep_time=0 + +set sort=threads +set sort_aux=last-date-received + +set fast_reply=yes + +# Show message some message headers when reading mail +set pager_index_lines=10 + +# Show some context when paging through email +set pager_context=5 + +# Stop at the end of the email +set pager_stop=yes + +# Remove all headers by default +ignore * +unignore from date subject to cc + +# Use sidebar +set mail_check_stats +set sidebar_visible=yes +set sidebar_width=25 +set sidebar_folder_indent=yes +set sidebar_short_path=yes +set sidebar_divider_char='│' +set sidebar_format='%B%* %N' + +bind index,pager \CP sidebar-prev +bind index,pager \CN sidebar-next +bind index,pager \CO sidebar-open +unmailboxes * + +# Attach mail when forwarding +set mime_forward=ask-no + +# Dont flow to next message +set pager_stop=yes diff --git a/states/mail/files/mutt/gpg.rc b/states/mail/files/mutt/gpg.rc new file mode 100644 index 0000000..b2cca5b --- /dev/null +++ b/states/mail/files/mutt/gpg.rc @@ -0,0 +1,9 @@ +set crypt_autosign +set crypt_autopgp +set crypt_replyencrypt +set crypt_replysign +set crypt_replysignencrypted +set crypt_timestamp +set crypt_use_gpgme +set pgp_use_gpg_agent +set pgp_auto_decode diff --git a/states/mail/files/mutt/mutt.maf54@aber.ac.uk_offline b/states/mail/files/mutt/mutt.maf54@aber.ac.uk_offline new file mode 100644 index 0000000..870f7ba --- /dev/null +++ b/states/mail/files/mutt/mutt.maf54@aber.ac.uk_offline @@ -0,0 +1,30 @@ +macro index 'c' '?^K+' + +# Source the passwords file +#source "gpg2 -dq ~/.mutt/passwords.gpg |" +set my_aber_password=`pass Aber/Main | head -n 1` + +# Get common settings +source ~/.mutt/common.mutt + +# Encryption +source ~/.mutt/gpg.rc + +# Mutt colors +source ~/.mutt/colors.mutt + + +# Mailbox specific settings +set smtp_url = "smtp://maf54@aber.ac.uk@smtp.office365.com:587" +set smtp_pass = $my_aber_password +set from = "maf54@aber.ac.uk" +set realname = "Maximilian Friedersdorff" +set folder = "~/mail_aber" +set spoolfile = "+Inbox" +set postponed = "+Drafts" +set trash = "+Trash" +set record = "+Sent" + +set pgp_sign_as="0xDA2EDF6D" + +mailboxes "+Inbox" "+Inbox/staging" "+Lists" "+Lists/ibers-all" "+Notifications" "+Notifications/ibers-cs" "+Notifications/ibers-cs/vmcpuload" "+Notifications/NPPC" "+Notifications/NPPC/Updates" "+Notifications/NPPC/Uptime" "+Notifications/NPPC/Icinga" "+UCU" "+Suppliers" "+Suppliers/BrightComputing" "+Suppliers/ClusterVision" diff --git a/states/mail/files/mutt/mutt.maf54@aber.ac.uk_online b/states/mail/files/mutt/mutt.maf54@aber.ac.uk_online new file mode 100644 index 0000000..184daa7 --- /dev/null +++ b/states/mail/files/mutt/mutt.maf54@aber.ac.uk_online @@ -0,0 +1,36 @@ +macro index 'c' '?^K+' + +# Source the passwords file +#source "gpg2 -dq ~/.mutt/passwords.gpg |" +set my_aber_password=`pass Aber/Main | head -n 1` + +# Get common settings +source ~/.mutt/common.mutt + +# Encryption +source ~/.mutt/gpg.rc + +# Mutt colors +source ~/.mutt/colors.mutt + + +# Mailbox specific settings +set imap_user = "maf54@aber.ac.uk" +set imap_pass = $my_aber_password +set smtp_url = "smtp://maf54@aber.ac.uk@smtp.office365.com:587" +set smtp_pass = $my_aber_password +set from = "maf54@aber.ac.uk" +set realname = "Maximilian Friedersdorff" +set folder = "imaps://maf54@aber.ac.uk@outlook.office365.com:993" +set spoolfile = "+Inbox" +set postponed = "+Drafts" +set header_cache = ~/.mutt/uk.co.aber.maf54/cache/headers +set message_cachedir = ~/.mutt/uk.co.aber.maf54/cache/bodies +set certificate_file = ~/.mutt/uk.co.aber.maf54/certificates + +set trash = "+Trash" +set record = "+Sent" + +set pgp_sign_as="0xDA2EDF6D" + +mailboxes "+Inbox" "+Inbox/staging" "+Lists" "+Lists/ibers-all" "+Notifications" "+Notifications/ibers-cs" "+Notifications/ibers-cs/vmcpuload" "+Notifications/NPPC" "+Notifications/NPPC/Updates" "+Notifications/NPPC/Uptime" "+Notifications/NPPC/Icinga" "+UCU" "+Suppliers" "+Suppliers/BrightComputing" "+Suppliers/ClusterVision" diff --git a/states/mail/files/mutt/mutt.max@friedersdorff.com b/states/mail/files/mutt/mutt.max@friedersdorff.com new file mode 100644 index 0000000..5bd4d40 --- /dev/null +++ b/states/mail/files/mutt/mutt.max@friedersdorff.com @@ -0,0 +1,37 @@ +macro index 'c' '?^K+' + +# Source the passwords file +#source "gpg2 -dq ~/.mutt/passwords.gpg |" +set my_personal_password=`pass Home/xenon/mail/max@friedersdorff.com | head -n 1` + +# Get common settings +source ~/.mutt/common.mutt + +# Encryption +source ~/.mutt/gpg.rc + +# Mutt colors +source ~/.mutt/colors.mutt + +# Mailbox specific settings +unmailboxes * + +set imap_user = "max@friedersdorff.com" +set imap_pass = $my_personal_password +set smtp_url = "smtp://max@friedersdorff.com@mail.friedersdorff.com:587" +set smtp_pass = $my_personal_password +set from = "max@friedersdorff.com" +set realname = "Maximilian Friedersdorff" +set folder = "imaps://max@friedersdorff.com@mail.friedersdorff.com:993" +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set header_cache = ~/.mutt/com.friedersdorff.max/cache/headers +set message_cachedir = ~/.mutt/com.friedersdorff.max/cache/bodies +set certificate_file = ~/.mutt/com.friedersdorff.max/certificates + +set trash = "+Trash" +set record = "+Sent" + +set pgp_sign_as="0xDA2EDF6D" + +mailboxes "+INBOX" "+todo" "+quicknote" "+google" diff --git a/states/mail/gentoo.sls b/states/mail/gentoo.sls new file mode 100644 index 0000000..d375c81 --- /dev/null +++ b/states/mail/gentoo.sls @@ -0,0 +1,14 @@ +install mutt: + pkg.installed: + - name: mail-client/mutt + - require: + - file: mutt useflags + +mutt useflags: + file.managed: + - name: /etc/portage/package.use/mutt-salt + - contents: + - mail-client/mutt gpgme gpg debug imap ssl smtp + - user: root + - group: root + - mode: 640 diff --git a/states/mail/init.sls b/states/mail/init.sls new file mode 100644 index 0000000..065cb26 --- /dev/null +++ b/states/mail/init.sls @@ -0,0 +1,11 @@ +include: + - mail.{{ grains['os'] | lower}} + +mutt conf files: + file.recurse: + - name: {{ grains['homedir'] }}/.mutt + - source: salt://mail/files/mutt + - user: {{ grains['user'] }} + - group: {{ grains['user'] }} + - dir_mode: 750 + - file_mode: 640