neomutt: added another gmail account

This commit is contained in:
dogeystamp 2023-04-09 10:49:20 -04:00
parent 329e15cff7
commit dcee2ccddf
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
6 changed files with 36 additions and 18 deletions

View File

@ -15,6 +15,7 @@ end
# Neomutt configs
function neomutt.local; neomutt -F .config/neomutt/neomuttrc.local; end
function neomutt.disroot; neomutt -F .config/neomutt/neomuttrc.disroot; end
function neomutt.work; neomutt -F .config/neomutt/neomuttrc.work; end
# Specific to my Gentoo system
function genlop; doas -u portage /usr/bin/genlop; end

View File

@ -0,0 +1,19 @@
# vim: filetype=muttrc
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]/All\ Mail =[Gmail]/Starred =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash
macro index ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"
macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
macro index gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
macro index gS "<change-folder>=[Gmail]/Sent Mail<enter>" "Go to sent messages"
macro index gt "<change-folder>=[Gmail]/Trash<enter>" "Go to trash"
macro index,pager d "<save-message>=[Gmail]/Trash<enter><enter>" "Trash"
macro index,pager y "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive"

View File

@ -0,0 +1,10 @@
# vim: filetype=muttrc
set from="$ID_EMAIL_WORK"
set realname="$ID_REALNAME"
set imap_user="$ID_EMAIL_WORK"
set imap_pass="`keepassxc-cli show -s -a neomutt \"$KEEPASSDB\" work/gmail`"
set smtp_url="smtps://$ID_EMAIL_WORK_USER@smtp.gmail.com/"
source ~/.config/neomutt/gmail-common.muttrc

View File

@ -5,22 +5,6 @@ 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]/All\ Mail =[Gmail]/Starred =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash
macro index ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"
macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
macro index gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
macro index gS "<change-folder>=[Gmail]/Sent Mail<enter>" "Go to sent messages"
macro index gt "<change-folder>=[Gmail]/Trash<enter>" "Go to trash"
macro index,pager d "<save-message>=[Gmail]/Trash<enter><enter>" "Trash"
macro index,pager y "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive"
source ~/.config/neomutt/gmail-common.muttrc

View File

@ -0,0 +1,2 @@
source ~/.config/neomutt/common.muttrc
source ~/.config/neomutt/gmail-work.muttrc

View File

@ -16,11 +16,13 @@ fields=$(mktemp)
cat << "EOF" > "$fields"
export ID_REALNAME=
export ID_EMAIL=
export ID_EMAIL_WORK=
EOF
keepassxc-cli show "$KEEPASSDB" meta/identity -a realname -a email | paste -d '' "$fields" - >> "$IDFILE"
keepassxc-cli show "$KEEPASSDB" meta/identity -a realname -a email -a email-work | paste -d '' "$fields" - >> "$IDFILE"
rm "$fields"
cat << "EOF" >> "$IDFILE"
export ID_EMAIL_USER=$(basename "$ID_EMAIL" @gmail.com)
export ID_EMAIL_WORK_USER=$(basename "$ID_EMAIL_WORK" @gmail.com)
EOF