2 /* Copyright 1993-95 by Carl Harris, Jr. Copyright 1996 by Eric S. Raymond
4 * For license terms, see the file COPYING in this directory.
7 /***********************************************************************
10 programmer: Carl Harris, ceharris@mal.com
11 Extensively hacked and fixed by esr.
12 description: configuration file parser
14 ***********************************************************************/
19 extern int prc_lineno;
20 extern int prc_errflag;
23 int yydebug; /* in case we didn't generate with -- debug */
32 %token KW_SERVER KW_PROTOCOL KW_USERNAME KW_PASSWORD KW_RPOPID
33 %token KW_REMOTEFOLDER KW_LOCALFOLDER KW_SMTPHOST KW_MDA KW_EOL KW_DEFAULTS
34 %token <proto> PROTO_AUTO PROTO_POP2 PROTO_POP3 PROTO_IMAP PROTO_APOP PROTO_RPOP
35 %token <sval> PARAM_STRING
36 %token <flag> KW_KEEP KW_FLUSH KW_FETCHALL KW_REWRITE KW_PORT
39 /* these are actually used by the lexer */
49 rcline: statement KW_EOL
53 | define_server {prc_register(); prc_reset();}
56 define_server: KW_SERVER PARAM_STRING server_options {prc_setserver($2);}
57 | KW_SERVER PARAM_STRING {prc_setserver($2);}
58 | KW_DEFAULTS server_options {prc_setserver("defaults");}
61 server_options: serv_option_clause
62 | server_options serv_option_clause
66 KW_PROTOCOL proto {prc_setproto($2);}
67 | KW_USERNAME PARAM_STRING {prc_remotename($2);}
68 | KW_PASSWORD PARAM_STRING {prc_setpassword($2);}
69 | KW_RPOPID PARAM_STRING {prc_setrpopid($2);}
70 | KW_REMOTEFOLDER PARAM_STRING {prc_setremote($2);}
71 | KW_LOCALFOLDER PARAM_STRING {prc_setlocal($2);}
72 | KW_SMTPHOST PARAM_STRING {prc_setsmtphost($2);}
73 | KW_MDA PARAM_STRING {prc_setmda($2);}
74 | KW_KEEP {prc_setkeep($1);}
75 | KW_FLUSH {prc_setflush($1);}
76 | KW_FETCHALL {prc_setfetchall($1);}
77 | KW_REWRITE {prc_setrewrite($1);}
78 | KW_PORT PARAM_STRING {prc_setport($2);}
94 fprintf(stderr,"%s line %d: %s at %s\n", rcfile, prc_lineno, s, yytext);