aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-03-26 17:26:42 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-03-26 17:26:42 +0000
commitcb84a102dd4c8b647910670bf063bf66473c9c20 (patch)
tree13738f86fc5e943182f47f47444029a894af62c0
parent09eb76026c868509728cf4075812784914026aa7 (diff)
downloadfetchmail-cb84a102dd4c8b647910670bf063bf66473c9c20.tar.gz
fetchmail-cb84a102dd4c8b647910670bf063bf66473c9c20.tar.bz2
fetchmail-cb84a102dd4c8b647910670bf063bf66473c9c20.zip
Document the fact that TOP doesn't really let us do split fetches a la IMAP.
svn path=/trunk/; revision=1726
-rw-r--r--pop3.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/pop3.c b/pop3.c
index f189e39d..75fa0082 100644
--- a/pop3.c
+++ b/pop3.c
@@ -486,11 +486,36 @@ static int pop3_is_old(int sock, struct query *ctl, int num)
str_find (&ctl->newsaved, num)));
}
+#ifdef UNUSED
+/*
+ * We could use this to fetch headers only as we do for IMAP. The trouble
+ * is that there's no way to fetch the body only. So the following RETR
+ * would have to re-fetch the header. Enough messages have longer headers
+ * than bodies to make this a net loss.
+ */
+static int pop_fetch_headers(int sock, struct query *ctl,int number,int *lenp)
+/* request headers of nth message */
+{
+ int ok;
+ char buf[POPBUFSIZE+1];
+
+ /* phase = PHASE_FETCH */
+
+ gen_send(sock, "TOP %d 0", number);
+ if ((ok = pop3_ok(sock, buf)) != 0)
+ return(ok);
+
+ *lenp = -1; /* we got sizes from the LIST response */
+
+ return(PS_SUCCESS);
+}
+#endif /* UNUSED */
+
static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)
/* request nth message */
{
int ok;
- char buf [POPBUFSIZE+1];
+ char buf[POPBUFSIZE+1];
/* phase = PHASE_FETCH */
@@ -500,7 +525,7 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)
*lenp = -1; /* we got sizes from the LIST response */
- return(0);
+ return(PS_SUCCESS);
}
static int pop3_delete(int sock, struct query *ctl, int number)