]> Pileus Git - ~andy/fetchmail/commitdiff
Second version of SDPS.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 17 Aug 1998 23:09:28 +0000 (23:09 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 17 Aug 1998 23:09:28 +0000 (23:09 -0000)
svn path=/trunk/; revision=2041

NEWS
fetchmail.h
options.c
pop3.c
rcfile_l.l
rcfile_y.y

diff --git a/NEWS b/NEWS
index 49113bd5dfd99ef840b9d82c2ca925c28c09cd7d..5419563275c384a165682e3c94803a3cdbfab966 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
                                Release Notes:
 
+fetchmail-4.5.6 ():
+* SDPS support, experimental version 2.  Requires configure --enable-SDPS.
+
 fetchmail-4.5.5 (Mon Aug  3 16:08:14 EDT 1998):
 * Brendan Cully's FAQ entry on GSSAPI.
 * Andrew Cagney's improvement to Received-line parsing.
index 7b1e7300fd9eb2bf7bc9377f4fae677cfb67a504..aa1c1215f110bf39b86e8c5cf99e065806265751 100644 (file)
@@ -142,7 +142,10 @@ struct hostdata            /* shared among all user connections to given server */
     flag skip;                         /* suppress poll in implicit mode? */
     flag dns;                          /* do DNS lookup on multidrop? */
     flag uidl;                         /* use RFC1725 UIDLs? */
-    flag checkalias;                  /* try to resolve aliases by comparing IPs ?*/
+#ifdef SDPS_ENABLE
+    flag sdps;                         /* use Demon Internet SDPS *ENV */
+#endif /* SDPS_ENABLE */
+    flag checkalias;                   /* resolve aliases by comparing IPs? */
 
 
 #ifdef linux
index 8b77ddb7f0e34edf64c034ca23f88e1461e87e71..6ae2f61eccaaeca6ddc9567c97d15b9a2167bdcf 100644 (file)
--- a/options.c
+++ b/options.c
@@ -285,6 +285,13 @@ struct query *ctl; /* option record to be initialized */
            /* XXX -- should probably use a table lookup here */
            if (strcasecmp(optarg,"pop2") == 0)
                ctl->server.protocol = P_POP2;
+#ifdef SDPS_ENABLE
+           else if (strcasecmp(optarg,"sdps") == 0)
+           {
+               ctl->server.protocol = P_POP3; 
+                ctl->server.sdps = TRUE;
+           }
+#endif /* SDPS_ENABLE */
            else if (strcasecmp(optarg,"pop3") == 0)
                ctl->server.protocol = P_POP3;
            else if (strcasecmp(optarg,"apop") == 0)
diff --git a/pop3.c b/pop3.c
index 2514c1e8ba43de4ceeae6bc69d7d948981705faf..6b595fe66bf7259cf4c3a129060ae9c62da0e21a 100644 (file)
--- 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 */
 
index 90fc2230d701fe29b08f6188c32f16ee53a04ddf..f10190f3952490aed3c28078a284cd1c70d4e0ae 100644 (file)
@@ -97,6 +97,7 @@ options               {/* EMPTY */}
 
 (auto)|(AUTO)  { yylval.proto = P_AUTO;  return PROTO; }
 (pop2)|(POP2)  { yylval.proto = P_POP2;  return PROTO; }
+(sdps)|(SDPS)   { return SDPS; }
 (pop3)|(POP3)  { yylval.proto = P_POP3;  return PROTO; }
 (imap-k4)|(IMAP-K4)   { yylval.proto = P_IMAP_K4;  return PROTO; }
 (imap-gss)|(IMAP-GSS) { yylval.proto = P_IMAP_GSS;  return PROTO; }
index d03820b3bd8474a4175d07a8e3d29f65053387e1..aa4e715fbcc9a2c78e2ecbccc76df5a3e3aedad5 100644 (file)
@@ -58,7 +58,7 @@ extern char * yytext;
 }
 
 %token DEFAULTS POLL SKIP VIA AKA LOCALDOMAINS PROTOCOL
-%token AUTHENTICATE TIMEOUT KPOP KERBEROS4 KERBEROS5 KERBEROS
+%token AUTHENTICATE TIMEOUT KPOP SDPS KERBEROS4 KERBEROS5 KERBEROS
 %token ENVELOPE QVIRTUAL USERNAME PASSWORD FOLDER SMTPHOST MDA SMTPADDRESS
 %token SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT
 %token NETSEC INTERFACE MONITOR
@@ -139,6 +139,10 @@ serv_option        : AKA alias_list
                                            current.server.port = KPOP_PORT;
 #endif /* INET6 */
                                        }
+               | SDPS                  {
+                                           current.server.protocol = P_POP3;
+                                           current.server.sdps = TRUE;
+                                       }
                | UIDL                  {current.server.uidl = FLAG_TRUE;}
                | NO UIDL               {current.server.uidl  = FLAG_FALSE;}
                | CHECKALIAS            {current.server.checkalias = FLAG_TRUE;}