Commit 06f83ea8 authored by Eric S. Raymond's avatar Eric S. Raymond

The batchlimit option is now per user.

svn path=/trunk/; revision=764
parent 70dcc659
......@@ -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
......
......@@ -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
......
......@@ -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? */
......
......@@ -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:
......
......@@ -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:
......
......@@ -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
}
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment