diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | pop3.c | 31 | ||||
-rw-r--r-- | todo.html | 27 |
3 files changed, 42 insertions, 18 deletions
@@ -4,6 +4,8 @@ * Sunil Shetye's fix to force fetchsizelimit to 1 for APOP and RPOP. * PopDel.py removed from contrib at author's request. +* Matthias Andree's fix for Sunil Shetye's fetvh-split patch +* include James Stone's moldremover.py script. fetchmail-6.2.5 (Wed Oct 15 18:39:22 EDT 2003), 23079 lines: @@ -911,25 +911,24 @@ static int pop3_getrange(int sock, static int pop3_getpartialsizes(int sock, int first, int last, int *sizes) /* capture the size of message #first */ { - int ok; + int ok, i; char buf [POPBUFSIZE+1]; unsigned int num, size; - /* for POP3, we can get the size of one mail only! */ - if (first != last) - { - report(stderr, "cannot get a range of message sizes (%d-%d).\n", first, last); - return(PS_PROTOCOL); - } - gen_send(sock, "LIST %d", first); - if ((ok = pop3_ok(sock, buf)) != 0) - return(ok); - if (sscanf(buf, "%u %u", &num, &size) == 2) { - if (num == first) - sizes[0] = size; - else - /* warn about possible attempt to induce buffer overrun */ - report(stderr, "Warning: ignoring bogus data for message sizes returned by server.\n"); + for (i = first; i <= last; i++) { + gen_send(sock, "LIST %d", i); + if ((ok = pop3_ok(sock, buf)) != 0) + return(ok); + if (sscanf(buf, "%u %u", &num, &size) == 2) { + if (num == i) + sizes[i - first] = size; + else + /* warn about possible attempt to induce buffer overrun + * + * we expect server reply message number and requested + * message number to match */ + report(stderr, "Warning: ignoring bogus data for message sizes returned by server.\n"); + } } return(ok); } @@ -19,7 +19,7 @@ content="Known bugs and to-do items in fetchmail" /> <tr> <td width="30%">Back to <a href="/~esr">Eric's Home Page</a></td> <td width="30%" align="center">Up to <a href="/~esr/sitemap.html">Site Map</a></td> -<td width="30%" align="right">$Date: 2003/10/10 10:55:46 $</td> +<td width="30%" align="right">$Date: 2004/01/13 03:21:41 $</td> </tr> </table> @@ -83,6 +83,29 @@ failed" (leaving the message on the server, not putting it into found. (This is so you don't lose mail if you configure the wrong envelope header.)</p> +<p>Matthias Andree writes:</p> + +<blockquote> +<p>NOTE that the current code need optimization, if I have +unseen articles 3 and 47, fetchmail will happily request LIST for +articles 3...47 rather than just 3 and 47. In cases where the message +numbers are far apart, this involves considerable overhead - which +could be alleviated by pipelining the list commands, which needs +either asynchronous reading while sending the commands, or knowing the +send buffer, to avoid deadlocks. Unfortunately, I don't have the time +to delve deeper into the code and look around.</p> + +<p>Note that such a pipelining function would be of universal use, so it +should not be in pop3.c or something. I'd think the best approach is to +call a "sender" function with the command and a callback, and the sender +will call the receiver when the send buffer is full and call the +callback function for each reply received.</p> + +<p>See the ESMTP PIPELINING RFC for details on the deadlock avoidance +requirements.</p> +</blockquote> + + <p>The <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=fetchmail&archive=no"> Debian bug-tracking page for fetchmail</a> lists other bug @@ -93,7 +116,7 @@ reports.</p> <tr> <td width="30%">Back to <a href="/~esr">Eric's Home Page</a></td> <td width="30%" align="center">Up to <a href="/~esr/sitemap.html">Site Map</a></td> -<td width="30%" align="right">$Date: 2003/10/10 10:55:46 $</td> +<td width="30%" align="right">$Date: 2004/01/13 03:21:41 $</td> </tr> </table> |