]> Pileus Git - ~andy/fetchmail/commitdiff
More English-like keywords.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 8 Oct 1996 08:21:38 +0000 (08:21 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 8 Oct 1996 08:21:38 +0000 (08:21 -0000)
svn path=/trunk/; revision=249

NEWS
fetchmail.man
rcfile_l.l
rcfile_y.y

diff --git a/NEWS b/NEWS
index e0f702515f7b2485b90c022d548c74f18ce91292..4d011e5a1ba525429cd697684f1ca24517927f1f 100644 (file)
--- 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)
 
index 20836444ff07ebad180731018f604f3b06ba58f7..065f596df74f6a85f1e71bd99f4a51c5b222dd81 100644 (file)
@@ -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
index 07abe7b01f70e5a31828089248b05bddacc7fabf..7d055f8744a81d57bd280e4112d261b9d5be5c59 100644 (file)
@@ -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; }
index 32c5b244abf84ce79aa0762bce469fbcafe8cb42..6fa5d31dc7965479d9e5b019d5fe98d704f9815d 100644 (file)
@@ -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);}