From c90526de5f779ce083f75c7a557dee158bd927d7 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 22 Mar 2013 18:35:20 +0100 Subject: [PATCH] Workaround pop3 servers sending empty lines in message lists --- citadel/modules/pop3client/serv_pop3client.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)); -- 2.30.2