mutt: add custom command to get pass

This commit is contained in:
lelgenio 2022-01-31 22:20:01 -03:00
parent f6a17f3726
commit 57f6cb3611
4 changed files with 5 additions and 3 deletions

View File

@ -39,9 +39,11 @@ variables:
personal:
user: lelgenio
mail: disroot.org
pass: disroot.org
work:
user: leonardo@wopus.com.br
mail: wopus.com.br
pass: wopus_email
###############################################################

View File

@ -4,7 +4,7 @@ IMAPStore {{@@ name @@}}-remote
Host {{@@ info.mail @@}}
Port 993
User {{@@ info.user.split("@")[0] @@}}@{{@@ info.mail @@}}
PassCmd "_pass_get {{@@ info.mail @@}}"
PassCmd "_pass_get {{@@ info.pass @@}}"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt

View File

@ -28,7 +28,7 @@ set my_source_command = \
{%@@ for name, info in mail.items() @@%}
set my_source_command = \
"_mutt_get-mail '{{@@ name @@}}' '{{@@ info.user.split("@")[0] @@}}' '{{@@ info.user @@}}' '{{@@ info.mail @@}}' |"
"_mutt_get-mail '{{@@ name @@}}' '{{@@ info.user.split("@")[0] @@}}' '{{@@ info.user @@}}' '{{@@ info.mail @@}}' '{{@@ info.pass @@}}' |"
macro index,pager <f{{@@ loop.index @@}}> "<sync-mailbox><enter-command>source \"$my_source_command\"<enter><change-folder>!<enter>"
{%@@ endfor @@%}

View File

@ -4,7 +4,7 @@ my_path="$1"
my_name="$2"
my_user="$3"
my_host="$4"
my_pass=`_pass_get "$my_host"`
my_pass="$5"
cat <<EOF
set realname = "$my_name"