%{ /* * rcfile_y.y -- Run control file parser for fetchmail * * For license terms, see the file COPYING in this directory. */ #include #include #include #include #include #include #include #if defined(STDC_HEADERS) #include #endif #if defined(HAVE_UNISTD_H) #include #endif #include #include "fetchmail.h" struct query cmd_opts; /* where to put command-line info */ struct query *querylist; /* head of server list (globally visible) */ int yydebug; /* in case we didn't generate with -- debug */ static struct query current; /* current server record */ static int prc_errflag; static void prc_register(); static void prc_reset(); %} %union { int proto; int flag; int number; char *sval; } %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 PROTO %token STRING %token NUMBER %token KEEP FLUSH FETCHALL REWRITE PORT /* these are actually used by the lexer */ %token FLAG_TRUE 2 %token FLAG_FALSE 1 %% rcfile : /* empty */ | statement_list ; statement_list : statement | statement_list statement ; /* future global options should also have the form SET */ statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;} /* * The way the next two productions are written depends on the fact that * userspecs cannot be empty. It's a kluge to deal with files that sset * up a load of defaults and then have poll statements following with no * user options at all. */ | define_server serverspecs {prc_register(); prc_reset();} | define_server serverspecs userspecs ; define_server : POLL STRING {strcpy(current.servername, $2);} | SKIP STRING {strcpy(current.servername, $2); current.skip = TRUE;} | DEFAULTS {strcpy(current.servername,"defaults");} ; serverspecs : /* EMPTY */ | serverspecs serv_option ; alias_list : STRING {save_uid(¤t.aka, -1, $1);} | alias_list STRING {save_uid(¤t.aka, -1, $2);} ; serv_option : AKA alias_list | PROTOCOL PROTO {current.protocol = $2;} | PROTOCOL KPOP { current.protocol = P_POP3; current.authenticate = A_KERBEROS; current.port = KPOP_PORT; } | PORT NUMBER {current.port = $2;} | AUTHENTICATE PASSWORD {current.authenticate = A_PASSWORD;} | AUTHENTICATE KERBEROS {current.authenticate = A_KERBEROS;} | TIMEOUT NUMBER {current.timeout = $2;} ; /* * The first and only the first user spec may omit the USERNAME part. * This is a backward-compatibility kluge to allow old popclient files * to keep working. */ userspecs : user1opts {prc_register(); prc_reset();} | user1opts explicits {prc_register(); prc_reset();} | explicits ; explicits : explicitdef {prc_register(); prc_reset();} | explicits explicitdef {prc_register(); prc_reset();} ; explicitdef : userdef user0opts ; userdef : USERNAME STRING {strcpy(current.remotename, $2);} | USERNAME mapping_list HERE | USERNAME STRING THERE {strcpy(current.remotename, $2);} ; user0opts : /* EMPTY */ | user0opts user_option ; user1opts : user_option | user1opts user_option ; mapping_list : mapping | m
../fetchmail-FAQ.html
te); FLAG_MERGE(skip); FLAG_MERGE(port); FLAG_MERGE(authenticate); FLAG_MERGE(timeout); FLAG_MERGE(limit); #undef FLAG_MERGE } /* easier to do this than cope with variations in where the library lives */ int yywrap(void) {return 1;} /* rcfile_y.y ends here */