Browse Source

fix cram-md5 authentication

we need to send a newline after the response for imap to grok it.
Oswald Buddenhagen 12 years ago
parent
commit
fbfcfea5dc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/drv_imap.c

+ 3 - 1
src/drv_imap.c

@@ -1209,7 +1209,9 @@ do_cram_auth( imap_store_t *ctx, struct imap_cmd *cmdp, const char *prompt )
 		printf( ">+> %s\n", resp );
 		fflush( stdout );
 	}
-	return socket_write( &ctx->conn, resp, l, GiveOwn );
+	if (socket_write( &ctx->conn, resp, l, GiveOwn ) < 0)
+		return -1;
+	return socket_write( &ctx->conn, "\r\n", 2, KeepOwn );
 }
 #endif