      if (s == nil) {
        [self logWithFormat:
  	      @"ERROR(%s): could not convert data (%d bytes) into string.",
-@@ -1185,7 +1215,7 @@
+@@ -1185,7 +1325,7 @@
    route   = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
    mailbox = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
    host    = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];

 - (NSException *)exceptionForFailedMatch:(unsigned char)_match
   got:(unsigned char)_avail
 {
@@ -2225,9 +2299,9 @@
       [s release];
       
       if (c == '\n') {

 
 static __inline__ NSException *_consumeIfMatch
   (NGImap4ResponseParser *self, unsigned char _m);
@@ -648,13 +651,148 @@
   [result_ addObject:_parseUntil(self, '\n') forKey:@"description"];
 }
 
+static inline BOOL
+_isReallyQuoted(const unichar *startC, const unichar *endC) {
+  const unichar *currentChar;
+  unsigned int questionMarks;
+  BOOL result;
+
+  result = YES;
+
+  if (startC < (endC - 4)
+      && (*startC == '='
+	  && *(startC + 1) == '?')
+      && (*(endC - 2) == '?'
+	  && *(endC - 1) == '=')) {
+    currentChar = startC;
+    while (result && (currentChar < endC)) {
+      if (*currentChar == ' '
+	  || *currentChar == '\t')
+	result = NO;
+      else {
+	if (*currentChar == '?') {
+	  questionMarks++;
+	  if (questionMarks == 2) {
+	    result = ((currentChar + 1) < endC
+		      && (*(currentChar + 1) == 'q'
+			  || *(currentChar + 1) == 'Q'
+			  || *(currentChar + 1) == 'b'
+			  || *(currentChar + 1) == 'B'));
+	    if (result)
+	      currentChar++;
+	  }
+	}
+	currentChar++;
+      }
+    }
+
+    result = (result && questionMarks == 4);
+  }
+  else
+    result = NO;
+
+  return result;
+}
+
+static inline void
+_purifyQuotedString(NSMutableString *quotedString) {
+  unichar *currentChar, *qString, *maxC, *startC;
+  unsigned int max;
+  BOOL possiblyQuoted, skipSpaces;
+  NSMutableString *newString;
+
+  newString = [NSMutableString string];
+
+  max = [quotedString length];
+  qString = malloc (sizeof (unichar) * max);
+  [quotedString getCharacters: qString];
+  currentChar = qString;
+  startC = qString;
+  maxC = qString + max;
+
+  possiblyQuoted = NO;
+  skipSpaces = NO;
+
+  while (currentChar < maxC) {
+    if (skipSpaces) {
+      while (currentChar < maxC
+	     && (*currentChar == ' '
+		 || *currentChar == '\t'))
+	currentChar++;
+      startC = currentChar;
+      skipSpaces = NO;
+    }
+    else if (possiblyQuoted) {
+      while (currentChar < maxC
+	     && *currentChar != ' '
+	     && *currentChar != '\t')
+	currentChar++;
+      if (startC < currentChar) {
+	[newString appendString: [NSString stringWithCharacters: startC
+					   length: (currentChar - startC)]];
+	skipSpaces = _isReallyQuoted(startC, currentChar);
+      }
+      possiblyQuoted = NO;
+      startC = currentChar;
+    }
+    else {
+      while (currentChar < maxC
+	     && *currentChar != '=')
+	currentChar++;
+      if ((currentChar + 1 < maxC)
+	  && *(currentChar + 1) == '?') {
+	if (startC < currentChar) {
+	  [newString appendString: [NSString stringWithCharacters: startC
+					     length: (currentChar - startC)]];
+	}
+	startC = currentChar;
+	currentChar += 2;
+	possiblyQuoted = YES;
+      }
+      else
+	currentChar++;
+    }
+  }
+
+  if (startC
+      && startC < (currentChar - 1)) {
+    [newString appendString: [NSString stringWithCharacters: startC
+				       length: (currentChar - startC - 1)]];
+  }
+
+  [quotedString setString: newString];
+  free (qString);
+}
+
 - (NSString *)_parseQuotedString {
+  NSMutableString *quotedString;
+  NSString *tmpString;
