]> Pileus Git - ~andy/fetchmail/commitdiff
The batchlimit option is now per user.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jan 1997 23:16:24 +0000 (23:16 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jan 1997 23:16:24 +0000 (23:16 -0000)
svn path=/trunk/; revision=764

NEWS
fetchmail.c
fetchmail.h
fetchmail.man
options.c
rcfile_y.y
sample.rcfile

diff --git a/NEWS b/NEWS
index 6e57b94ee10fa35c527b3c779ed71399406eec66..b4ad1302e6bb1b3e846816cfa3912e6f41ec4683 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,13 @@ features --
 
 * `interface' and `monitor' options are now per-server.
 
+* `batchlimit' option is now per-user.
+
+Note: These changes mean that older .fetchmailrc files using the `set'
+syntax for these options will cause fetchmail to die with a parse
+error at initialization time.  Conversion is trivial -- for details,
+see the FAQ.
+
 bugs --
 
 * Stricter parsing of greeting message for the host name; eliminates some
index d0865dcf77bab39c2e40d8b0b5e8e4d25b7c2a5c..728f7d61bda03cf26b615b4afa3536ed8da57aac 100644 (file)
@@ -58,8 +58,6 @@ char *logfile;                /* log file for daemon mode */
 int use_syslog;                /* if --syslog was set */
 int quitmode;          /* if --quit was set */
 int check_only;                /* if --probe was set */
-int cmd_batchlimit;    /* if --batchlimit was set */
-int cmd_fetchlimit;    /* if --fetchlimit was set */
 char *cmd_logfile;     /* if --logfile was set */
 
 /* miscellaneous global controls */
@@ -170,10 +168,6 @@ int main (int argc, char **argv)
            printf(" and %s\n", rcfile);
        if (outlevel == O_VERBOSE)
            printf("Lockfile at %s\n", tmpbuf);
-       if (batchlimit)
-           printf("SMTP message batch limit is %d.\n", batchlimit);
-       else if (outlevel == O_VERBOSE)
-           printf("No SMTP message batch limit.\n");
        for (ctl = querylist; ctl; ctl = ctl->next) {
            if (ctl->active && !(implicitmode && ctl->server.skip))
                dump_params(ctl);
@@ -650,10 +644,6 @@ static int load_params(int argc, char **argv, int optind)
     else
        initialize_saved_lists(querylist, idfile);
 
-    /* if cmd_batchlimit was explicitly set, use it to override batchlimit */
-   if (cmd_batchlimit > -1)
-       batchlimit = cmd_batchlimit;
-
     /* if cmd_logfile was explicitly set, use it to override logfile */
     if (cmd_logfile)
        logfile = cmd_logfile;
@@ -828,6 +818,10 @@ void dump_params (struct query *ctl)
               ctl->fetchlimit, ctl->fetchlimit);
     else if (outlevel == O_VERBOSE)
        printf("  No received-message limit (--fetchlimit 0).\n");
+    if (ctl->batchlimit)
+       printf("  SMTP message batch limit is %d.\n", ctl->batchlimit);
+    else if (outlevel == O_VERBOSE)
+       printf("  No SMTP message batch limit.\n");
     if (ctl->mda)
        printf("  Messages will be delivered with '%s.'\n", visbuf(ctl->mda));
     else
index b7f64fff26c6e650d0ce8818a3000cecfd6ff7d1..bd046783002490e6aa5c87d46cb91de1818d3f2e 100644 (file)
@@ -104,6 +104,7 @@ struct query
     int norewrite;
     int limit;
     int fetchlimit;
+    int batchlimit;
 
     /* unseen, previous state of mailbox (initially from .fetchids) */
     struct idlist *oldsaved, *newsaved;
@@ -155,11 +156,9 @@ extern char *logfile;              /* log file for daemon mode */
 extern int use_syslog;         /* if --syslog was set */
 extern int quitmode;           /* if --quit was set */
 extern int check_only;         /* if --check was set */
-extern int cmd_batchlimit;     /* if --batchlimit was set */
 extern char *cmd_logfile;      /* if --logfile was set */
 
 /* these get computed */
-extern int batchlimit;         /* if --batchlimit was set */
 extern int batchcount;         /* count of messages sent in current batch */
 extern int peek_capable;       /* can we read msgs without setting seen? */
 
index db92a7a06b1189e316075a064bb33c6a5d4f23b4..2c978de459b34665fa89ddbcff8a111544c51172 100644 (file)
@@ -652,11 +652,9 @@ or reverse it by saying `user esr here is eric there'
 .PP
 For backward compatibility, the word `server' is a synonym for `poll'.
 .PP
-There are currently two valid global option statements; \&`set
-batchlimit = ' followed by a number and sets the same global specified
-by the --batchlimit option, and `set logfile = ' followed by a string
-sets the same global specified by --logfile.  In both cases, a
-command-line option will override.
+There is currently just one global option statement; `set logfile = '
+followed by a string sets the same global specified by --logfile.  A
+command-line --logfile option will override this.
 .PP
 Basic format is:
 
index bbd42cf635d7e1f26dc41152077e0a2821f9810d..f3b76831d328ea00c58c6494836db2d8cd5797e3 100644 (file)
--- a/options.c
+++ b/options.c
@@ -119,7 +119,6 @@ struct query *ctl;  /* option record to be initialized */
     int option_index;
 
     memset(ctl, '\0', sizeof(struct query));    /* start clean */
-    cmd_batchlimit = -1;
 
     while (!errflag && 
           (c = getopt_long(argc,argv,shortoptions,
@@ -253,7 +252,7 @@ struct query *ctl;  /* option record to be initialized */
            break;
        case 'b':
        case LA_BATCHLIMIT:
-           cmd_batchlimit = atoi(optarg);
+           ctl->batchlimit = atoi(optarg);
            break;
        case 'B':
        case LA_FETCHLIMIT:
index 3fe804a8dd3ecb746eec93bd7488749235c6800b..bd6ec1e979c425c5c0003848ad89f6414773eeb2 100644 (file)
@@ -66,8 +66,7 @@ statement_list        : statement
                ;
 
 /* future global options should also have the form SET <name> <value> */
-statement      : SET BATCHLIMIT MAP NUMBER     {batchlimit = $4;}
-               | SET LOGFILE MAP STRING        {logfile = xstrdup($4);}
+statement      : SET LOGFILE MAP STRING        {logfile = xstrdup($4);}
 
 /* 
  * The way the next two productions are written depends on the fact that
@@ -194,6 +193,7 @@ user_option : TO localnames HERE
                | REWRITE               {current.norewrite = ($1==FLAG_TRUE);}
                | LIMIT NUMBER          {current.limit = $2;}
                | FETCHLIMIT NUMBER     {current.fetchlimit = $2;}
+               | BATCHLIMIT NUMBER     {current.batchlimit = $2;}
                ;
 %%
 
@@ -345,6 +345,7 @@ static void prc_register(void)
     FLAG_FORCE(norewrite);
     FLAG_FORCE(limit);
     FLAG_FORCE(fetchlimit);
+    FLAG_FORCE(batchlimit);
 #undef FLAG_FORCE
 
     (void) hostalloc(&current);
@@ -377,6 +378,7 @@ void optmerge(struct query *h2, struct query *h1)
     FLAG_MERGE(norewrite);
     FLAG_MERGE(limit);
     FLAG_MERGE(fetchlimit);
+    FLAG_MERGE(batchlimit);
 #undef FLAG_MERGE
 }
 
index c6da6f4b287bdc35ae59764b31c3d485613b5f48..f4fe5eb8c8b9a529d9887ddc22617c492f6f107b 100644 (file)
@@ -49,6 +49,7 @@
 #   norewrite
 #   limit                     -- must be followed by numeric size limit
 #   fetchlimit                -- must be followed by numeric msg fetch limit
+#   batchlimit                -- must be followed by numeric SMTP batch limit
 #
 # Legal protocol identifiers are
 #   pop2 (or POP2)
@@ -63,7 +64,6 @@
 #
 # Legal global option statements are
 #
-#   set batchlimit =           -- must be followed by a number
 #   set logfile =              -- must be followed by a string
 #
 # The noise keywords `and', `with', `has', `wants', and `options' are ignored
@@ -75,8 +75,6 @@
 # 
 # This is what the developer's .fetchmailrc looks like:
 
-set batchlimit = 0             # I forward to sendmail
-
 defaults
        interface "sl0/10.0.2.15"       # SLIRP standard address
        user esr is esr fetchmail-friends magic-numbers here