aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--fetchmail.c5
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man7
-rw-r--r--options.c2
-rw-r--r--rcfile_l.l1
-rw-r--r--rcfile_y.y3
-rw-r--r--sample.rcfile1
8 files changed, 16 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 06134319..045cabc0 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ pl 2.0.1 ():
aka list so no potential alias has to be DNS-checked more than once.
* Try to use envelope From. If that fails, fall back on calling-user.
* Added FAQ file
+* Added `logfile' keyword to rc syntax.
fetchmail-2.0 (Mon Nov 18 00:32:17 EST 1996):
diff --git a/fetchmail.c b/fetchmail.c
index c5883ffc..0a464906 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -49,6 +49,7 @@ char *logfile; /* log file for daemon mode */
int quitmode; /* if --quit was set */
int check_only; /* if --probe was set */
int cmd_batchlimit; /* if --batchlimit was set */
+char *cmd_logfile; /* if --logfile was set */
/* miscellaneous global controls */
char *rcfile; /* path name of rc file */
@@ -594,6 +595,10 @@ static int load_params(int argc, char **argv, int optind)
if (cmd_batchlimit > -1)
batchlimit = cmd_batchlimit;
+ /* if cmd_logfile was explicitly set, use it to override logfile */
+ if (cmd_logfile)
+ logfile = cmd_logfile;
+
return(implicitmode);
}
diff --git a/fetchmail.h b/fetchmail.h
index 3765f6f3..451b3234 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -142,6 +142,7 @@ extern char *logfile; /* log file for daemon mode */
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 */
diff --git a/fetchmail.man b/fetchmail.man
index afe2240e..ba259fca 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -519,10 +519,11 @@ or reverse it by saying `user esr here is eric there'
.PP
For backward compatibility, the word `server' is a syninym for `poll'.
.PP
-There is currently only one valid global option statement; it is
+There are currently two valid global option statements;
\&`set batchlimit = ' followed by a number and sets the same global
-specified by the --batchlimit option. (The command line option
-can override this.)
+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.
.PP
Basic format is:
diff --git a/options.c b/options.c
index 4f1cd937..88af3799 100644
--- a/options.c
+++ b/options.c
@@ -141,7 +141,7 @@ struct query *ctl; /* option record to be initialized */
break;
case 'L':
case LA_LOGFILE:
- logfile = optarg;
+ cmd_logfile = optarg;
break;
case 'f':
case LA_RCFILE:
diff --git a/rcfile_l.l b/rcfile_l.l
index 250b20c9..0f6d43d4 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -21,6 +21,7 @@ int prc_lineno = 1;
set { return SET; }
batchlimit { return BATCHLIMIT; }
+logfile { return LOGFILE; }
defaults { return DEFAULTS; }
server { return POLL; }
poll { return POLL; }
diff --git a/rcfile_y.y b/rcfile_y.y
index d22efa44..010568b2 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -43,7 +43,7 @@ static void prc_reset();
%token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE TO MAP LIMIT
-%token SET BATCHLIMIT
+%token SET BATCHLIMIT LOGFILE
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
@@ -65,6 +65,7 @@ statement_list : statement
/* future global options should also have the form SET <name> <value> */
statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;}
+ | SET LOGFILE STRING {logfile = xstrdup($3);}
/*
* The way the next two productions are written depends on the fact that
diff --git a/sample.rcfile b/sample.rcfile
index 4f41c9de..453ea54d 100644
--- a/sample.rcfile
+++ b/sample.rcfile
@@ -56,6 +56,7 @@
# 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
# anywhere in an entry; they can be used to make it resemble English. The