From 79f40d75cd5293d297f40f01e84d8dc415ed95a1 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 17 Aug 1998 23:09:28 +0000 Subject: Second version of SDPS. svn path=/trunk/; revision=2041 --- pop3.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'pop3.c') diff --git a/pop3.c b/pop3.c index 2514c1e8..6b595fe6 100644 --- a/pop3.c +++ b/pop3.c @@ -120,7 +120,14 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) * If we see either, and we're in multidrop mode, try to use * the SDPS *ENV extension. */ - sdps_enable = MULTIDROP(ctl) && strstr(greeting, "demon."); + sdps_enable = (MULTIDROP(ctl) && strstr(greeting, "demon.")); + /* + * Use SDPS if configured, regardless of the greeting string + * returned from the POP server. (Users accessing demon by a + * POP3 proxy may need this) + */ + if (ctl->server.sdps) + sdps_enable = ctl->server.sdps; #endif /* SDPS_ENABLE */ switch (ctl->server.protocol) { @@ -543,22 +550,21 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp) if (sdps_enable) { int linecount = 0; - sdps_envto = (char *)NULL; gen_send(sock, "*ENV %d", number); do { if (gen_recv(sock, buf, sizeof(buf))) + { break; + } linecount++; - if (buf[0] == '-' || strncmp(buf , "+OK", 3)) - break; - if (linecount == 4) + if (linecount == 5) { - sdps_envto = strdup(buf); + sdps_envto = strdup(buf); error(0, 0, "*ENV returned envelope address %s"); } } while - (buf[0] != '.' && (buf[1] == '\r' || buf[1] == '\n')); + (buf[0] !='.'); } #endif /* SDPS_ENABLE */ -- cgit v1.2.3