aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-08-17 23:09:28 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-08-17 23:09:28 +0000
commit79f40d75cd5293d297f40f01e84d8dc415ed95a1 (patch)
treefd4860e856a7aa56df6f2141bfa2ae7fc6d7b3e7 /pop3.c
parent6f3696306bffb7b9b76fbd4658c7435a37f9946d (diff)
downloadfetchmail-79f40d75cd5293d297f40f01e84d8dc415ed95a1.tar.gz
fetchmail-79f40d75cd5293d297f40f01e84d8dc415ed95a1.tar.bz2
fetchmail-79f40d75cd5293d297f40f01e84d8dc415ed95a1.zip
Second version of SDPS.
svn path=/trunk/; revision=2041
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c20
1 files changed, 13 insertions, 7 deletions
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 */