diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-08-17 23:09:28 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-08-17 23:09:28 +0000 |
commit | 79f40d75cd5293d297f40f01e84d8dc415ed95a1 (patch) | |
tree | fd4860e856a7aa56df6f2141bfa2ae7fc6d7b3e7 /pop3.c | |
parent | 6f3696306bffb7b9b76fbd4658c7435a37f9946d (diff) | |
download | fetchmail-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.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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 */ |