jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit 783f4a8bb5eecb86b2c75e9123f4360fd8c24000
parent 82e4069c80174893eed77c7355b263cb790d75ae
Author: Jaromil <jaromil@dyne.org>
Date:   Fri, 15 Apr 2016 12:43:56 +0200

avoid writing a temporary password file

Diffstat:
Msrc/jaro | 16++++++++++++++++
Msrc/zlibs/email | 22+++-------------------
2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/jaro b/src/jaro @@ -808,6 +808,22 @@ main() { 'source') return 0 ;; + askpass) + read_account $account + ask_password + # shell escape special chars + print - "$password" | sed ' +s/\&/\\&/g +s/\$/\\$/g +s/ /\\ /g +s/;/\\;/g +s/\?/\\?/g +s/\*/\\*/g +' + # TODO: verify if this works with all passwords + exitcode=$? + ;; + imap) imapcmd="$1" case $1 in diff --git a/src/zlibs/email b/src/zlibs/email @@ -559,21 +559,6 @@ peek() { type=imap host=$imap port=$imap_port - [[ "$password" = "" ]] && { - ask_password - [[ $? = 0 ]] || { - error "Error retrieving imap password for $login on $imap" - unset password all; return 1 - } - } - - ztmp - _pass_tmp=$ztmpfile - sysread -o 1 <<EOF >> "$_pass_tmp" -set imap_pass = "${password}" -# set imap_peek = yes -EOF - unset password # when peeking and using mutt-kz use the sidebar is_mutt_kz && { @@ -596,18 +581,17 @@ EOF # also set the spoolfile name to INBOX (imap's default) rm -f "$MAILDIRS/.mutt/muttpass" sysread -o 1 <<EOF > "$MAILDIRS/.mutt/muttpass" -source '$_pass_tmp' +set imap_pass = \`$WORKDIR/bin/jaro -a ${account} askpass\` unset mark_old set sort=reverse-date-received set folder=${iproto}://${ilogin}@${imap}:${imap_port} set spoolfile=${iproto}://${ilogin}@${imap}:${imap_port}/INBOX EOF - # schedule deletion of pass files after use + # schedule deletion of muttpass file after use sched +3 " rm -f $MAILDIRS/.mutt/muttpass -touch $MAILDIRS/.mutt/muttpass -${=rm} -f $_pass_tmp" # zero the tmp passfile after a second +touch $MAILDIRS/.mutt/muttpass" _mutt -f ${iproto}://${ilogin}@${imap}:${imap_port}/${folder}