aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-14 23:16:24 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-14 23:16:24 +0000
commit06f83ea8b4a9d711aa0e308223c6be2e6ca0b08e (patch)
tree40481fb9f0d52ff5b65e815a840b1ccfb3c2f715
parent70dcc659b0d246e0fd2879d06400c287b8638f42 (diff)
downloadfetchmail-06f83ea8b4a9d711aa0e308223c6be2e6ca0b08e.tar.gz
fetchmail-06f83ea8b4a9d711aa0e308223c6be2e6ca0b08e.tar.bz2
fetchmail-06f83ea8b4a9d711aa0e308223c6be2e6ca0b08e.zip
The batchlimit option is now per user.
svn path=/trunk/; revision=764
-rw-r--r--NEWS7
-rw-r--r--fetchmail.c14
-rw-r--r--fetchmail.h3
-rw-r--r--fetchmail.man8
-rw-r--r--options.c3
-rw-r--r--rcfile_y.y6
-rw-r--r--sample.rcfile4
7 files changed, 21 insertions, 24 deletions
diff --git a/NEWS b/NEWS
index 6e57b94e..b4ad1302 100644
--- 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
diff --git a/fetchmail.c b/fetchmail.c
index d0865dcf..728f7d61 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -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
diff --git a/fetchmail.h b/fetchmail.h
index b7f64fff..bd046783 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -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? */
diff --git a/fetchmail.man b/fetchmail.man
index db92a7a0..2c978de4 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -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:
diff --git a/options.c b/options.c
index bbd42cf6..f3b76831 100644
--- 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:
diff --git a/rcfile_y.y b/rcfile_y.y
index 3fe804a8..bd6ec1e9 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -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
}
diff --git a/sample.rcfile b/sample.rcfile
index c6da6f4b..f4fe5eb8 100644
--- a/sample.rcfile
+++ b/sample.rcfile
@@ -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