commit 894c57055611e0602ac3133f308a1a2b9ed39a9f
parent 9b65e1da8b6ec775b9f28dfa89ee19252e8a1c97
Author: Jaromil <jaromil@dyne.org>
Date:   Tue, 25 Aug 2015 10:38:00 +0200
small fix to passwords configured in accounts
Diffstat:
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/build/build-gnu.sh b/build/build-gnu.sh
@@ -18,7 +18,7 @@ mkdir -p build/gnu
 debian_req() {
     for p in "$@"; do
         { dpkg --get-selections "$p" | grep -q "[[:space:]]install$" } || {
-            apt-get install "$p" } || {
+            sudo apt-get install "$p" } || {
             print "Failed to install $p"
             return 1
         }
diff --git a/src/zlibs/email b/src/zlibs/email
@@ -189,10 +189,12 @@ fetch() {
     type=imap
     host=$imap
     port=$imap_port
-    ask_password
-    [[ $? = 0 ]] || {
-        error "Impossible to fetch email for account ${account}";
-        return 1 }
+    [[ "$password" = "" ]] && {
+        ask_password
+        [[ $? = 0 ]] || {
+            error "Impossible to fetch email for account ${account}";
+            return 1 }
+    }
 
     # this puts total size in $imap_info
     # experimental only, commented out for now
@@ -362,7 +364,7 @@ smtp_send() {
     [[ "$password" = "" ]] && {
         ask_password
         [[ $? = 0 ]] || {
-            error "Error retrieving password for $login on $smtp"
+            error "Error retrieving smtp password for $login on $smtp"
             unset password
             return 1 }
     }
@@ -537,11 +539,12 @@ peek() {
     type=imap
     host=$imap
     port=$imap_port
-    ask_password
-
-    { test $? != 0 } && {
-        error "Error retrieving password for $login on $imap"
-        unset password all; return 1
+    [[ "$password" = "" ]] && {
+	ask_password
+    	[[ $? = 0 ]] || {
+        	error "Error retrieving imap password for $login on $imap"
+        	unset password all; return 1
+    	}
     }
 
     ztmp