]> Pileus Git - ~andy/fetchmail/commitdiff
Fixes for UIDL and Kerberos problems.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 13 Oct 1996 03:19:51 +0000 (03:19 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 13 Oct 1996 03:19:51 +0000 (03:19 -0000)
svn path=/trunk/; revision=319

Makefile.in
NEWS
README
driver.c
fetchmail.h
pop3.c
rcfile_y.y
sample.rcfile
uid.c

index b3e85b31ef4d34c9be5c98a476de44d649f4c6bd..a180b817367e339a28df73070805b62eabcebac2 100644 (file)
@@ -158,7 +158,7 @@ $(mandir)/$(instname).$(manext): fetchmail.man
        $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
 
 fetchmail.spec: Makefile.in
-       specgen.sh $(VERS) >fetchmail.spec
+       $(srcdir)/specgen.sh $(VERS) >fetchmail.spec
 
 .PHONY: clean realclean distclean mostlyclean
 clean: 
diff --git a/NEWS b/NEWS
index fb9866b0666d4a7c2d4ab6c523403335607a8b35..537dfe4aee50459619bb4083d3af9183ee175652 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,17 +1,3 @@
------------------------------------------------------------------------------
-                        * * * WARNING * * *
-
-This release contains untested features!  It includes new code for Kerberos
-authentication and POP3 UID support, but my integration of these features
-required changes which have not yet been tested by the people who sent the
-enhancements.
-
-I'm issuing it to put paid to two minor but annoying bugs, in option
-processing and IMAP queries of multiple sites.  For other changes, see
-below.
-
------------------------------------------------------------------------------
-
                        Release Notes:
 
 fetchmail-1.8 (Fri Oct 11 15:08:10 EDT 1996):
diff --git a/README b/README
index e75593a573c76feaebc9c9d728fe67c5096d30fb..35ee9746d83e5920bfde0fea25a6f8df7c122b1b 100644 (file)
--- a/README
+++ b/README
@@ -1,19 +1,5 @@
                         fetchmail README
 
------------------------------------------------------------------------------
-                        * * * WARNING * * *
-
-This release contains untested features!  It includes new code for Kerberos
-authentication and POP3 UID support, but my integration of these features
-required changes which have not yet been tested by the people who sent the
-enhancements.
-
-I'm issuing it to put paid to two minor but annoying bugs, in option
-processing and IMAP queries of multiple sites.  For other changes, see
-the release notes in the NEWS file.
-
------------------------------------------------------------------------------
-
 fetchmail is a full-featured, robust, well-documented POP2, POP3,
 APOP, and IMAP batch mail retrieval/forwarding utility intended to be
 used over on-demand TCP/IP links (such as SLIP or PPP connections).
@@ -79,7 +65,7 @@ with **.
           You could use fetchmail to test and debug server implementatations.
 
        *  Carefully written, comprehensive and up-to-date man page describing
-          not only modes of operation but also (**) how to interpret the most
+          not only modes of operation but also (**) how to diagnose the most
           common kinds of problems and what to do about deficient servers
 
        *  Rugged, simple, and well-tested code -- the author relies on it
@@ -90,7 +76,11 @@ with **.
           user base from Carl Harris's popclient community.   This means
           feedback is rapid, bugs get found and fixed rapidly.
 
-You can easily find the latest version of fetchmail from Eric's home page:
+You can easily fetch the latest version of fetchmail  via FTP from:
+
+       ftp://ftp.ccil.org/pub/esr/fetchmail-1.9.tar.gz
+
+Or you can get it from Eric's home page:
 
        http://www.ccil.org/~esr
 
index 5987ed4ed25121495a98258330dda908df59986d..9fb1e69f4d988d79a264f104cdccde7db41f99f9 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -628,7 +628,7 @@ struct method *proto;
     }
 
 #ifdef KERBEROS_V4
