From 52459f36a57837aec6bcaf85c974a93eb3833cb9 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 5 Mar 2023 12:49:00 -0500 Subject: [PATCH] neomutt: modularized everything and added gmail account --- src/.config/fish/aliases.fish | 3 +- src/.config/neomutt/binds.muttrc | 15 +++++++ src/.config/neomutt/common.muttrc | 13 ++++++ src/.config/neomutt/disroot.muttrc | 24 +++++++++++ src/.config/neomutt/gmail.muttrc | 26 ++++++++++++ src/.config/neomutt/neomuttrc | 58 +-------------------------- src/.config/neomutt/neomuttrc.disroot | 2 + src/.config/neomutt/neomuttrc.local | 9 +---- src/.profile | 6 +++ 9 files changed, 91 insertions(+), 65 deletions(-) create mode 100644 src/.config/neomutt/binds.muttrc create mode 100644 src/.config/neomutt/common.muttrc create mode 100644 src/.config/neomutt/disroot.muttrc create mode 100644 src/.config/neomutt/gmail.muttrc create mode 100644 src/.config/neomutt/neomuttrc.disroot diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index 05ade12..96cb94c 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -23,8 +23,9 @@ function pdfr pdftotext $argv - | nvim end -# Neomutt local config +# Neomutt configs alias neomutt.local='neomutt -F .config/neomutt/neomuttrc.local' +alias neomutt.disroot='neomutt -F .config/neomutt/neomuttrc.disroot' # Specific to my Gentoo system alias genlop='doas -u portage /usr/bin/genlop' diff --git a/src/.config/neomutt/binds.muttrc b/src/.config/neomutt/binds.muttrc new file mode 100644 index 0000000..482e7d2 --- /dev/null +++ b/src/.config/neomutt/binds.muttrc @@ -0,0 +1,15 @@ +# vim: filetype=muttrc + +bind attach,index,pager \CD next-page +bind attach,index,pager \CU previous-page +bind pager g noop +bind pager gg top +bind pager G bottom +bind attach,index g noop +bind attach,index gg first-entry +bind attach,index G last-entry + +bind index,pager \CP sidebar-prev +bind index,pager \CN sidebar-next +bind index,pager \CO sidebar-open +bind index,pager \CB sidebar-toggle-visible diff --git a/src/.config/neomutt/common.muttrc b/src/.config/neomutt/common.muttrc new file mode 100644 index 0000000..124204f --- /dev/null +++ b/src/.config/neomutt/common.muttrc @@ -0,0 +1,13 @@ +# vim: filetype=muttrc + +source ~/.config/neomutt/colors.muttrc +source ~/.config/neomutt/binds.muttrc + +set sleep_time=0 +set beep=no +set editor="nvim" +set sort=reverse-date + +set sidebar_visible +set sidebar_format="%B%?F? [%F]?%* %?N?%N/?%S" +set mail_check_stats diff --git a/src/.config/neomutt/disroot.muttrc b/src/.config/neomutt/disroot.muttrc new file mode 100644 index 0000000..fbb3963 --- /dev/null +++ b/src/.config/neomutt/disroot.muttrc @@ -0,0 +1,24 @@ +# vim: filetype=muttrc + +set from="dogeystamp@disroot.org" +set realname="dogeystamp" + +set imap_user="dogeystamp" +set imap_pass="`keepassxc-cli show -s -a password \"$KEEPASSDB\" msg/disroot`" + +set smtp_url="smtps://$ID_EMAIL_USER@disroot.org/" +set smtp_pass="$imap_pass" +set smtp_authenticators = 'login' + +set folder="imaps://disroot.org/" +set spoolfile=+INBOX +set record="+Sent" +set postponed="+Drafts" +mailboxes =INBOX =Sent =Drafts =Junk =Trash + +macro index gd "=Drafts" "Go to drafts" +macro index gi "=INBOX" "Go to inbox" +macro index gS "=Sent" "Go to sent messages" +macro index gt "=Trash" "Go to trash" +macro index,pager d "=Trash" "Trash" +macro index,pager y "=~/dox/mail/arc/" "Archive" diff --git a/src/.config/neomutt/gmail.muttrc b/src/.config/neomutt/gmail.muttrc new file mode 100644 index 0000000..0f685f0 --- /dev/null +++ b/src/.config/neomutt/gmail.muttrc @@ -0,0 +1,26 @@ +# vim: filetype=muttrc + +set from="$ID_EMAIL" +set realname="$ID_REALNAME" + +set imap_user="$ID_EMAIL" +set imap_pass="`keepassxc-cli show -s -a neomutt \"$KEEPASSDB\" meta/gmail`" + +set smtp_url="smtps://$ID_EMAIL_USER@smtp.gmail.com/" +set smtp_pass="$imap_pass" +set smtp_authenticators = 'login' + +set folder="imaps://imap.gmail.com/" +set spoolfile=+INBOX +set record="+[Gmail]/Sent Mail" +set postponed="+[Gmail]/Drafts" +mailboxes =INBOX =[Gmail]/Sent\ Mail =[Gmail]/Starred =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash + +macro index ga "=[Gmail]/All Mail" "Go to all mail" +macro index gd "=[Gmail]/Drafts" "Go to drafts" +macro index gi "=INBOX" "Go to inbox" +macro index gs "=[Gmail]/Starred" "Go to starred messages" +macro index gS "=[Gmail]/Sent Mail" "Go to sent messages" +macro index gt "=[Gmail]/Trash" "Go to trash" +macro index,pager d "=[Gmail]/Trash" "Trash" +macro index,pager y "=[Gmail]/All Mail" "Archive" diff --git a/src/.config/neomutt/neomuttrc b/src/.config/neomutt/neomuttrc index c7f1269..42e6176 100644 --- a/src/.config/neomutt/neomuttrc +++ b/src/.config/neomutt/neomuttrc @@ -1,56 +1,2 @@ -source ~/.config/neomutt/colors.muttrc - -set folder = ~/dox/mail/disroot/ -set spoolfile = "+Inbox" -set postponed = "+Drafts" -set record = "+Sent" -set trash = "+Trash" -set header_cache = ~/.cache/neomutt/headers -set message_cachedir = ~/.cache/neomutt/bodies -set certificate_file = /etc/ssl/certs/ca-certificates.crt -set tmpdir = .cache/neomutt/tmp - -set wait_key = no -set mbox_type = Maildir -set use_from=yes -set ssl_starttls=yes -set ssl_force_tls=yes - -set editor="nvim" -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 sidebar_visible = yes -set sidebar_width = 20 -set sidebar_short_path = yes -set sidebar_next_new_wrap = yes -set mail_check_stats -set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' -set charset = "utf-8" - -mailboxes =Inbox -mailboxes =Archive =Sent =Drafts =Junk =Trash =../arc - -set sendmail="/usr/bin/msmtp -a mail" - -macro index O "mbsync -c \"$XDG_CONFIG_HOME\"/isync/mbsyncrc disroot " "run offlineimap to sync all mail" -macro index,pager A "=../arc" "Archive Message" -bind index,pager \CP sidebar-prev -# Ctrl-P – Previous Mailbox -bind index,pager \CN sidebar-next -# Ctrl-N – Next Mailbox -bind index,pager \CO sidebar-open -# Ctrl-O – Open Highlighted Mailbox - -set realname = "dogeystamp" -set signature = ~/dox/sig +source ~/.config/neomutt/common.muttrc +source ~/.config/neomutt/gmail.muttrc diff --git a/src/.config/neomutt/neomuttrc.disroot b/src/.config/neomutt/neomuttrc.disroot new file mode 100644 index 0000000..765f3d3 --- /dev/null +++ b/src/.config/neomutt/neomuttrc.disroot @@ -0,0 +1,2 @@ +source ~/.config/neomutt/common.muttrc +source ~/.config/neomutt/disroot.muttrc diff --git a/src/.config/neomutt/neomuttrc.local b/src/.config/neomutt/neomuttrc.local index 93baa88..7cba401 100644 --- a/src/.config/neomutt/neomuttrc.local +++ b/src/.config/neomutt/neomuttrc.local @@ -1,10 +1,3 @@ # Configuration for reading local mail on servers -source ~/.config/neomutt/colors.muttrc - -set header_cache = ~/.cache/neomutt/headers -set message_cachedir = ~/.cache/neomutt/bodies -set certificate_file = /etc/ssl/certs/ca-certificates.crt -set tmpdir = .cache/neomutt/tmp - -set editor="nvim" +source ~/.config/neomutt/common.muttrc diff --git a/src/.profile b/src/.profile index f83f72a..20fa577 100644 --- a/src/.profile +++ b/src/.profile @@ -51,4 +51,10 @@ export REALNAME="dogeystamp" export EMAIL="dogeystamp@disroot.org" export KEYID="A3A5FA72F8E5E54FBEE425057225FE3592EFFA38" +export KEEPASSDB="$HOME"/dox/sec/pass.kdbx +# Identity (see ~/.local/bin/identity.sh) +if [ -r "$XDG_CONFIG_HOME"/identity ]; then + source "$XDG_CONFIG_HOME"/identity +fi + source .config/bashrc