소스 검색

fix treatment of untagged NO and BAD responses

they aren't possible greeting responses. however, they are warning resp.
error reports from the server, so print them accordingly.
Oswald Buddenhagen 10 년 전
부모
커밋
4f3ef54f3a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/drv_imap.c

+ 5 - 1
src/drv_imap.c

@@ -1245,9 +1245,13 @@ imap_socket_read( void *aux )
 			} else if (!strcmp( "OK", arg )) {
 				ctx->greeting = GreetingOk;
 				parse_response_code( ctx, 0, cmd );
-			} else if (!strcmp( "BAD", arg ) || !strcmp( "NO", arg ) || !strcmp( "BYE", arg )) {
+			} else if (!strcmp( "BYE", arg )) {
 				ctx->greeting = GreetingBad;
 				parse_response_code( ctx, 0, cmd );
+			} else if (!strcmp( "NO", arg )) {
+				warn( "Warning from IMAP server: %s\n", cmd );
+			} else if (!strcmp( "BAD", arg )) {
+				error( "Error from IMAP server: %s\n", cmd );
 			} else if (!strcmp( "CAPABILITY", arg )) {
 				parse_capability( ctx, cmd );
 			} else if (!strcmp( "LIST", arg )) {