-    if (queryctl->authentication == A_KERBEROS)
+    if (queryctl->authenticate == A_KERBEROS)
     {
        ok = (kerberos_auth (socket, queryctl->servername));
        if (ok != 0)
index 82471678483ea473a4b1834f6eca79d33ed46d04..24d8d0abcf63797160bd71217d6a47914a8dd383 100644 (file)
@@ -149,6 +149,7 @@ void save_uid(struct idlist **, int, char *);
 void free_uid_list(struct idlist **);
 int delete_uid(struct idlist **, int);
 int uid_in_list(struct idlist **, char *);
+char *uid_find(struct idlist **, int);
 void update_uid_lists(struct hostrec *);
 void write_saved_lists(struct hostrec *, char *);
 
diff --git a/pop3.c b/pop3.c
index 5c5eed11c0a180415a5814bc75539eebaf79e35c..92089e0ed45ea7d8e0cfe0219b465db0531173ff 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -129,6 +129,9 @@ int *countp;
     int ok;
     char buf [POPBUFSIZE+1];
 
+    /* Ensure that the new list is properly empty */
+    queryctl->newsaved = (struct idlist *)NULL;
+
     /* get the total message count */
     gen_send(socket, "STAT");
     ok = pop3_ok(socket, buf);
@@ -158,14 +161,14 @@ int *countp;
 
            /* grab the mailbox's UID list */
            gen_send(socket, "UIDL");
-           if ((ok = pop3_ok(buf, socket)) == 0) {
+           if ((ok = pop3_ok(socket, buf)) == 0) {
                while (SockGets(socket, buf, sizeof(buf)) >= 0) {
                    if (outlevel == O_VERBOSE)
                        fprintf(stderr,"%s\n",buf);
-                   if (strcmp(buf, ".\n") == 0) {
+                   if (strcmp(buf, ".") == 0) {
                        break;
                    }
-                   if (sscanf(buf, "%d %s\n", &num, id) == 2)
+                   if (sscanf(buf, "%d %s", &num, id) == 2)
                        save_uid(&queryctl->newsaved, num, id);
                }
            }
@@ -183,23 +186,8 @@ int num;
     if (!queryctl->oldsaved)
        return (num <= last);
     else
-    {
-       char buf [POPBUFSIZE+1];
-       int ok;
-
-       gen_send(socket, "UIDL %d", num);
-       if ((ok = pop3_ok(socket, buf)) != 0)
-           return(ok);
-       else
-       {
-           char        id[IDLEN+1];
-
-           if (sscanf(buf, "%*d %s", id) == 2)
-               return(uid_in_list(&queryctl->oldsaved, id));
-           else
-               return(0);
-       }
-    }
+        return (uid_in_list(&queryctl->oldsaved,
+                           uid_find (&queryctl->newsaved, num)));
 }
 
 static int pop3_fetch(socket, number, lenp)
index 90a9f4741140900a129b5d6606598c09eaf2fac6..b365088092e2e66a03e24057bdf22f505c09795d 100644 (file)
@@ -68,7 +68,7 @@ serv_option   : PROTOCOL PROTO        {prc_setproto($2);}
                                                prc_setauth(A_KERBEROS);
                                                prc_setport(KPOP_PORT);
                                        }
-               | PORT STRING           {prc_setport($2);}
+               | PORT STRING           {prc_setport(atoi($2));}
                | SKIP                  {prc_setskip($1==FLAG_TRUE);}
                | AUTHENTICATE PASSWORD {prc_setauth(A_PASSWORD);}
                | AUTHENTICATE KERBEROS {prc_setauth(A_KERBEROS);}
index e2f5663afb194afc33a646d4da5dd28206bc517a..42ad1362b1c570e863912f84d6b27542bf6e2edd 100644 (file)
@@ -28,7 +28,6 @@
 #   is
 #   remotefolder (or remote)
 #   password (or pass)
-#   mailbox
 #   smtphost (or smtp)
 #   mda
 #   keep
diff --git a/uid.c b/uid.c
index eb87d4dc1eb644d621d2700b4f822047ba738f02..186d4b352b578cc748a2a06977fa17725476766f 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -140,7 +140,7 @@ int uid_in_list(idl, str)
 struct idlist **idl;
 char *str;
 {
-    if (*idl == (struct idlist *)NULL)
+    if (*idl == (struct idlist *)NULL || str == (char *) NULL)
        return(0);
     else if (strcmp(str, (*idl)->id) == 0)
        return(1);
@@ -148,6 +148,19 @@ char *str;
        return(uid_in_list(&(*idl)->next, str));
 }
 
+char *uid_find(idl, number)
+/* return the id of the given number in the given list. */
+struct idlist **idl;
+int number;
+{
+    if (*idl == (struct idlist *) 0)
+       return((char *) 0);
+    else if (number == (*idl)->num)
+       return((*idl)->id);
+    else
+       return(uid_find(&(*idl)->next, number));
+}
+
 int delete_uid(idl, num)
 /* delete given message from given list */
 struct idlist **idl;
@@ -175,6 +188,7 @@ struct hostrec *hostp;
 {
     free_uid_list(&hostp->oldsaved);
     hostp->oldsaved = hostp->newsaved;
+    hostp->newsaved = (struct idlist *) NULL;
 }
 
 void write_saved_lists(hostlist, idfile)