Commit fde28f60 authored by Eric S. Raymond's avatar Eric S. Raymond

Added `set daemon'.

svn path=/trunk/; revision=930
parent 87ad588d
......@@ -38,6 +38,15 @@ timeouts really broken? We must find a way to test this.)
Release Notes:
------------------------------------------------------------------------------
fetchmail-3.9 ()
features --
* It is now possible to set a default poll interval with `set daemon'.
There are 249 people on the fetchmail-friends list.
------------------------------------------------------------------------------
fetchmail-3.8 (Fri Mar 7 17:34:02 EST 1997)
......@@ -45,20 +54,22 @@ features --
* More FAQ material on using `localdomains'.
* compilation hacks for ISC 4.0 (thanks, Larry Jones!).
* Compilation hacks for ISC 4.0 (thanks, Larry Jones!).
bugs --
* enabled ETRN and RPOP command-line options.
* Enabled ETRN and RPOP command-line options.
* yet another attempt to fix the error.c compilation problems under
* Yet another attempt to fix the error.c compilation problems under
Solaris and NEXTSTEP.
* handle \( and \) correctly in RFC822 comments, thanks to Gareth McCaughan.
* Handle \( and \) correctly in RFC822 comments, thanks to Gareth McCaughan.
* Fixed off-by-one error fingered by Brian Jones that prevented
`localdomains' from working.
There are 248 people on the fetchmail-friends list.
------------------------------------------------------------------------------
fetchmail-3.7 (Fri Feb 21 17:38:40 EST 1997)
......
......@@ -59,6 +59,7 @@ int use_syslog; /* if --syslog was set */
int quitmode; /* if --quit was set */
int check_only; /* if --probe was set */
char *cmd_logfile; /* if --logfile was set */
int cmd_daemon; /* if --daemon was set */
/* miscellaneous global controls */
char *rcfile; /* path name of rc file */
......@@ -665,6 +666,10 @@ static int load_params(int argc, char **argv, int optind)
if (cmd_logfile)
logfile = cmd_logfile;
/* likewise for poll_interval */
if (cmd_daemon >= 0)
poll_interval = cmd_daemon;
return(implicitmode);
}
......@@ -767,6 +772,11 @@ void dump_params (struct query *ctl)
{
printf("Options for retrieving from %[email protected]%s:\n",
ctl->remotename, visbuf(ctl->server.names->id));
if (logfile)
printf(" Logfile is %s\n", logfile);
if (poll_interval)
printf(" Poll interval is %d seconds\n", poll_interval);
#ifdef HAVE_GETHOSTBYNAME
if (ctl->server.canonical_name)
printf(" Canonical DNS name of server is %s.\n", ctl->server.canonical_name);
......
......@@ -167,6 +167,7 @@ extern int use_syslog; /* if --syslog was set */
extern int quitmode; /* if --quit was set */
extern int check_only; /* if --check was set */
extern char *cmd_logfile; /* if --logfile was set */
extern int cmd_daemon; /* if --daemon was set */
/* these get computed */
extern int batchcount; /* count of messages sent in current batch */
......
......@@ -729,9 +729,12 @@ 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 is currently just one global option statement; `set logfile = '
There are currently two global option statements; `set logfile = '
followed by a string sets the same global specified by --logfile. A
command-line --logfile option will override this.
command-line --logfile option will override this. Also, `set daemon'
sets the poll interval as --daemon does. This can be overridden by
a command-line --daemon option; iin particular --daemon 0 can be used
to force foreground operation.
.PP
Basic format is:
......
......@@ -24,6 +24,7 @@
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#include "config.h"
#include "fetchmail.h"
typedef struct {
......@@ -121,7 +122,7 @@ void interface_parse(char *buf, struct hostdata *hp)
*cp2++ = '\000';
/* convert IP address and netmask */
hp->interface_pair = xmalloc(sizeof(struct interface_pair_s));
hp->interface_pair = (struct interface_pair_s *)xmalloc(sizeof(struct interface_pair_s));
if (!inet_aton(cp1, &hp->interface_pair->interface_address))
(void) error(PS_SYNTAX, 0, "invalid IP interface address");
if (!inet_aton(cp2, &hp->interface_pair->interface_mask))
......
......@@ -116,6 +116,8 @@ struct query *ctl; /* option record to be initialized */
int errflag = 0; /* TRUE when a syntax error is detected */
int option_index;
cmd_daemon = -1;
memset(ctl, '\0', sizeof(struct query)); /* start clean */
while (!errflag &&
......@@ -141,7 +143,7 @@ struct query *ctl; /* option record to be initialized */
break;
case 'd':
case LA_DAEMON:
poll_interval = atoi(optarg);
cmd_daemon = atoi(optarg);
break;
case 'N':
case LA_NODETACH:
......
......@@ -23,8 +23,7 @@ set { return SET; }
batchlimit { return BATCHLIMIT; }
fetchlimit { return FETCHLIMIT; }
logfile { return LOGFILE; }
interface { return INTERFACE; }
monitor { return MONITOR; }
daemon { return DAEMON; }
defaults { return DEFAULTS; }
server { return POLL; }
......@@ -45,6 +44,8 @@ remote(folder)? { return FOLDER; }
smtp(host)? { return SMTPHOST; }
mda { return MDA; }
pre(connect) { return PRECONNECT; }
interface { return INTERFACE; }
monitor { return MONITOR; }
is { return IS; }
here { return HERE; }
......
......@@ -44,7 +44,7 @@ static void user_reset();
%token AUTHENTICATE TIMEOUT KPOP KERBEROS
%token ENVELOPE USERNAME PASSWORD FOLDER SMTPHOST MDA PRECONNECT LIMIT
%token IS HERE THERE TO MAP WILDCARD
%token SET BATCHLIMIT FETCHLIMIT LOGFILE INTERFACE MONITOR
%token SET BATCHLIMIT FETCHLIMIT LOGFILE DAEMON INTERFACE MONITOR
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
......@@ -62,6 +62,7 @@ statement_list : statement
/* future global options should also have the form SET <name> <value> */
statement : SET LOGFILE MAP STRING {logfile = xstrdup($4);}
| SET DAEMON NUMBER {poll_interval = $3;}
/*
* The way the next two productions are written depends on the fact that
......
......@@ -72,6 +72,7 @@
# Legal global option statements are
#
# set logfile = -- must be followed by a string
# set daemon = -- must be followed by a number
#
# The noise keywords `and', `with', `has', `wants', and `options' are ignored
# anywhere in an entry; they can be used to make it resemble English. The
......@@ -82,6 +83,8 @@
#
# This is what the developer's .fetchmailrc looks like:
set daemon 300 # Poll at 5-minute intervals
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