diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-06-05 17:23:30 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-06-05 17:23:30 +0000 |
commit | 60a36fc394fbf4e17f0a8c5ca8b1a97b3a54da8b (patch) | |
tree | de3f2fffc59fbafb961ed5ffbba35428d4c35115 /pop3.c | |
parent | b9428b5dc13ce12e1351cd5178054fb0608b6eb3 (diff) | |
download | fetchmail-60a36fc394fbf4e17f0a8c5ca8b1a97b3a54da8b.tar.gz fetchmail-60a36fc394fbf4e17f0a8c5ca8b1a97b3a54da8b.tar.bz2 fetchmail-60a36fc394fbf4e17f0a8c5ca8b1a97b3a54da8b.zip |
Reinstate the fetchall kluge.
svn path=/trunk/; revision=1914
Diffstat (limited to 'pop3.c')
-rw-r--r-- | pop3.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -234,8 +234,8 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) */ sleep(3); /* to be _really_ safe, probably need sleep(5)! */ - /* we're peek-capable because the TOP command exists */ - peek_capable = TRUE; + /* we're peek-capable if use of TOP is enabled */ + peek_capable = !(ctl->fetchall || ctl->keep); /* we're approved */ return(PS_SUCCESS); @@ -534,6 +534,12 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp) * In that case, marking the seen flag is the only way to prevent the * message from being re-fetched on subsequent runs. * + * Also use RETR if fetchall is on. This gives us a workaround + * for servers like usa.net's that bungle TOP. It's pretty + * harmless because fetchall guarantees that any message dropped + * by an interrupted RETR will be picked up on the next poll of the + * site. + * * We take advantage here of the fact that, according to all the * POP RFCs, "if the number of lines requested by the POP3 client * is greater than than the number of lines in the body, then the @@ -543,7 +549,7 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp) * accept; it's much lower than the natural value 2147483646 (the maximum * twos-complement signed 32-bit integer minus 1) */ - if (ctl->keep) + if (ctl->keep || ctl->fetchall) gen_send(sock, "RETR %d", number); else gen_send(sock, "TOP %d 99999999", number); |