fetchmail-friends
[Top] [All Lists]

fetchmail uidl problem and fix with buggy pop3 servers

2001-01-29 19:22:03
In your FAQ you write if I fix a POP3-related problem I should send it to
you. So here it is.

Problem:
My pop3 server doesn't confirm to the RFC1725 standard correctly. It sends
UID-s this way:

C: UIDL
S: +OK
S: +OK 1 whqtswO00WBw418f9t5JxYwZ
S: +OK 2 QhdPYR:00WBw1Ph7x7

The +OK's at the beginning of each line cause fetchmail to be unable to
read the id's. 
My fix to pop3.c is here:
http://ludens.elte.hu/~gaborh/pop3.c

But I'll explain it here also. Line numbers refer to _my_ pop3.c file.

line 43:
#define OK_WITH_UIDLS(s)        (s[0] == '+' && s[1]=='O' && s[2]=='K' && 
s[3]==' ')
//It tells you wether the buffer contains the '+OK' at the beginning

line 424:
char dontneed [4];
//here will we put the spare '+OK'

lines 462-467
else if (
        OK_WITH_UIDLS(buf) ?
        (sscanf(buf, "%s %d %s", dontneed, &num, id) ==3) :
        (sscanf(buf, "%d %s", &num, id) == 2)
)
//if the buffer begins with "+OK " we just simply throw it away



<Prev in Thread] Current Thread [Next in Thread>