fixed imap error when "ma acc --list" should list multiple accounts foerste
authorMatthias Förste foerste@schlittermann.de
Fri, 25 Nov 2011 14:10:17 +0100
branchfoerste
changeset 45 5f7c647f7cc4
parent 44 35441e1ae083
child 46 62eb58a0ec39
fixed imap error when "ma acc --list" should list multiple accounts
account.pm
--- a/account.pm	Fri Nov 25 14:04:30 2011 +0100
+++ b/account.pm	Fri Nov 25 14:10:17 2011 +0100
@@ -413,7 +413,11 @@
 	    #print " INTERNAL";
 	#}
 
-
+        # das imap protokoll sieht keine zustandsänderung von 'authenticated'
+        # zu 'not authenticated' vor - daher müssen wir für jeden nutzer eine
+        # eigene verbindung aufbauen
+        $imap = Mail::IMAPTalk->new(Server => $Cf->imap_server, Port => $Cf->imap_port)
+            or die "Can't connect to IMAP Server '", $Cf->imap_server, "', Port '", $Cf->imap_port, "': ", $@;
         $imap->login("$uid*" . $Cf->imap_admin, $imap_password ) or die $@;
         my $folders = $imap->list('', '*') or die $@;
         my %q;
@@ -423,6 +427,7 @@
             delete $q->{quotaroot};
             %q = ( %q, %{$q} );
         }
+        $imap->logout or die $@;
 
         # da wir uns anmelden konnten haben wir auch eine 'mbox'
         print ", mbox";