]> Pileus Git - ~andy/fetchmail/commitdiff
Fix ETRN mode.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 13 Oct 1997 16:00:11 +0000 (16:00 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 13 Oct 1997 16:00:11 +0000 (16:00 -0000)
svn path=/trunk/; revision=1507

NEWS
driver.c
fetchmail.c
options.c
rcfile_y.y

diff --git a/NEWS b/NEWS
index 8634f6919669743925cd7a9c27677c62d1720aaa..bbcd17143e8edb0baca084368793d5059c9b8ae6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,12 +16,13 @@ fetchmail-4.3.1 ()
 * Fixed a bad interaction between --limit and the repoll feature.
 * = is now optional in global options.
 * Code for parsing Received headers now strips out RFC822 routes.
-* Fixed processing of -S argument so giving a comma-separated list works. 
+* Fixed processing of -S/-r arguments so giving a comma-separated list works. 
+* Don't query for the fetchmail host machine by default in ETRN mode.
 * Added --invisible option.  Note: you can now either make fetchmail generate
   a Received header (the default) *or* spoof your listener into thinking
   fetchmail connected from the mailserver machine, *but not both*.
 
-There are 277 people on fetchmail-friends and 20 on fetchmail-announce.
+There are 272 people on fetchmail-friends and 36 on fetchmail-announce.
 
 ------------------------------------------------------------------------------
 fetchmail-4.3.0 (Mon Oct  6 16:44:38 EDT 1997)
index e1d52f2183ca8cf042ded79a128c89ea1a55f950..756ab2b1bc899af3cf93746b9633c52a293a0118 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -420,7 +420,11 @@ static int smtp_open(struct query *ctl)
 
        errno = 0;
 
-       /* run down the SMTP hunt list looking for a server that's up */
+       /*
+        * Run down the SMTP hunt list looking for a server that's up.
+        * Use both explicit hunt entries (value TRUE) and implicit 
+        * (default) ones (value FALSE).
+        */
        for (idp = ctl->smtphunt; idp; idp = idp->next)
        {
            ctl->smtphost = idp->id;  /* remember last host tried. */
index 4e346a77b6604f0043ce8b85548509b0a2c1de9d..f70d2d71ee00ed7e5630c5c7bea40592ca9b21e3 100644 (file)
@@ -565,7 +565,7 @@ static int load_params(int argc, char **argv, int optind)
     def_opts.server.protocol = P_AUTO;
     def_opts.server.timeout = CLIENT_TIMEOUT;
     def_opts.remotename = user;
-    save_str(&def_opts.smtphunt, TRUE, fetchmailhost);
+    save_str(&def_opts.smtphunt, FALSE, fetchmailhost);
     save_str(&def_opts.smtphunt, FALSE, "localhost");
     def_opts.expunge = 1;
 
@@ -991,7 +991,12 @@ void dump_params (struct query *ctl)
 
        printf("  Messages will be SMTP-forwarded to:");
        for (idp = ctl->smtphunt; idp; idp = idp->next)
-           printf(" %s", idp->id);
+           if (ctl->server.protocol != P_ETRN || idp->val.num)
+           {
+               printf(" %s", idp->id);
+               if (!idp->val.num)
+                   printf(" (default)");
+           }
        printf("\n");
     }
     if (ctl->preconnect)
index 11d4cdef52bc18fdb243aea4bfdb7c6823b06888..f2432ed3d140d55496dab02f7bc44c9af95f19ec 100644 (file)
--- a/options.c
+++ b/options.c
@@ -285,7 +285,7 @@ struct query *ctl;  /* option record to be initialized */
            strcpy(buf, optarg);
            cp = strtok(buf, ",");
            do {
-               save_str(&ctl->mailboxes, -1, optarg);
+               save_str(&ctl->mailboxes, -1, cp);
            } while
                ((cp = strtok((char *)NULL, ",")));
            break;
@@ -294,7 +294,7 @@ struct query *ctl;  /* option record to be initialized */
            strcpy(buf, optarg);
            cp = strtok(buf, ",");
            do {
-               save_str(&ctl->smtphunt, -1, cp);
+               save_str(&ctl->smtphunt, TRUE, cp);
            } while
                ((cp = strtok((char *)NULL, ",")));
            ocount++;
index 3184a24cf8c4edc7ce314a3582e087c79b273580..213caae5cb0d7ac1b1684e5d6758a8be47b58f17 100644 (file)
@@ -415,9 +415,9 @@ static void record_current(void)
     FLAG_FORCE(remotename);
     FLAG_FORCE(password);
     if (cmd_opts.mailboxes)
-       save_str(&current.mailboxes, -1, cmd_opts.mailboxes->id);
+       current.mailboxes = cmd_opts.mailboxes;
     if (cmd_opts.smtphunt)
-       save_str(&current.smtphunt, -1, cmd_opts.smtphunt->id);
+       current.smtphunt = cmd_opts.smtphunt;
     FLAG_FORCE(mda);
     FLAG_FORCE(preconnect);
     FLAG_FORCE(postconnect);