aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--fetchmail.man36
-rw-r--r--rcfile_l.l3
-rw-r--r--rcfile_y.y15
4 files changed, 51 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index e0f70251..4d011e5a 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ authentication stuff does what's needed.
Support IMAP4 extensions for secure challenge-response, once they're actually
standardized.
+The configuration file lexer handles punctuation adjacent to keywords poorly.
+Flex can be very mysterious at times.
+
Inflict severe pain on the person(s) responsible for removing LAST from POP3.
Release Notes:
@@ -20,6 +23,8 @@ fetchmail-1.7 (Tue Oct 8 01:00:08 EDT 1996):
features --
+* Noise words for rcfile syntax make English-like syntax possible.
+
* Make configure more GNUish; it understands --prefix and other standard
autoconf options now (see INSTALL for details)
diff --git a/fetchmail.man b/fetchmail.man
index 20836444..065f596d 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -397,6 +397,18 @@ Legal protocol identifiers are
apop (or APOP)
rpop (or RPOP)
.PP
+You can also use the `noise' keywords \fBand\fR, \fBwith\fR,
+\fBhas\fR, \fBwants\fR, and \fBoptions\fR anywhere in an entry to make
+it resemble English. They're ignored, but but can make entries much
+easier to read at a glance. The punctuation characters ':', ';' and
+',' are also ignored.
+.PP
+The words \fBhere\fR and \fBthere\fR also have useful English-like
+significance. Normally `\fBuser eric is esr\fR' would mean that
+mail for the remote user \fBeric\fR is to be delivered to \fBesr\fR,
+but you can make this clearer by saying `\fBuser eric there is esr here\fR',
+or reverse it by saying `\fBuser esr here is eric there\fR'
+.PP
Basic format is:
.nf
@@ -422,13 +434,26 @@ Multiple servers may be listed:
server other.provider.net proto pop2 user John.Smith pass My^Hat
.fi
+Here's a version of those two with more whitespace and some noise words:
+
+.nf
+ server pop.provider.net proto pop3
+ user jsmith, with password secret1, is jsmith here;
+ server other.provider.net proto pop2:
+ user John.Smith with password My^Hat, is John.Smith here;
+.fi
+
+This version is much easier to read and doesn't cost significantly
+more (parsing is done only once, at startup time).
+
.PP
If you need to include whitespace in a parameter string, enclose the
string in double quotes. Thus:
.nf
server mail.provider.net proto pop3
- user jsmith pass "u can't krak this" mda "/bin/mail %s"
+ user jsmith has password "u can't krak this"
+ and wants mda "/bin/mail %s"
.fi
You may have an initial server description headed by the keyword
@@ -442,7 +467,7 @@ by individual server descriptions. So, you could write:
server pop.provider.net
pass secret1
server mail.provider.net
- user jjsmith pass secret2
+ user jjsmith has password secret2
.fi
It's possible to specify more than one user per server (this is only
@@ -455,8 +480,8 @@ invoking user is used .) Here's a contrived example:
.nf
server pop.provider.net proto pop3 port 3111
pass gumshoe
- user jsmith pass secret1 is smith
- user jones pass secret2 is jjones
+ user jsmith with pass secret1 is smith here
+ user jones with pass secret2 is jjones here
.fi
This says that the user invoking \fIfetchmail\fR has the same username
@@ -552,6 +577,9 @@ software.
.PP
The RPOP support is not yet well tested.
.PP
+The configuration file lexer handles punctuation adjacent to keywords poorly.
+Flex can be very mysterious at times.
+.PP
Send comments, bug reports, gripes, and the like to Eric S. Raymond
<esr@thyrsus.com>.
.SH NOTES
diff --git a/rcfile_l.l b/rcfile_l.l
index 07abe7b0..7d055f87 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -35,6 +35,7 @@ smtp(host)? { return SMTPHOST; }
mda { return MDA; }
is { return IS; }
here { return HERE; }
+there { return THERE; }
keep { yylval.flag = FLAG_TRUE; return KEEP; }
flush { yylval.flag = FLAG_TRUE; return FLUSH; }
@@ -49,7 +50,9 @@ noskip { yylval.flag = FLAG_FALSE; return SKIP; }
with {/* EMPTY */}
and {/* EMPTY */}
+has {/* EMPTY */}
options {/* EMPTY */}
+[;:,] {/* EMPTY */}
(auto)|(AUTO) { yylval.proto = P_AUTO; return PROTO; }
(pop2)|(POP2) { yylval.proto = P_POP2; return PROTO; }
diff --git a/rcfile_y.y b/rcfile_y.y
index 32c5b244..6fa5d31d 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -29,7 +29,8 @@ int yydebug; /* in case we didn't generate with -- debug */
char *sval;
}
-%token SERVER PROTOCOL USERNAME PASSWORD FOLDER SMTPHOST MDA DEFAULTS IS HERE
+%token DEFAULTS SERVER PROTOCOL
+%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE
%token <proto> PROTO
%token <sval> STRING
%token <flag> KEEP FLUSH FETCHALL REWRITE PORT SKIP
@@ -69,11 +70,16 @@ userspecs : user1opts {prc_register(); prc_reset();}
| explicits
;
-explicits : userdef {prc_register(); prc_reset();}
- | explicits userdef {prc_register(); prc_reset();}
+explicits : explicitdef {prc_register(); prc_reset();}
+ | explicits explicitdef {prc_register(); prc_reset();}
;
-userdef : USERNAME STRING user0opts {prc_setremote($2);}
+explicitdef : userdef user0opts
+ ;
+
+userdef : USERNAME STRING {prc_setremote($2);}
+ | USERNAME STRING HERE {prc_setlocal($2);}
+ | USERNAME STRING THERE {prc_setremote($2);}
;
user0opts : /* EMPTY */
@@ -86,6 +92,7 @@ user1opts : user_option
user_option : IS STRING {prc_setlocal($2);}
| IS STRING HERE {prc_setlocal($2);}
+ | IS STRING THERE {prc_setremote($2);}
| PASSWORD STRING {prc_setpassword($2);}
| FOLDER STRING {prc_setfolder($2);}
| SMTPHOST STRING {prc_setsmtphost($2);}