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 f730f3e8cac5050e6be2059deefdfa008f99b076
parent 290ba973c78e6a88203859509f73782d345ee321
Author: Jaromil <jaromil@dyne.org>
Date:   Thu, 30 Oct 2014 17:14:32 +0100

correctly list imap folders in all cases (tls and ssl)

Diffstat:
Msrc/jaro | 4++--
Msrc/zlibs/email | 5-----
Msrc/zlibs/filters | 2+-
Msrc/zlibs/imap | 20++++++++++++--------
4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/jaro b/src/jaro @@ -739,7 +739,7 @@ main() read_account $account ask_password bytes_total=`imap_get_size "$2"` - notice "Size of account $login on $host" + notice "Size of account $login on $imap" act "$bytes_total bytes" mib_total=$(( $bytes_total / 1048576 )) act "$mib_total MB (MiB)" @@ -749,7 +749,7 @@ main() read_account $account ask_password folders=(`imap_list_folders`) - notice "List of folders for $login on $host" + notice "List of folders for $login on $imap" for f in $folders; do print "$f" done diff --git a/src/zlibs/email b/src/zlibs/email @@ -235,11 +235,6 @@ fetch() { { test $? = 0 } || { error "planning to delete mails from server, account option: $accountopt" } - print $fmconf -# QUAAA -# return 0 - - # try login without doing anything print "$fmconf" | fetchmail -c -f - res=$? diff --git a/src/zlibs/filters b/src/zlibs/filters @@ -470,7 +470,7 @@ EOF return 0 } -typeset -AlU sieve_filter_map +typeset -A sieve_filter_map # sieve_complex_filter gets a map of patterns as an argument and builds a # long rule for which any key matching it gets delivered to its value folder # $1 = conditional directive diff --git a/src/zlibs/imap b/src/zlibs/imap @@ -22,20 +22,25 @@ run_imap_query() { if [ "$transport" = "plain" ]; then - func "running plain imap query via netcat, no encryption" - nc ${imap} ${imap_port} -q 10 2>&1 + func "running plain imap query via netcat, no encryption" + nc ${imap} ${imap_port} -q 10 2>&1 + elif [ "$transport" = "tls" ]; then + func "running tls imap query via openssl, encrypted" + openssl s_client -quiet -connect ${imap}:${imap_port} 2>&1 + elif [ "$transport" = "ssl" ]; then + func "running ssl imap query via openssl, encrypted" + openssl s_client -starttls imap -quiet -connect ${imap}:${imap_port} 2>&1 else - func "running ssl imap query via openssl, encrypted" - openssl s_client -starttls imap -quiet -connect ${imap}:${imap_port} 2>&1 + error "unknown transport \"$transport\" for a imap query" fi } check_imap() { [[ $name == "" ]] && { - error "get_imap_info() called with no account loaded" - return 1 } + error "get_imap_info() called with no account loaded" + return 1 } [[ "$imap" == "" ]] && { - error "get_imap_info() called on a non-imap account: $name on $imap" + error "get_imap_info() called on a non-imap account: $name on $imap" return 1 } } @@ -48,7 +53,6 @@ B00001 LOGIN \"${login}\" \"${password}\" B00002 LIST \"\" * B00003 LOGOUT" response=`print $query | run_imap_query` - folders=`print $response | awk ' /^\* LIST/ { gsub(/"/, "", $5); print $5 }' | tr -d '\r'` print $folders