projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Workaround pop3 servers sending empty lines in message lists
[citadel.git]
/
citadel
/
modules
/
pop3client
/
serv_pop3client.c
diff --git
a/citadel/modules/pop3client/serv_pop3client.c
b/citadel/modules/pop3client/serv_pop3client.c
index 29e6bcc4dcca500ed9de6d1a2521f7daf3c62a4c..81feca096c9410fc52ac54865480b007e765a2cd 100644
(file)
--- 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;
}
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));
OneMsg = (FetchItem*) malloc(sizeof(FetchItem));
memset(OneMsg, 0, sizeof(FetchItem));
OneMsg->MSGID = atol(ChrPtr(RecvMsg->IO.IOBuf));