X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fpop3client%2Fserv_pop3client.c;fp=citadel%2Fmodules%2Fpop3client%2Fserv_pop3client.c;h=81feca096c9410fc52ac54865480b007e765a2cd;hp=29e6bcc4dcca500ed9de6d1a2521f7daf3c62a4c;hb=c90526de5f779ce083f75c7a557dee158bd927d7;hpb=2e82ffdd5614745a54c729a48bc640c2aaee6405 diff --git a/citadel/modules/pop3client/serv_pop3client.c b/citadel/modules/pop3client/serv_pop3client.c index 29e6bcc4d..81feca096 100644 --- a/citadel/modules/pop3client/serv_pop3client.c +++ b/citadel/modules/pop3client/serv_pop3client.c @@ -332,6 +332,17 @@ eNextState POP3C_GetListOneLine(pop3aggr *RecvMsg) return eSendReply; } + + /* + * work around buggy pop3 servers which send + * empty lines in their listings. + */ + if ((StrLength(RecvMsg->IO.IOBuf) == 0) || + !isdigit(ChrPtr(RecvMsg->IO.IOBuf)[0])) + { + return eReadMore; + } + OneMsg = (FetchItem*) malloc(sizeof(FetchItem)); memset(OneMsg, 0, sizeof(FetchItem)); OneMsg->MSGID = atol(ChrPtr(RecvMsg->IO.IOBuf));