]> err.no Git - sope/blobdiff - sope-mime/NGImap4/NGSieveClient.m
fixed an issue with missing Sieve scripts
[sope] / sope-mime / NGImap4 / NGSieveClient.m
index 182b7324fb29b5433bad7c910f29aef7e896fe84..e1bc357cf4ab6203a10c8e7b8610b787b1227434 100644 (file)
@@ -365,6 +365,16 @@ static BOOL     debugImap4         = NO;
   if ((script = [[self readString] autorelease]) == nil)
     return nil;
   
+  if ([script hasPrefix:@"O "] || [script hasPrefix:@"NO "]) {
+    // TODO: not exactly correct, script could begin with this signature
+    // Note: readString read 'NO ...', but the first char is consumed
+    
+    [self logWithFormat:@"ERROR: status line reports: '%@'", script];
+    return nil;
+  }
+  
+  NSLog(@"str: %@", script);
+  
   /* read response code */
   
   if ((s = [self readStringToCRLF]) == nil) {
@@ -829,7 +839,8 @@ static BOOL     debugImap4         = NO;
     return [self readQuoted];
   if (c1 == '{')
     return [self readLiteral];
-  
+
+  // Note: this does not return the first char!
   return [self readStringToCRLF];
 }