#include #ifndef lint #if 0 static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #else __IDSTRING(yyrcsid, "$NetBSD: skeleton.c,v 1.14 1997/10/20 03:41:16 lukem Exp $"); #endif #endif #include #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYLEX yylex() #define YYEMPTY -1 #define yyclearin (yychar=(YYEMPTY)) #define yyerrok (yyerrflag=0) #define YYRECOVERING (yyerrflag!=0) #define YYPREFIX "yy" #line 22 "parse.y" #include #include #include #include #include #include #include #include "fdm.h" #include "deliver.h" #include "fetch.h" #include "match.h" struct strb *parse_tags; struct macros parse_macros; struct macro *parse_last; /* last command-line argument macro */ u_int parse_ruleidx; u_int parse_actionidx; ARRAY_DECL(, struct rule *) parse_rulestack; struct rule *parse_rule; struct files parse_filestack; struct file *parse_file; int yyparse(void); int parse_conf(const char *path, struct strings *macros) { struct macro *macro; FILE *f; u_int i; if ((f = fopen(path, "r")) == NULL) return (-1); ARRAY_INIT(&parse_rulestack); parse_rule = NULL; ARRAY_INIT(&parse_filestack); parse_file = xmalloc(sizeof *parse_file); parse_file->f = f; parse_file->line = 0; parse_file->path = path; strb_create(&parse_tags); default_tags(&parse_tags, NULL); TAILQ_INIT(&parse_macros); parse_last = NULL; for (i = 0; i < ARRAY_LENGTH(macros); i++) { parse_last = extract_macro(ARRAY_ITEM(macros, i)); TAILQ_INSERT_TAIL(&parse_macros, parse_last, entry); } parse_file->line++; yyparse(); if (!ARRAY_EMPTY(&parse_rulestack)) yyerror("missing }"); ARRAY_FREE(&parse_rulestack); ARRAY_FREE(&parse_filestack); xfree(parse_file); while (!TAILQ_EMPTY(&parse_macros)) { macro = TAILQ_FIRST(&parse_macros); TAILQ_REMOVE(&parse_macros, macro, entry); if (macro->type == MACRO_STRING) xfree(macro->value.str); xfree(macro); } strb_destroy(&parse_tags); fclose(f); return (0); } __dead printflike1 void yyerror(const char *fmt, ...) { va_list ap; char *s; xasprintf(&s, "%s: %s at line %d", parse_file->path, fmt, parse_file->line); va_start(ap, fmt); log_vwrite(NULL, LOG_CRIT, s, ap); va_end(ap); exit(1); } printflike1 void yywarn(const char *fmt, ...) { va_list ap; char *s; xasprintf(&s, "%s: %s at line %d", parse_file->path, fmt, parse_file->rule_line); va_start(ap, fmt); log_vwrite(NULL, LOG_CRIT, s, ap); va_end(ap); xfree(s); } #line 157 "parse.y" typedef union { long long number; char *string; int flag; u_int locks; struct { struct fetch *fetch; void *data; } fetch; struct { char *host; char *port; } server; enum area area; enum exprop exprop; struct actitem *actitem; struct actlist *actlist; struct expr *expr; struct expritem *expritem; struct strings *strings; struct replstrs *replstrs; enum fetch_only only; struct { char *path; enum fetch_only only; } poponly; struct { int flags; char *str; } re; uid_t uid; gid_t gid; struct { struct users *users; int find_uid; } users; enum cmp cmp; struct rule *rule; struct { char *user; int user_netrc; char *pass; int pass_netrc; } userpass; } YYSTYPE; #line 183 "y.tab.c" #define TOKALL 257 #define TOKACCOUNT 258 #define TOKSERVER 259 #define TOKPORT 260 #define TOKUSER 261 #define TOKPASS 262 #define TOKACTION 263 #define TOKSET 264 #define TOKACCOUNTS 265 #define TOKMATCH 266 #define TOKIN 267 #define TOKCONTINUE 268 #define TOKSTDIN 269 #define TOKPOP3 270 #define TOKPOP3S 271 #define TOKNONE 272 #define TOKCASE 273 #define TOKAND 274 #define TOKOR 275 #define TOKTO 276 #define TOKACTIONS 277 #define TOKHEADERS 278 #define TOKBODY 279 #define TOKMAXSIZE 280 #define TOKDELTOOBIG 281 #define TOKLOCKTYPES 282 #define TOKDEFUSER 283 #define TOKDOMAIN 284 #define TOKDOMAINS 285 #define TOKHEADER 286 #define TOKFROMHEADERS 287 #define TOKUSERS 288 #define TOKMATCHED 289 #define TOKUNMATCHED 290 #define TOKNOT 291 #define TOKIMAP 292 #define TOKIMAPS 293 #define TOKDISABLED 294 #define TOKFOLDER 295 #define TOKPROXY 296 #define TOKALLOWMANY 297 #define TOKDROP 298 #define TOKLOCKFILE 299 #define TOKRETURNS 300 #define TOKPIPE 301 #define TOKSMTP 302 #define TOKMAILDIR 303 #define TOKMBOX 304 #define TOKMBOXES 305 #define TOKWRITE 306 #define TOKAPPEND 307 #define TOKREWRITE 308 #define TOKTAG 309 #define TOKTAGGED 310 #define TOKSIZE 311 #define TOKMAILDIRS 312 #define TOKEXEC 313 #define TOKSTRING 314 #define TOKKEEP 315 #define TOKIMPLACT 316 #define TOKHOURS 317 #define TOKMINUTES 318 #define TOKSECONDS 319 #define TOKDAYS 320 #define TOKWEEKS 321 #define TOKMONTHS 322 #define TOKYEARS 323 #define TOKAGE 324 #define TOKINVALID 325 #define TOKKILOBYTES 326 #define TOKMEGABYTES 327 #define TOKGIGABYTES 328 #define TOKBYTES 329 #define TOKATTACHMENT 330 #define TOKCOUNT 331 #define TOKTOTALSIZE 332 #define TOKANYTYPE 333 #define TOKANYNAME 334 #define TOKANYSIZE 335 #define TOKEQ 336 #define TOKNE 337 #define TOKNNTP 338 #define TOKNNTPS 339 #define TOKGROUP 340 #define TOKGROUPS 341 #define TOKPURGEAFTER 342 #define TOKCOMPRESS 343 #define TOKNORECEIVED 344 #define TOKFILEUMASK 345 #define TOKFILEGROUP 346 #define TOKVALUE 347 #define TOKTIMEOUT 348 #define TOKREMOVEHEADER 349 #define TOKREMOVEHEADERS 350 #define TOKSTDOUT 351 #define TOKNOVERIFY 352 #define TOKADDHEADER 353 #define TOKQUEUEHIGH 354 #define TOKQUEUELOW 355 #define TOKNOAPOP 356 #define TOKVERIFYCERTS 357 #define TOKEXPIRE 358 #define TOKTOCACHE 359 #define TOKINCACHE 360 #define TOKKEY 361 #define TOKNEWONLY 362 #define TOKOLDONLY 363 #define TOKCACHE 364 #define TOKFLOCK 365 #define TOKFCNTL 366 #define TOKDOTLOCK 367 #define TOKSTRIPCHARACTERS 368 #define NONE 369 #define NUMBER 370 #define STRING 371 #define STRMACRO 372 #define NUMMACRO 373 #define STRCOMMAND 374 #define NUMCOMMAND 375 #define YYERRCODE 256 short yylhs[] = { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 51, 51, 52, 52, 47, 47, 47, 48, 48, 29, 29, 29, 49, 50, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 31, 31, 73, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 69, 69, 35, 35, 53, 53, 54, 54, 61, 61, 55, 55, 56, 56, 37, 37, 57, 57, 58, 58, 25, 25, 25, 26, 26, 26, 65, 65, 24, 24, 66, 66, 60, 60, 60, 60, 40, 40, 13, 13, 15, 15, 14, 14, 44, 44, 43, 43, 45, 45, 18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 68, 68, 39, 39, 38, 38, 36, 36, 12, 12, 3, 3, 3, 3, 30, 30, 41, 41, 5, 5, 6, 6, 4, 4, 16, 16, 17, 17, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 7, 7, 42, 42, 42, 42, 72, 70, 46, 46, 59, 59, 19, 19, 20, 20, 32, 32, 21, 21, 22, 22, 23, 23, 64, 64, 64, 64, 63, 62, 62, 34, 34, 33, 33, 11, 11, 11, 11, 11, 11, 11, 11, 67, }; short yylen[] = { 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 2, 4, 2, 1, 1, 0, 1, 0, 1, 0, 2, 2, 3, 2, 0, 2, 1, 0, 2, 2, 2, 2, 1, 3, 3, 3, 1, 3, 4, 1, 1, 1, 2, 1, 4, 6, 0, 1, 2, 4, 2, 4, 0, 1, 0, 2, 2, 2, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 10, 3, 4, 5, 5, 2, 2, 4, 3, 5, 5, 5, 4, 4, 3, 2, 1, 2, 4, 6, 3, 1, 1, 4, 0, 2, 2, 4, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 2, 2, 4, 1, 0, 3, 0, 1, 0, 6, 6, 6, 6, 1, 1, 1, 6, 6, }; short yydefred[] = { 1, 0, 0, 0, 0, 0, 0, 9, 0, 0, 204, 2, 3, 4, 5, 6, 7, 8, 33, 34, 32, 35, 0, 0, 0, 25, 0, 61, 0, 0, 26, 27, 24, 0, 62, 0, 0, 0, 76, 0, 0, 0, 0, 0, 71, 0, 68, 69, 0, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 12, 13, 0, 0, 38, 39, 37, 58, 0, 106, 102, 101, 103, 105, 0, 108, 107, 63, 70, 60, 73, 72, 75, 74, 79, 80, 77, 78, 110, 109, 65, 0, 66, 67, 0, 0, 93, 0, 91, 14, 15, 152, 0, 0, 177, 178, 0, 0, 179, 0, 187, 188, 174, 0, 0, 173, 0, 0, 0, 0, 0, 181, 0, 118, 0, 57, 0, 82, 36, 0, 10, 11, 145, 0, 0, 0, 175, 176, 0, 0, 146, 22, 23, 141, 0, 0, 0, 149, 0, 0, 144, 137, 0, 0, 114, 0, 115, 44, 45, 46, 43, 104, 48, 49, 50, 51, 52, 53, 54, 86, 0, 0, 203, 205, 0, 0, 0, 0, 197, 117, 0, 167, 168, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 55, 237, 0, 217, 0, 219, 18, 20, 21, 19, 220, 221, 0, 0, 0, 0, 238, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, 0, 0, 0, 0, 90, 94, 85, 92, 0, 0, 0, 0, 196, 184, 0, 189, 169, 170, 0, 171, 172, 0, 0, 0, 0, 0, 0, 0, 160, 161, 162, 0, 0, 121, 241, 0, 0, 0, 0, 97, 0, 99, 0, 0, 140, 131, 139, 0, 142, 0, 0, 138, 0, 150, 147, 0, 0, 116, 89, 158, 202, 0, 0, 154, 0, 185, 191, 192, 193, 0, 112, 0, 0, 0, 0, 0, 0, 0, 16, 17, 0, 0, 88, 0, 0, 0, 127, 0, 0, 0, 0, 156, 96, 0, 200, 0, 0, 0, 0, 227, 0, 225, 214, 215, 0, 0, 0, 0, 0, 0, 208, 98, 87, 100, 126, 125, 0, 163, 0, 0, 0, 0, 0, 0, 212, 0, 207, 231, 0, 0, 0, 201, 0, 0, 234, 236, 222, 229, 210, 233, 235, 240, 209, 165, 0, 226, 182, }; short yydgoto[] = { 1, 225, 226, 196, 248, 184, 250, 51, 107, 52, 108, 209, 290, 53, 60, 264, 149, 150, 276, 369, 355, 210, 211, 212, 88, 74, 75, 68, 91, 76, 348, 126, 334, 358, 335, 285, 151, 152, 102, 103, 123, 374, 174, 218, 316, 274, 337, 21, 22, 77, 312, 281, 278, 171, 313, 46, 47, 213, 214, 310, 63, 233, 328, 327, 306, 78, 257, 11, 12, 13, 14, 15, 16, 17, 153, 64, 104, 311, 215, 216, 154, 48, 49, }; short yysindex[] = { 0, 1353, -304, -304, 2042, -254, -304, 0, -21, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, -228, -229, 0, -268, 0, -221, -297, 0, 0, 0, -304, 0, -304, -259, -260, 0, -232, -238, -268, -268, -268, 0, -304, 0, 0, -123, -118, 0, -208, -166, 1898, 15, -287, -304, -268, -304, 0, -229, 0, 0, 1479, 100, 0, 0, 0, 0, -206, 0, 0, 0, 0, 0, -171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -223, 0, 0, 15, -304, 0, -304, 0, 0, 0, 0, -104, -88, 0, 0, -166, -254, 0, -304, 0, 0, 0, -304, 21, 0, -304, -52, -160, -304, -304, 0, -183, 0, -268, 0, 15, 0, 0, 2077, 0, 0, 0, -170, -304, -304, 0, 0, -304, -304, 0, 0, 0, 0, -304, -304, 2001, 0, -304, -304, 0, 0, -44, -5, 0, -297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 72, 0, 0, -225, -304, 15, -254, 0, 0, 15, 0, 0, -268, -40, 0, -268, -56, 21, -304, -304, 21, -247, -36, -224, 0, 0, 0, -195, 0, -176, 0, 0, 0, 0, 0, 0, 0, -222, -170, -170, -170, 0, 0, 7, 28, -304, -134, 15, -26, 15, -32, -16, -214, 0, 1791, 15, 15, -304, 15, -304, 15, 67, 0, 0, 0, 0, -120, 1691, 105, 15, 0, 0, -255, 0, 0, 0, -268, 0, 0, -268, 15, 15, -268, -304, -297, -148, 0, 0, 0, -304, -304, 0, 0, -158, -158, -213, -304, 0, -304, 0, -100, -304, 0, 0, 0, -304, 0, -304, 15, 0, -304, 0, 0, 110, 114, 0, 0, 0, 0, 1947, -120, 0, 15, 0, 0, 0, 0, 15, 0, 116, -103, -103, -304, -304, -251, -131, 0, 0, -203, 39, 0, 257, 266, -297, 0, 15, 15, 15, 15, 0, 0, 1845, 0, -268, -304, -251, -131, 0, -97, 0, 0, 0, -197, -175, -304, -251, -304, -304, 0, 0, 0, 0, 0, 0, -120, 0, 142, -73, -175, -251, -304, -304, 0, -154, 0, 0, -154, -154, 329, 0, -255, -304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, }; short yyrindex[] = { 0, 0, 0, 0, 0, 1916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2073, 1768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -108, -95, 0, 34, 24, 0, 0, 0, 0, 2102, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1294, 0, 0, 1335, 0, 0, 0, 0, 0, 0, 0, -215, 0, 0, 0, -51, 1916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, 0, 0, 0, 1365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1609, 1916, 0, 0, 1624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, 0, -54, 0, -50, 0, 0, 0, 0, 0, 0, 0, 1385, 0, 0, 0, 0, 0, 0, 0, 0, 234, 311, 389, 466, 544, 0, 0, 0, 0, 621, 699, 0, 776, 0, 854, 0, 0, 0, 0, 0, 1396, 0, 0, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 1750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 674, 829, 0, 0, 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1396, 0, 339, 0, 0, 0, 0, 1849, 0, 0, 0, 984, 0, 0, 1266, 1139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1009, 1086, 1164, 1241, 0, 0, 0, 0, 167, 0, 1321, 1309, 0, 519, 0, 0, 0, 0, 491, 0, 646, 0, 0, 0, 0, 0, 0, 0, 0, 1396, 0, 0, 0, 801, 956, 0, 0, 0, 1111, 0, 0, 1111, 1111, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; short yygindex[] = { 0, -49, -78, 0, 0, -102, 0, 0, 0, -86, 115, 0, -261, 0, 0, 0, 164, 0, 0, -219, -126, 0, 0, 0, 0, 152, 0, -163, -105, 4, 0, 0, -288, -119, -99, -151, 56, 0, 180, 0, -231, 0, 0, 9, 0, 0, -90, 182, 1705, 1604, 30, 0, 0, -96, -29, 0, 0, 0, 0, 0, -34, 0, 0, -61, -22, -55, 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, }; #define YYTABLESIZE 2441 short yytable[] = { 96, 40, 172, 58, 182, 98, 183, 58, 182, 157, 183, 58, 83, 295, 148, 151, 187, 58, 110, 173, 197, 243, 179, 87, 56, 240, 130, 58, 198, 85, 69, 324, 61, 258, 41, 176, 55, 50, 131, 81, 56, 84, 40, 86, 89, 92, 93, 94, 113, 357, 100, 70, 132, 57, 259, 260, 82, 101, 58, 62, 42, 128, 113, 357, 159, 80, 59, 18, 19, 175, 20, 125, 199, 65, 18, 19, 66, 20, 67, 229, 286, 182, 245, 183, 195, 361, 249, 251, 297, 217, 254, 298, 242, 263, 163, 164, 165, 166, 167, 168, 169, 234, 65, 304, 305, 66, 261, 67, 105, 106, 65, 332, 333, 66, 255, 67, 18, 19, 231, 20, 158, 159, 160, 161, 40, 262, 40, 308, 309, 92, 268, 373, 65, 18, 19, 66, 20, 67, 65, 370, 371, 66, 273, 67, 71, 72, 73, 282, 289, 56, 193, 270, 301, 151, 128, 151, 325, 61, 326, 41, 315, 338, 339, 198, 336, 352, 198, 353, 198, 151, 198, 188, 189, 190, 191, 192, 224, 284, 288, 235, 151, 354, 198, 42, 62, 42, 362, 59, 69, 363, 292, 92, 287, 198, 71, 72, 73, 237, 368, 159, 376, 300, 159, 166, 159, 216, 159, 199, 111, 218, 199, 164, 199, 323, 199, 159, 159, 121, 159, 265, 266, 267, 178, 156, 364, 256, 199, 162, 350, 159, 293, 238, 365, 122, 129, 321, 244, 199, 351, 322, 129, 314, 329, 360, 307, 269, 271, 0, 18, 19, 239, 20, 296, 18, 19, 69, 20, 0, 69, 40, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 186, 284, 40, 40, 40, 40, 128, 246, 247, 56, 18, 19, 0, 20, 56, 56, 40, 56, 0, 41, 40, 40, 40, 40, 41, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 136, 59, 40, 40, 277, 40, 275, 42, 344, 0, 42, 0, 42, 42, 42, 42, 18, 19, 347, 20, 279, 0, 0, 42, 42, 0, 42, 0, 40, 40, 40, 40, 342, 342, 0, 0, 0, 42, 41, 40, 40, 40, 40, 40, 18, 19, 40, 20, 129, 40, 0, 0, 40, 40, 40, 18, 19, 359, 20, 40, 40, 40, 40, 40, 40, 40, 0, 18, 19, 0, 20, 341, 367, 0, 0, 41, 155, 56, 132, 41, 343, 41, 56, 0, 41, 56, 56, 41, 18, 19, 0, 20, 41, 0, 41, 41, 41, 41, 0, 18, 19, 128, 20, 0, 128, 128, 128, 128, 0, 128, 0, 128, 0, 42, 18, 19, 0, 20, 42, 128, 128, 42, 42, 0, 0, 136, 65, 18, 19, 66, 20, 67, 18, 19, 59, 20, 0, 0, 128, 59, 59, 128, 59, 372, 128, 128, 128, 128, 84, 128, 128, 128, 128, 83, 0, 134, 128, 0, 128, 65, 18, 19, 66, 20, 67, 18, 19, 0, 20, 0, 18, 19, 0, 20, 18, 19, 0, 20, 0, 0, 213, 129, 0, 128, 128, 0, 129, 129, 0, 129, 0, 129, 128, 128, 128, 128, 128, 0, 0, 128, 129, 0, 128, 132, 0, 128, 128, 128, 224, 0, 0, 0, 128, 0, 0, 128, 128, 0, 0, 0, 0, 129, 0, 0, 129, 129, 129, 129, 0, 129, 129, 129, 129, 31, 0, 0, 129, 0, 129, 0, 59, 0, 0, 0, 0, 59, 0, 0, 59, 59, 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 136, 136, 0, 136, 0, 136, 0, 0, 0, 129, 129, 129, 0, 129, 136, 0, 0, 134, 0, 129, 0, 0, 0, 0, 129, 0, 0, 0, 0, 129, 0, 0, 129, 129, 0, 136, 0, 0, 136, 136, 136, 136, 213, 136, 136, 136, 136, 133, 0, 0, 136, 0, 136, 0, 18, 19, 0, 20, 0, 0, 0, 0, 0, 18, 19, 0, 20, 0, 0, 0, 224, 0, 232, 132, 0, 0, 0, 0, 132, 132, 0, 132, 0, 132, 0, 0, 136, 136, 136, 0, 136, 0, 132, 0, 0, 31, 136, 0, 0, 0, 223, 136, 0, 0, 0, 0, 136, 0, 0, 136, 136, 0, 0, 132, 0, 0, 132, 132, 132, 132, 0, 132, 132, 132, 132, 135, 18, 19, 132, 20, 132, 84, 84, 0, 84, 0, 83, 83, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, 0, 0, 134, 134, 0, 134, 0, 134, 0, 0, 0, 132, 132, 132, 0, 132, 134, 0, 0, 133, 0, 132, 213, 0, 0, 0, 132, 213, 213, 0, 213, 132, 0, 0, 132, 132, 0, 134, 0, 0, 134, 134, 134, 134, 232, 134, 134, 134, 134, 155, 224, 0, 134, 0, 134, 224, 224, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 213, 31, 0, 0, 0, 213, 31, 31, 0, 31, 0, 31, 0, 224, 134, 134, 134, 0, 134, 0, 31, 0, 0, 135, 134, 0, 0, 0, 223, 134, 0, 0, 0, 224, 134, 0, 0, 134, 134, 0, 0, 31, 213, 0, 31, 31, 31, 31, 0, 31, 31, 31, 31, 95, 213, 0, 31, 0, 31, 213, 0, 0, 213, 213, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 224, 0, 0, 0, 133, 0, 224, 224, 224, 133, 133, 0, 133, 224, 133, 0, 224, 224, 31, 31, 31, 0, 31, 133, 0, 0, 155, 0, 31, 232, 0, 0, 0, 31, 232, 232, 0, 232, 31, 0, 0, 31, 31, 0, 133, 0, 0, 133, 133, 133, 133, 213, 133, 133, 133, 133, 29, 223, 0, 133, 0, 133, 223, 223, 0, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 232, 135, 0, 0, 0, 232, 135, 135, 0, 135, 0, 135, 0, 0, 133, 133, 133, 0, 133, 0, 135, 0, 0, 95, 133, 0, 0, 0, 228, 133, 0, 0, 0, 223, 133, 0, 0, 133, 133, 0, 0, 135, 232, 0, 135, 135, 135, 135, 0, 135, 135, 135, 135, 130, 232, 0, 135, 0, 135, 232, 0, 0, 232, 232, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 155, 0, 223, 223, 223, 155, 155, 0, 155, 223, 155, 0, 223, 223, 135, 135, 135, 0, 135, 155, 0, 0, 29, 0, 135, 213, 0, 0, 0, 135, 213, 213, 0, 213, 135, 0, 0, 135, 135, 0, 155, 0, 0, 155, 155, 155, 155, 232, 155, 155, 155, 155, 30, 223, 0, 155, 0, 155, 223, 223, 0, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 0, 211, 95, 0, 0, 0, 213, 95, 95, 0, 95, 0, 95, 0, 223, 155, 155, 155, 0, 155, 0, 95, 0, 0, 130, 155, 0, 0, 0, 206, 155, 0, 0, 0, 223, 155, 0, 0, 155, 155, 0, 0, 95, 0, 0, 95, 95, 95, 95, 0, 95, 95, 95, 95, 28, 213, 0, 95, 0, 95, 213, 0, 0, 213, 213, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, 29, 0, 223, 223, 223, 29, 29, 0, 29, 223, 29, 0, 223, 223, 95, 95, 95, 0, 95, 29, 0, 0, 30, 0, 95, 232, 0, 0, 0, 95, 232, 232, 0, 232, 95, 0, 0, 95, 95, 0, 29, 0, 0, 29, 29, 29, 29, 211, 29, 29, 29, 29, 143, 228, 0, 29, 0, 29, 228, 228, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 0, 230, 130, 0, 0, 0, 232, 130, 130, 0, 130, 0, 130, 0, 228, 29, 29, 29, 0, 29, 0, 130, 0, 0, 28, 29, 0, 0, 0, 47, 29, 0, 0, 0, 228, 29, 0, 0, 29, 29, 0, 0, 130, 0, 206, 130, 130, 130, 130, 0, 130, 130, 130, 130, 0, 232, 230, 130, 0, 130, 232, 0, 0, 232, 232, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 228, 228, 228, 30, 30, 0, 30, 228, 30, 0, 228, 228, 130, 130, 130, 0, 130, 30, 0, 81, 143, 0, 130, 211, 0, 0, 0, 130, 211, 211, 0, 211, 130, 0, 0, 130, 130, 0, 30, 122, 0, 30, 30, 30, 30, 230, 30, 30, 30, 30, 157, 206, 0, 30, 0, 30, 206, 206, 0, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 47, 0, 0, 28, 0, 0, 0, 211, 28, 28, 0, 28, 0, 28, 0, 206, 30, 30, 30, 0, 30, 0, 28, 0, 0, 0, 30, 230, 0, 0, 0, 30, 0, 0, 0, 206, 30, 0, 0, 30, 30, 64, 0, 28, 0, 0, 28, 28, 28, 28, 0, 28, 28, 28, 28, 0, 211, 0, 28, 10, 28, 211, 0, 0, 211, 211, 0, 0, 0, 0, 0, 81, 206, 0, 0, 0, 0, 0, 0, 0, 143, 0, 206, 206, 206, 143, 143, 0, 143, 206, 143, 122, 206, 206, 28, 28, 28, 0, 28, 143, 0, 0, 157, 0, 28, 230, 0, 0, 0, 28, 230, 230, 0, 230, 28, 0, 0, 28, 28, 0, 143, 0, 0, 143, 143, 143, 143, 0, 143, 143, 143, 143, 0, 47, 0, 143, 47, 143, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 206, 47, 47, 0, 47, 206, 206, 0, 206, 0, 0, 0, 230, 0, 230, 47, 0, 230, 230, 0, 230, 0, 0, 143, 143, 143, 64, 143, 0, 0, 0, 64, 64, 143, 64, 147, 0, 0, 143, 23, 24, 0, 0, 143, 2, 0, 143, 143, 0, 3, 4, 230, 5, 0, 0, 230, 81, 206, 0, 0, 0, 81, 81, 230, 81, 0, 0, 0, 230, 230, 79, 230, 230, 0, 0, 0, 122, 90, 0, 0, 0, 122, 122, 0, 122, 97, 99, 157, 0, 0, 124, 47, 157, 157, 0, 157, 47, 0, 0, 47, 47, 0, 0, 0, 206, 206, 206, 0, 0, 0, 230, 206, 0, 0, 206, 206, 0, 0, 230, 0, 0, 0, 0, 230, 0, 0, 230, 230, 0, 0, 0, 0, 64, 170, 0, 170, 0, 64, 0, 0, 64, 64, 0, 0, 54, 0, 0, 180, 0, 0, 6, 0, 0, 0, 0, 7, 0, 0, 8, 9, 0, 0, 81, 0, 0, 153, 0, 81, 0, 0, 81, 81, 0, 54, 0, 131, 0, 0, 0, 0, 183, 0, 122, 95, 0, 0, 0, 122, 0, 132, 122, 122, 0, 157, 127, 0, 0, 0, 157, 0, 0, 157, 157, 0, 0, 0, 0, 0, 236, 236, 133, 0, 0, 113, 134, 135, 136, 0, 137, 138, 139, 140, 0, 0, 0, 116, 0, 141, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 291, 0, 0, 0, 0, 181, 0, 272, 185, 0, 0, 54, 194, 0, 142, 143, 144, 0, 145, 0, 0, 0, 0, 0, 146, 0, 219, 220, 0, 0, 221, 222, 0, 0, 124, 0, 223, 54, 0, 0, 227, 228, 0, 0, 230, 232, 0, 0, 0, 0, 0, 302, 303, 153, 0, 0, 153, 0, 153, 195, 153, 0, 0, 0, 0, 0, 0, 241, 183, 153, 153, 183, 153, 183, 0, 183, 0, 113, 0, 0, 0, 252, 253, 153, 183, 183, 0, 183, 0, 0, 0, 0, 0, 0, 330, 331, 0, 0, 183, 0, 0, 340, 283, 0, 0, 345, 54, 54, 0, 0, 0, 0, 0, 0, 280, 0, 349, 0, 194, 0, 241, 194, 241, 194, 0, 194, 356, 0, 0, 170, 230, 294, 0, 0, 194, 194, 0, 194, 0, 0, 131, 0, 366, 0, 0, 0, 299, 0, 194, 0, 236, 0, 124, 375, 132, 0, 346, 0, 186, 54, 0, 54, 0, 0, 317, 0, 0, 0, 318, 0, 319, 0, 0, 320, 0, 133, 294, 294, 113, 134, 135, 136, 241, 137, 138, 139, 140, 0, 0, 0, 116, 0, 141, 0, 195, 0, 0, 195, 0, 195, 0, 195, 0, 0, 54, 54, 0, 0, 0, 0, 195, 195, 0, 195, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 195, 0, 142, 143, 144, 54, 145, 113, 0, 0, 0, 0, 146, 0, 0, 0, 131, 0, 0, 0, 54, 0, 0, 0, 18, 19, 0, 20, 113, 0, 132, 113, 113, 113, 113, 0, 113, 113, 113, 113, 0, 0, 0, 113, 0, 113, 0, 0, 0, 0, 0, 133, 0, 0, 113, 134, 135, 136, 0, 137, 138, 139, 140, 0, 0, 0, 116, 0, 141, 186, 131, 0, 186, 0, 186, 0, 186, 0, 0, 113, 113, 113, 0, 113, 132, 186, 186, 0, 186, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 0, 0, 142, 143, 144, 133, 145, 0, 113, 134, 135, 136, 146, 137, 138, 139, 140, 109, 100, 0, 116, 0, 141, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 110, 0, 120, 120, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 111, 112, 120, 0, 0, 0, 0, 142, 143, 144, 0, 145, 113, 0, 0, 0, 0, 146, 120, 120, 0, 114, 115, 131, 116, 117, 0, 0, 0, 0, 120, 0, 0, 0, 0, 118, 0, 132, 0, 120, 120, 119, 120, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 133, 120, 0, 113, 134, 135, 136, 0, 137, 138, 139, 140, 0, 120, 0, 116, 0, 141, 0, 131, 0, 0, 0, 0, 18, 19, 0, 20, 0, 0, 0, 120, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 120, 120, 0, 120, 0, 0, 0, 0, 0, 142, 143, 144, 133, 145, 0, 113, 134, 135, 136, 146, 137, 138, 139, 140, 0, 0, 0, 116, 0, 141, 0, 18, 19, 25, 20, 26, 27, 28, 29, 30, 31, 32, 0, 0, 0, 0, 0, 124, 0, 0, 0, 33, 34, 0, 35, 124, 124, 124, 0, 198, 199, 200, 0, 142, 143, 144, 0, 145, 0, 0, 0, 36, 0, 146, 124, 0, 0, 0, 124, 124, 0, 0, 201, 202, 113, 113, 113, 0, 0, 124, 124, 124, 0, 203, 204, 205, 0, 37, 124, 38, 39, 40, 206, 41, 0, 0, 0, 113, 113, 42, 43, 0, 44, 0, 0, 0, 0, 0, 113, 113, 113, 0, 0, 45, 124, 124, 0, 113, 207, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 113, }; short yycheck[] = { 123, 0, 98, 43, 60, 123, 62, 43, 60, 64, 62, 43, 272, 244, 63, 123, 118, 43, 273, 123, 125, 184, 108, 261, 0, 176, 60, 43, 123, 261, 26, 292, 261, 257, 0, 123, 6, 291, 263, 298, 61, 37, 41, 39, 40, 41, 42, 43, 263, 337, 258, 272, 277, 61, 278, 279, 315, 265, 43, 288, 0, 57, 277, 351, 123, 35, 294, 371, 372, 103, 374, 358, 123, 370, 371, 372, 373, 374, 375, 123, 231, 60, 187, 62, 267, 346, 188, 189, 251, 259, 192, 254, 178, 315, 317, 318, 319, 320, 321, 322, 323, 156, 370, 261, 262, 373, 301, 375, 274, 275, 370, 362, 363, 373, 361, 375, 371, 372, 123, 374, 326, 327, 328, 329, 123, 301, 125, 340, 341, 125, 123, 362, 370, 371, 372, 373, 374, 375, 370, 358, 359, 373, 276, 375, 365, 366, 367, 361, 268, 125, 120, 123, 300, 261, 0, 263, 40, 261, 261, 125, 260, 364, 123, 258, 295, 262, 261, 364, 263, 277, 265, 331, 332, 333, 334, 335, 146, 226, 233, 125, 288, 356, 277, 123, 288, 125, 44, 0, 184, 262, 239, 187, 125, 288, 365, 366, 367, 125, 352, 258, 41, 256, 261, 41, 263, 259, 265, 258, 300, 259, 261, 44, 263, 291, 265, 274, 275, 53, 277, 210, 211, 212, 107, 123, 350, 261, 277, 75, 327, 288, 125, 175, 351, 53, 0, 125, 276, 288, 328, 125, 58, 270, 303, 339, 266, 215, 216, -1, 371, 372, 175, 374, 248, 371, 372, 251, 374, -1, 254, 258, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 325, 323, 274, 275, 276, 277, 125, 336, 337, 258, 371, 372, -1, 374, 263, 264, 288, 266, -1, 258, 292, 293, 294, 295, 263, 264, 298, 266, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 0, 125, 312, 313, 347, 315, 343, 258, 315, -1, 261, -1, 263, 264, 265, 266, 371, 372, 325, 374, 347, -1, -1, 274, 275, -1, 277, -1, 338, 339, 340, 341, 313, 314, -1, -1, -1, 288, 315, 349, 350, 351, 352, 353, 371, 372, 356, 374, 125, 359, -1, -1, 362, 363, 364, 371, 372, 338, 374, 369, 370, 371, 372, 373, 374, 375, -1, 371, 372, -1, 374, 125, 353, -1, -1, 352, 287, 364, 0, 356, 125, 358, 369, -1, 361, 372, 373, 364, 371, 372, -1, 374, 369, -1, 371, 372, 373, 374, -1, 371, 372, 258, 374, -1, 261, 262, 263, 264, -1, 266, -1, 268, -1, 364, 371, 372, -1, 374, 369, 276, 277, 372, 373, -1, -1, 125, 370, 371, 372, 373, 374, 375, 371, 372, 258, 374, -1, -1, 295, 263, 264, 298, 266, 125, 301, 302, 303, 304, 125, 306, 307, 308, 309, 125, -1, 0, 313, -1, 315, 370, 371, 372, 373, 374, 375, 371, 372, -1, 374, -1, 371, 372, -1, 374, 371, 372, -1, 374, -1, -1, 0, 258, -1, 340, 341, -1, 263, 264, -1, 266, -1, 268, 349, 350, 351, 352, 353, -1, -1, 356, 277, -1, 359, 125, -1, 362, 363, 364, 0, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, -1, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, 0, -1, -1, 313, -1, 315, -1, 364, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1, 263, 264, -1, 266, -1, 268, -1, -1, -1, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, -1, -1, -1, -1, 364, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, -1, -1, 313, -1, 315, -1, 371, 372, -1, 374, -1, -1, -1, -1, -1, 371, 372, -1, 374, -1, -1, -1, 125, -1, 0, 258, -1, -1, -1, -1, 263, 264, -1, 266, -1, 268, -1, -1, 349, 350, 351, -1, 353, -1, 277, -1, -1, 125, 359, -1, -1, -1, 0, 364, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, 0, 371, 372, 313, 374, 315, 371, 372, -1, 374, -1, 371, 372, -1, 374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1, 263, 264, -1, 266, -1, 268, -1, -1, -1, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, 258, -1, 313, -1, 315, 263, 264, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 0, 258, -1, -1, -1, 315, 263, 264, -1, 266, -1, 268, -1, 295, 349, 350, 351, -1, 353, -1, 277, -1, -1, 125, 359, -1, -1, -1, 0, 364, -1, -1, -1, 315, 369, -1, -1, 372, 373, -1, -1, 298, 352, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, 0, 364, -1, 313, -1, 315, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, -1, 352, -1, -1, -1, 356, -1, -1, -1, 258, -1, 362, 363, 364, 263, 264, -1, 266, 369, 268, -1, 372, 373, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, 258, -1, 313, -1, 315, 263, 264, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 0, 258, -1, -1, -1, 315, 263, 264, -1, 266, -1, 268, -1, -1, 349, 350, 351, -1, 353, -1, 277, -1, -1, 125, 359, -1, -1, -1, 0, 364, -1, -1, -1, 315, 369, -1, -1, 372, 373, -1, -1, 298, 352, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, 0, 364, -1, 313, -1, 315, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, -1, 352, -1, -1, -1, 356, -1, -1, -1, 258, -1, 362, 363, 364, 263, 264, -1, 266, 369, 268, -1, 372, 373, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, 258, -1, 313, -1, 315, 263, 264, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 0, 258, -1, -1, -1, 315, 263, 264, -1, 266, -1, 268, -1, 295, 349, 350, 351, -1, 353, -1, 277, -1, -1, 125, 359, -1, -1, -1, 0, 364, -1, -1, -1, 315, 369, -1, -1, 372, 373, -1, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, 0, 364, -1, 313, -1, 315, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, -1, 352, -1, -1, -1, -1, -1, -1, -1, 258, -1, 362, 363, 364, 263, 264, -1, 266, 369, 268, -1, 372, 373, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, 258, -1, 313, -1, 315, 263, 264, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 0, 258, -1, -1, -1, 315, 263, 264, -1, 266, -1, 268, -1, 295, 349, 350, 351, -1, 353, -1, 277, -1, -1, 125, 359, -1, -1, -1, 0, 364, -1, -1, -1, 315, 369, -1, -1, 372, 373, -1, -1, 298, -1, 0, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, 364, 0, 313, -1, 315, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, 362, 363, 364, 263, 264, -1, 266, 369, 268, -1, 372, 373, 349, 350, 351, -1, 353, 277, -1, 0, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, 0, -1, 301, 302, 303, 304, 125, 306, 307, 308, 309, 0, 258, -1, 313, -1, 315, 263, 264, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, -1, 125, -1, -1, 258, -1, -1, -1, 315, 263, 264, -1, 266, -1, 268, -1, 125, 349, 350, 351, -1, 353, -1, 277, -1, -1, -1, 359, 125, -1, -1, -1, 364, -1, -1, -1, 315, 369, -1, -1, 372, 373, 125, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, 364, -1, 313, 125, 315, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, 125, 352, -1, -1, -1, -1, -1, -1, -1, 258, -1, 362, 363, 364, 263, 264, -1, 266, 369, 268, 125, 372, 373, 349, 350, 351, -1, 353, 277, -1, -1, 125, -1, 359, 258, -1, -1, -1, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, 258, -1, 313, 261, 315, 263, 264, 265, 266, -1, -1, -1, -1, -1, -1, 258, 274, 275, -1, 277, 263, 264, -1, 266, -1, -1, -1, 258, -1, 315, 288, -1, 263, 264, -1, 266, -1, -1, 349, 350, 351, 258, 353, -1, -1, -1, 263, 264, 359, 266, 123, -1, -1, 364, 2, 3, -1, -1, 369, 258, -1, 372, 373, -1, 263, 264, 352, 266, -1, -1, 356, 258, 315, -1, -1, -1, 263, 264, 364, 266, -1, -1, -1, 369, 315, 33, 372, 373, -1, -1, -1, 258, 40, -1, -1, -1, 263, 264, -1, 266, 48, 49, 258, -1, -1, 53, 364, 263, 264, -1, 266, 369, -1, -1, 372, 373, -1, -1, -1, 362, 363, 364, -1, -1, -1, 356, 369, -1, -1, 372, 373, -1, -1, 364, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, -1, -1, 364, 96, -1, 98, -1, 369, -1, -1, 372, 373, -1, -1, 6, -1, -1, 110, -1, -1, 364, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, 364, -1, -1, 123, -1, 369, -1, -1, 372, 373, -1, 35, -1, 263, -1, -1, -1, -1, 123, -1, 364, 45, -1, -1, -1, 369, -1, 277, 372, 373, -1, 364, 56, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, 171, 172, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, -1, -1, 313, -1, 315, -1, -1, 123, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, 123, -1, -1, -1, -1, 114, -1, 217, 117, -1, -1, 120, 121, -1, 349, 350, 351, -1, 353, -1, -1, -1, -1, -1, 359, -1, 135, 136, -1, -1, 139, 140, -1, -1, 244, -1, 145, 146, -1, -1, 149, 150, -1, -1, 153, 154, -1, -1, -1, -1, -1, 261, 262, 258, -1, -1, 261, -1, 263, 123, 265, -1, -1, -1, -1, -1, -1, 176, 258, 274, 275, 261, 277, 263, -1, 265, -1, 123, -1, -1, -1, 190, 191, 288, 274, 275, -1, 277, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 288, -1, -1, 311, 125, -1, -1, 315, 215, 216, -1, -1, -1, -1, -1, -1, 223, -1, 326, -1, 258, -1, 229, 261, 231, 263, -1, 265, 336, -1, -1, 339, 239, 240, -1, -1, 274, 275, -1, 277, -1, -1, 263, -1, 352, -1, -1, -1, 255, -1, 288, -1, 360, -1, 362, 363, 277, -1, 125, -1, 123, 268, -1, 270, -1, -1, 273, -1, -1, -1, 277, -1, 279, -1, -1, 282, -1, 298, 285, 286, 301, 302, 303, 304, 291, 306, 307, 308, 309, -1, -1, -1, 313, -1, 315, -1, 258, -1, -1, 261, -1, 263, -1, 265, -1, -1, 313, 314, -1, -1, -1, -1, 274, 275, -1, 277, -1, -1, -1, 263, -1, -1, -1, -1, -1, -1, 288, -1, 349, 350, 351, 338, 353, 277, -1, -1, -1, -1, 359, -1, -1, -1, 263, -1, -1, -1, 353, -1, -1, -1, 371, 372, -1, 374, 298, -1, 277, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, -1, -1, 313, -1, 315, -1, -1, -1, -1, -1, 298, -1, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, -1, -1, 313, -1, 315, 258, 263, -1, 261, -1, 263, -1, 265, -1, -1, 349, 350, 351, -1, 353, 277, 274, 275, -1, 277, 359, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, -1, 349, 350, 351, 298, 353, -1, 301, 302, 303, 304, 359, 306, 307, 308, 309, 257, 258, -1, 313, -1, 315, -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, 273, -1, 257, 258, -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, -1, -1, 289, 290, 273, -1, -1, -1, -1, 349, 350, 351, -1, 353, 301, -1, -1, -1, -1, 359, 289, 290, -1, 310, 311, 263, 313, 314, -1, -1, -1, -1, 301, -1, -1, -1, -1, 324, -1, 277, -1, 310, 311, 330, 313, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, 298, 330, -1, 301, 302, 303, 304, -1, 306, 307, 308, 309, -1, 360, -1, 313, -1, 315, -1, 263, -1, -1, -1, -1, 371, 372, -1, 374, -1, -1, -1, 360, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, 371, 372, -1, 374, -1, -1, -1, -1, -1, 349, 350, 351, 298, 353, -1, 301, 302, 303, 304, 359, 306, 307, 308, 309, -1, -1, -1, 313, -1, 315, -1, 371, 372, 278, 374, 280, 281, 282, 283, 284, 285, 286, -1, -1, -1, -1, -1, 261, -1, -1, -1, 296, 297, -1, 299, 269, 270, 271, -1, 269, 270, 271, -1, 349, 350, 351, -1, 353, -1, -1, -1, 316, -1, 359, 288, -1, -1, -1, 292, 293, -1, -1, 292, 293, 269, 270, 271, -1, -1, 303, 304, 305, -1, 303, 304, 305, -1, 342, 312, 344, 345, 346, 312, 348, -1, -1, -1, 292, 293, 354, 355, -1, 357, -1, -1, -1, -1, -1, 303, 304, 305, -1, -1, 368, 338, 339, -1, 312, 338, 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 338, 339, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 375 #if YYDEBUG char *yyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"'('","')'",0,"'+'","','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'<'","'='", "'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,"TOKALL","TOKACCOUNT","TOKSERVER","TOKPORT","TOKUSER","TOKPASS","TOKACTION", "TOKSET","TOKACCOUNTS","TOKMATCH","TOKIN","TOKCONTINUE","TOKSTDIN","TOKPOP3", "TOKPOP3S","TOKNONE","TOKCASE","TOKAND","TOKOR","TOKTO","TOKACTIONS", "TOKHEADERS","TOKBODY","TOKMAXSIZE","TOKDELTOOBIG","TOKLOCKTYPES","TOKDEFUSER", "TOKDOMAIN","TOKDOMAINS","TOKHEADER","TOKFROMHEADERS","TOKUSERS","TOKMATCHED", "TOKUNMATCHED","TOKNOT","TOKIMAP","TOKIMAPS","TOKDISABLED","TOKFOLDER", "TOKPROXY","TOKALLOWMANY","TOKDROP","TOKLOCKFILE","TOKRETURNS","TOKPIPE", "TOKSMTP","TOKMAILDIR","TOKMBOX","TOKMBOXES","TOKWRITE","TOKAPPEND", "TOKREWRITE","TOKTAG","TOKTAGGED","TOKSIZE","TOKMAILDIRS","TOKEXEC","TOKSTRING", "TOKKEEP","TOKIMPLACT","TOKHOURS","TOKMINUTES","TOKSECONDS","TOKDAYS", "TOKWEEKS","TOKMONTHS","TOKYEARS","TOKAGE","TOKINVALID","TOKKILOBYTES", "TOKMEGABYTES","TOKGIGABYTES","TOKBYTES","TOKATTACHMENT","TOKCOUNT", "TOKTOTALSIZE","TOKANYTYPE","TOKANYNAME","TOKANYSIZE","TOKEQ","TOKNE","TOKNNTP", "TOKNNTPS","TOKGROUP","TOKGROUPS","TOKPURGEAFTER","TOKCOMPRESS","TOKNORECEIVED", "TOKFILEUMASK","TOKFILEGROUP","TOKVALUE","TOKTIMEOUT","TOKREMOVEHEADER", "TOKREMOVEHEADERS","TOKSTDOUT","TOKNOVERIFY","TOKADDHEADER","TOKQUEUEHIGH", "TOKQUEUELOW","TOKNOAPOP","TOKVERIFYCERTS","TOKEXPIRE","TOKTOCACHE", "TOKINCACHE","TOKKEY","TOKNEWONLY","TOKOLDONLY","TOKCACHE","TOKFLOCK", "TOKFCNTL","TOKDOTLOCK","TOKSTRIPCHARACTERS","NONE","NUMBER","STRING", "STRMACRO","NUMMACRO","STRCOMMAND","NUMCOMMAND", }; char *yyrule[] = { "$accept : cmds", "cmds :", "cmds : cmds account", "cmds : cmds defaction", "cmds : cmds defmacro", "cmds : cmds rule", "cmds : cmds set", "cmds : cmds close", "cmds : cmds cache", "cmds : cmds NONE", "actionp : TOKACTION", "actionp : TOKACTIONS", "userp : TOKUSER", "userp : TOKUSERS", "accountp : TOKACCOUNT", "accountp : TOKACCOUNTS", "groupp : TOKGROUP", "groupp : TOKGROUPS", "maildirp : TOKMAILDIR", "maildirp : TOKMAILDIRS", "mboxp : TOKMBOX", "mboxp : TOKMBOXES", "rmheaderp : TOKREMOVEHEADER", "rmheaderp : TOKREMOVEHEADERS", "headerp : TOKHEADER", "headerp : TOKHEADERS", "domainp : TOKDOMAIN", "domainp : TOKDOMAINS", "val : TOKVALUE strv", "val : strv", "optval : TOKVALUE strv", "optval :", "xstrv : STRCOMMAND", "xstrv : STRING", "xstrv : STRMACRO", "strv : xstrv", "strv : strv '+' xstrv", "numv : NUMCOMMAND", "numv : NUMBER", "numv : NUMMACRO", "replstrv : strv", "replpathv : strv", "size : numv", "size : numv TOKBYTES", "size : numv TOKKILOBYTES", "size : numv TOKMEGABYTES", "size : numv TOKGIGABYTES", "time : numv", "time : numv TOKHOURS", "time : numv TOKMINUTES", "time : numv TOKSECONDS", "time : numv TOKDAYS", "time : numv TOKWEEKS", "time : numv TOKMONTHS", "time : numv TOKYEARS", "expire : TOKEXPIRE time", "expire :", "cache : TOKCACHE replpathv expire", "set : TOKSET TOKMAXSIZE size", "set : TOKSET TOKLOCKTYPES locklist", "set : TOKSET TOKLOCKFILE replpathv", "set : TOKSET TOKDELTOOBIG", "set : TOKSET TOKALLOWMANY", "set : TOKSET TOKDEFUSER uid", "set : TOKSET TOKSTRIPCHARACTERS strv", "set : TOKSET TOKTIMEOUT time", "set : TOKSET TOKQUEUEHIGH numv", "set : TOKSET TOKQUEUELOW numv", "set : TOKSET domains", "set : TOKSET headers", "set : TOKSET TOKPROXY replstrv", "set : TOKSET TOKVERIFYCERTS", "set : TOKSET TOKIMPLACT TOKKEEP", "set : TOKSET TOKIMPLACT TOKDROP", "set : TOKSET TOKPURGEAFTER numv", "set : TOKSET TOKPURGEAFTER TOKNONE", "set : TOKSET TOKNORECEIVED", "set : TOKSET TOKFILEGROUP TOKUSER", "set : TOKSET TOKFILEGROUP gid", "set : TOKSET TOKFILEUMASK TOKUSER", "set : TOKSET TOKFILEUMASK numv", "defmacro : STRMACRO '=' strv", "defmacro : NUMMACRO '=' numv", "replstrslist : replstrslist strv", "replstrslist : strv", "stringslist : stringslist replstrv", "stringslist : replstrv", "pathslist : pathslist replpathv", "pathslist : replpathv", "userslist : userslist uid", "userslist : uid", "domains : domainp replstrv", "domains : domainp '{' stringslist '}'", "headers : headerp replstrv", "headers : headerp '{' stringslist '}'", "rmheaders : rmheaderp strv", "rmheaders : rmheaderp '{' replstrslist '}'", "maildirs : maildirp replpathv", "maildirs : maildirp '{' pathslist '}'", "mboxes : mboxp replpathv", "mboxes : mboxp '{' pathslist '}'", "lock : TOKFCNTL", "lock : TOKFLOCK", "lock : TOKDOTLOCK", "locklist : locklist lock", "locklist : lock", "locklist : TOKNONE", "uid : replstrv", "uid : numv", "gid : replstrv", "gid : numv", "user :", "user : TOKUSER uid", "users :", "users : userp TOKFROMHEADERS", "users : userp uid", "users : userp '{' userslist '}'", "casere : TOKCASE replstrv", "casere : replstrv", "not : TOKNOT", "not :", "keep : TOKKEEP", "keep :", "disabled : TOKDISABLED", "disabled :", "port : TOKPORT replstrv", "port : TOKPORT numv", "server : TOKSERVER replstrv port", "server : TOKSERVER replstrv", "to :", "to : TOKTO strv", "compress : TOKCOMPRESS", "compress :", "actitem : execpipe strv", "actitem : TOKREWRITE strv", "actitem : writeappend strv", "actitem : TOKMAILDIR strv", "actitem : rmheaders", "actitem : TOKADDHEADER strv val", "actitem : TOKMBOX strv compress", "actitem : TOKSMTP server to", "actitem : TOKSTDOUT", "actitem : TOKTAG strv optval", "actitem : TOKTOCACHE replpathv TOKKEY strv", "actitem : actions", "actitem : TOKDROP", "actitem : TOKKEEP", "actlist : actlist actitem", "actlist : actitem", "defaction : TOKACTION replstrv users actitem", "defaction : TOKACTION replstrv users '{' actlist '}'", "accounts2 :", "accounts2 : accounts", "accounts : accountp strv", "accounts : accountp '{' replstrslist '}'", "actions : actionp strv", "actions : actionp '{' replstrslist '}'", "cont :", "cont : TOKCONTINUE", "area :", "area : TOKIN TOKALL", "area : TOKIN TOKHEADERS", "area : TOKIN TOKBODY", "retrc : numv", "retrc :", "retre : casere", "retre :", "ltgt : '<'", "ltgt : '>'", "eqne : TOKEQ", "eqne : TOKNE", "cmp : ltgt", "cmp : eqne", "execpipe : TOKEXEC", "execpipe : TOKPIPE", "writeappend : TOKWRITE", "writeappend : TOKAPPEND", "exprop : TOKAND", "exprop : TOKOR", "expritem : not TOKALL", "expritem : not casere area", "expritem : not accounts", "expritem : not execpipe strv user TOKRETURNS '(' retrc ',' retre ')'", "expritem : not TOKTAGGED strv", "expritem : not TOKSIZE ltgt size", "expritem : not TOKSTRING strv TOKTO casere", "expritem : not TOKINCACHE replpathv TOKKEY strv", "expritem : not TOKMATCHED", "expritem : not TOKUNMATCHED", "expritem : not TOKAGE ltgt time", "expritem : not TOKAGE TOKINVALID", "expritem : not TOKATTACHMENT TOKCOUNT cmp numv", "expritem : not TOKATTACHMENT TOKTOTALSIZE ltgt size", "expritem : not TOKATTACHMENT TOKANYSIZE ltgt size", "expritem : not TOKATTACHMENT TOKANYTYPE strv", "expritem : not TOKATTACHMENT TOKANYNAME strv", "exprlist : exprlist exprop expritem", "exprlist : exprop expritem", "expr : expritem", "expr : expritem exprlist", "perform : users actionp actitem cont", "perform : users actionp '{' actlist '}' cont", "perform : users actions cont", "perform : '{'", "close : '}'", "rule : TOKMATCH expr accounts2 perform", "folder :", "folder : TOKFOLDER replstrv", "groups : groupp replstrv", "groups : groupp '{' stringslist '}'", "verify : TOKNOVERIFY", "verify :", "apop : TOKNOAPOP", "apop :", "only : TOKNEWONLY", "only : TOKOLDONLY", "poptype : TOKPOP3", "poptype : TOKPOP3S", "imaptype : TOKIMAP", "imaptype : TOKIMAPS", "nntptype : TOKNNTP", "nntptype : TOKNNTPS", "userpassnetrc : TOKUSER replstrv TOKPASS replstrv", "userpassnetrc :", "userpassnetrc : TOKUSER replstrv", "userpassnetrc : TOKPASS replstrv", "userpassreqd : TOKUSER replstrv TOKPASS replstrv", "userpass : userpassreqd", "userpass :", "poponly : only TOKCACHE replpathv", "poponly :", "imaponly : only", "imaponly :", "fetchtype : poptype server userpassnetrc poponly apop verify", "fetchtype : TOKPOP3 TOKPIPE replstrv userpassreqd poponly apop", "fetchtype : imaptype server userpassnetrc folder imaponly verify", "fetchtype : TOKIMAP TOKPIPE replstrv userpass folder imaponly", "fetchtype : TOKSTDIN", "fetchtype : maildirs", "fetchtype : mboxes", "fetchtype : nntptype server groups TOKCACHE replpathv verify", "account : TOKACCOUNT replstrv disabled users fetchtype keep", }; #endif #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 int yydebug; int yynerrs; int yyerrflag; int yychar; short *yyssp; YYSTYPE *yyvsp; YYSTYPE yyval; YYSTYPE yylval; short *yyss; short *yysslim; YYSTYPE *yyvs; int yystacksize; #line 2503 "parse.y" /* Programs */ #line 1302 "y.tab.c" /* allocate initial stack or double stack size, up to YYMAXDEPTH */ int yyparse __P((void)); static int yygrowstack __P((void)); static int yygrowstack() { int newsize, i; short *newss; YYSTYPE *newvs; if ((newsize = yystacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return -1; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = yyssp - yyss; if ((newss = (short *)realloc(yyss, newsize * sizeof *newss)) == NULL) return -1; yyss = newss; yyssp = newss + i; if ((newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs)) == NULL) return -1; yyvs = newvs; yyvsp = newvs + i; yystacksize = newsize; yysslim = yyss + newsize - 1; return 0; } #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int yyparse() { int yym, yyn, yystate; #if YYDEBUG char *yys; if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = (-1); if (yyss == NULL && yygrowstack()) goto yyoverflow; yyssp = yyss; yyvsp = yyvs; *yyssp = yystate = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = yylex()) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yyssp >= yysslim && yygrowstack()) { goto yyoverflow; } *++yyssp = yystate = yytable[yyn]; *++yyvsp = yylval; yychar = (-1); if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; goto yynewerror; yynewerror: yyerror("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); #endif if (yyssp >= yysslim && yygrowstack()) { goto yyoverflow; } *++yyssp = yystate = yytable[yyn]; *++yyvsp = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yyssp); #endif if (yyssp <= yyss) goto yyabort; --yyssp; --yyvsp; } } } else { if (yychar == 0) goto yyabort; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = (-1); goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; yyval = yyvsp[1-yym]; switch (yyn) { case 28: #line 283 "parse.y" { yyval.string = yyvsp[0].string; } break; case 29: #line 288 "parse.y" { yyval.string = yyvsp[0].string; } break; case 30: #line 295 "parse.y" { yyval.string = yyvsp[0].string; } break; case 31: #line 299 "parse.y" { yyval.string = NULL; } break; case 32: #line 305 "parse.y" { yyval.string = run_command(yyvsp[0].string, parse_file->path); xfree(yyvsp[0].string); } break; case 33: #line 310 "parse.y" { yyval.string = yyvsp[0].string; } break; case 34: #line 314 "parse.y" { struct macro *macro; if (strlen(yyvsp[0].string) > MAXNAMESIZE) yyerror("macro name too long: %s", yyvsp[0].string); if ((macro = find_macro(yyvsp[0].string)) == NULL) yyerror("undefined macro: %s", yyvsp[0].string); if (macro->type != MACRO_STRING) yyerror("string macro expected: %s", yyvsp[0].string); yyval.string = xstrdup(macro->value.str); xfree(yyvsp[0].string); } break; case 35: #line 333 "parse.y" { yyval.string = yyvsp[0].string; } break; case 36: #line 338 "parse.y" { size_t size; size = strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 1; yyval.string = xrealloc(yyvsp[-2].string, 1, size); strlcat(yyval.string, yyvsp[0].string, size); xfree(yyvsp[0].string); } break; case 37: #line 349 "parse.y" { const char *errstr; char *s; s = run_command(yyvsp[0].string, parse_file->path); yyval.number = strtonum(s, 0, LLONG_MAX, &errstr); if (errstr != NULL) yyerror("number is %s", errstr); xfree(s); xfree(yyvsp[0].string); } break; case 38: #line 364 "parse.y" { yyval.number = yyvsp[0].number; } break; case 39: #line 368 "parse.y" { struct macro *macro; if (strlen(yyvsp[0].string) > MAXNAMESIZE) yyerror("macro name too long: %s", yyvsp[0].string); if ((macro = find_macro(yyvsp[0].string)) == NULL) yyerror("undefined macro: %s", yyvsp[0].string); if (macro->type != MACRO_NUMBER) yyerror("number macro expected: %s", yyvsp[0].string); yyval.number = macro->value.num; xfree(yyvsp[0].string); } break; case 40: #line 387 "parse.y" { struct replstr rs; rs.str = yyvsp[0].string; yyval.string = replacestr(&rs, parse_tags, NULL, NULL); xfree(yyvsp[0].string); } break; case 41: #line 398 "parse.y" { struct replpath rp; rp.str = yyvsp[0].string; yyval.string = replacepath(&rp, parse_tags, NULL, NULL); xfree(yyvsp[0].string); } break; case 42: #line 409 "parse.y" { yyval.number = yyvsp[0].number; } break; case 43: #line 414 "parse.y" { yyval.number = yyvsp[-1].number; } break; case 44: #line 419 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / 1024) yyerror("size is too big"); yyval.number = yyvsp[-1].number * 1024; } break; case 45: #line 426 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / (1024 * 1024)) yyerror("size is too big"); yyval.number = yyvsp[-1].number * (1024 * 1024); } break; case 46: #line 433 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / (1024 * 1024 * 1024)) yyerror("size is too big"); yyval.number = yyvsp[-1].number * (1024 * 1024 * 1024); } break; case 47: #line 442 "parse.y" { yyval.number = yyvsp[0].number; } break; case 48: #line 447 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_HOUR) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_HOUR; } break; case 49: #line 454 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_MINUTE) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_MINUTE; } break; case 50: #line 461 "parse.y" { yyval.number = yyvsp[-1].number; } break; case 51: #line 466 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_DAY) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_DAY; } break; case 52: #line 473 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_WEEK) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_WEEK; } break; case 53: #line 480 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_MONTH) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_MONTH; } break; case 54: #line 487 "parse.y" { if (yyvsp[-1].number > LLONG_MAX / TIME_YEAR) yyerror("time is too long"); yyval.number = yyvsp[-1].number * TIME_YEAR; } break; case 55: #line 496 "parse.y" { #if UINT64_MAX < LLONG_MAX if (yyvsp[0].number > UINT64_MAX) yyerror("time too long"); #endif yyval.number = yyvsp[0].number; } break; case 56: #line 505 "parse.y" { yyval.number = -1; } break; case 57: #line 512 "parse.y" { struct cache *cache; TAILQ_FOREACH(cache, &conf.caches, entry) { if (strcmp(cache->path, yyvsp[-1].string) == 0) yyerror("duplicate cache path"); } cache = xcalloc(1, sizeof *cache); cache->path = yyvsp[-1].string; cache->expire = yyvsp[0].number; TAILQ_INSERT_TAIL(&conf.caches, cache, entry); log_debug2("added cache \"%s\": expire %lld", cache->path, yyvsp[0].number); } break; case 58: #line 532 "parse.y" { if (yyvsp[0].number == 0) yyerror("zero maximum size"); if (yyvsp[0].number > MAXMAILSIZE) yyerror("maximum size too large: %lld", yyvsp[0].number); conf.max_size = yyvsp[0].number; } break; case 59: #line 541 "parse.y" { if (yyvsp[0].locks & LOCK_FCNTL && yyvsp[0].locks & LOCK_FLOCK) yyerror("fcntl and flock locking cannot be used together"); conf.lock_types = yyvsp[0].locks; } break; case 60: #line 548 "parse.y" { if (conf.lock_file != NULL) xfree(conf.lock_file); conf.lock_file = yyvsp[0].string; } break; case 61: #line 554 "parse.y" { conf.del_big = 1; } break; case 62: #line 558 "parse.y" { conf.allow_many = 1; } break; case 63: #line 563 "parse.y" { conf.def_user = yyvsp[0].uid; } break; case 64: #line 568 "parse.y" { xfree(conf.strip_chars); conf.strip_chars = yyvsp[0].string; } break; case 65: #line 574 "parse.y" { if (yyvsp[0].number == 0) yyerror("zero timeout"); if (yyvsp[0].number > INT_MAX / 1000) yyerror("timeout too long: %lld", yyvsp[0].number); conf.timeout = yyvsp[0].number * 1000; } break; case 66: #line 583 "parse.y" { if (yyvsp[0].number == 0) yyerror("zero queue-high"); if (yyvsp[0].number > MAXQUEUEVALUE) yyerror("queue-high too big: %lld", yyvsp[0].number); if (conf.queue_low != -1 && yyvsp[0].number <= conf.queue_low) yyerror("queue-high must be larger than queue-low"); conf.queue_high = yyvsp[0].number; } break; case 67: #line 594 "parse.y" { if (yyvsp[0].number > MAXQUEUEVALUE) yyerror("queue-low too big: %lld", yyvsp[0].number); if (conf.queue_high == -1) yyerror("queue-high not specified"); if (yyvsp[0].number >= conf.queue_high) yyerror("queue-low must be smaller than queue-high"); conf.queue_low = yyvsp[0].number; } break; case 68: #line 605 "parse.y" { u_int i; if (conf.domains != NULL) { for (i = 0; i < ARRAY_LENGTH(conf.domains); i++) xfree(ARRAY_ITEM(conf.domains, i)); ARRAY_FREE(conf.domains); xfree(conf.domains); } conf.domains = yyvsp[0].strings; } break; case 69: #line 619 "parse.y" { u_int i; if (conf.headers != NULL) { for (i = 0; i < ARRAY_LENGTH(conf.headers); i++) xfree(ARRAY_ITEM(conf.headers, i)); ARRAY_FREE(conf.headers); xfree(conf.headers); } conf.headers = yyvsp[0].strings; } break; case 70: #line 633 "parse.y" { if (conf.proxy != NULL) { xfree(conf.proxy->server.host); xfree(conf.proxy->server.port); if (conf.proxy->user != NULL) xfree(conf.proxy->user); if (conf.proxy->pass != NULL) xfree(conf.proxy->pass); } if ((conf.proxy = getproxy(yyvsp[0].string)) == NULL) yyerror("invalid proxy"); xfree(yyvsp[0].string); } break; case 71: #line 647 "parse.y" { conf.verify_certs = 1; } break; case 72: #line 651 "parse.y" { conf.impl_act = DECISION_KEEP; } break; case 73: #line 655 "parse.y" { conf.impl_act = DECISION_DROP; } break; case 74: #line 660 "parse.y" { if (yyvsp[0].number == 0) yyerror("invalid purge-after value: 0"); if (yyvsp[0].number > UINT_MAX) yyerror("purge-after value too large: %lld", yyvsp[0].number); conf.purge_after = yyvsp[0].number; } break; case 75: #line 669 "parse.y" { conf.purge_after = 0; } break; case 76: #line 673 "parse.y" { conf.no_received = 1; } break; case 77: #line 677 "parse.y" { conf.file_group = -1; } break; case 78: #line 682 "parse.y" { conf.file_group = yyvsp[0].gid; } break; case 79: #line 686 "parse.y" { conf.file_umask = umask(0); umask(conf.file_umask); } break; case 80: #line 692 "parse.y" { char s[8]; u_int n; /* * We can't differentiate umasks in octal from normal numbers * (requiring a leading zero a la C would be nice, but it would * potentially break existing configs), so we need to fiddle to * convert. */ memset(s, 0, sizeof s); xsnprintf(s, sizeof s, "%03lld", yyvsp[0].number); if (s[3] != '\0' || s[0] < '0' || s[0] > '7' || s[1] < 0 || s[1] > '7' || s[2] < '0' || s[2] > '7') yyerror("invalid umask: %s", s); if (sscanf(s, "%o", &n) != 1) yyerror("invalid umask: %s", s); conf.file_umask = n; } break; case 81: #line 715 "parse.y" { struct macro *macro; if (strlen(yyvsp[-2].string) > MAXNAMESIZE) yyerror("macro name too long: %s", yyvsp[-2].string); macro = xmalloc(sizeof *macro); strlcpy(macro->name, yyvsp[-2].string, sizeof macro->name); macro->type = MACRO_STRING; macro->value.str = yyvsp[0].string; if (parse_last == NULL) TAILQ_INSERT_HEAD(&parse_macros, macro, entry); else { TAILQ_INSERT_AFTER( &parse_macros, parse_last, macro, entry); } log_debug3("added macro \"%s\": \"%s\"", macro->name, macro->value.str); xfree(yyvsp[-2].string); } break; case 82: #line 739 "parse.y" { struct macro *macro; if (strlen(yyvsp[-2].string) > MAXNAMESIZE) yyerror("macro name too long: %s", yyvsp[-2].string); macro = xmalloc(sizeof *macro); strlcpy(macro->name, yyvsp[-2].string, sizeof macro->name); macro->type = MACRO_NUMBER; macro->value.num = yyvsp[0].number; if (parse_last == NULL) TAILQ_INSERT_HEAD(&parse_macros, macro, entry); else { TAILQ_INSERT_AFTER( &parse_macros, parse_last, macro, entry); } log_debug3("added macro \"%s\": %lld", macro->name, macro->value.num); xfree(yyvsp[-2].string); } break; case 83: #line 765 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("empty string in list"); yyval.replstrs = yyvsp[-1].replstrs; ARRAY_EXPAND(yyval.replstrs, 1); ARRAY_LAST(yyval.replstrs).str = yyvsp[0].string; } break; case 84: #line 775 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("empty string in list"); yyval.replstrs = xmalloc(sizeof *yyval.replstrs); ARRAY_INIT(yyval.replstrs); ARRAY_EXPAND(yyval.replstrs, 1); ARRAY_LAST(yyval.replstrs).str = yyvsp[0].string; } break; case 85: #line 788 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("empty string in list"); yyval.strings = yyvsp[-1].strings; ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 86: #line 797 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("empty string in list"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 87: #line 809 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.strings = yyvsp[-1].strings; ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 88: #line 818 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 89: #line 830 "parse.y" { yyval.users = yyvsp[-1].users; ARRAY_ADD(yyval.users.users, yyvsp[0].uid); } break; case 90: #line 836 "parse.y" { yyval.users.users = xmalloc(sizeof *yyval.users.users); ARRAY_INIT(yyval.users.users); ARRAY_ADD(yyval.users.users, yyvsp[0].uid); } break; case 91: #line 845 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid domain"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 92: #line 855 "parse.y" { yyval.strings = yyvsp[-1].strings; } break; case 93: #line 862 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid header"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 94: #line 872 "parse.y" { yyval.strings = yyvsp[-1].strings; } break; case 95: #line 879 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid header"); yyval.replstrs = xmalloc(sizeof *yyval.replstrs); ARRAY_INIT(yyval.replstrs); ARRAY_EXPAND(yyval.replstrs, 1); ARRAY_LAST(yyval.replstrs).str = yyvsp[0].string; } break; case 96: #line 890 "parse.y" { yyval.replstrs = yyvsp[-1].replstrs; } break; case 97: #line 897 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 98: #line 907 "parse.y" { yyval.strings = yyvsp[-1].strings; } break; case 99: #line 914 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 100: #line 924 "parse.y" { yyval.strings = yyvsp[-1].strings; } break; case 101: #line 930 "parse.y" { yyval.locks = LOCK_FCNTL; } break; case 102: #line 934 "parse.y" { yyval.locks = LOCK_FLOCK; } break; case 103: #line 938 "parse.y" { yyval.locks = LOCK_DOTLOCK; } break; case 104: #line 945 "parse.y" { yyval.locks = yyvsp[-1].locks | yyvsp[0].locks; } break; case 105: #line 950 "parse.y" { yyval.locks = yyvsp[0].locks; } break; case 106: #line 954 "parse.y" { yyval.locks = 0; } break; case 107: #line 961 "parse.y" { struct passwd *pw; if (*yyvsp[0].string == '\0') yyerror("invalid user"); pw = getpwnam(yyvsp[0].string); if (pw == NULL) yyerror("unknown user: %s", yyvsp[0].string); yyval.uid = pw->pw_uid; endpwent(); xfree(yyvsp[0].string); } break; case 108: #line 977 "parse.y" { struct passwd *pw; if (yyvsp[0].number > UID_MAX) yyerror("invalid uid: %llu", yyvsp[0].number); pw = getpwuid(yyvsp[0].number); if (pw == NULL) yyerror("unknown uid: %llu", yyvsp[0].number); yyval.uid = pw->pw_uid; endpwent(); } break; case 109: #line 992 "parse.y" { struct group *gr; if (*yyvsp[0].string == '\0') yyerror("invalid group"); gr = getgrnam(yyvsp[0].string); if (gr == NULL) yyerror("unknown group: %s", yyvsp[0].string); yyval.gid = gr->gr_gid; endgrent(); xfree(yyvsp[0].string); } break; case 110: #line 1008 "parse.y" { struct group *gr; if (yyvsp[0].number > GID_MAX) yyerror("invalid gid: %llu", yyvsp[0].number); gr = getgrgid(yyvsp[0].number); if (gr == NULL) yyerror("unknown gid: %llu", yyvsp[0].number); yyval.gid = gr->gr_gid; endgrent(); } break; case 111: #line 1022 "parse.y" { yyval.uid = -1; } break; case 112: #line 1027 "parse.y" { yyval.uid = yyvsp[0].uid; } break; case 113: #line 1034 "parse.y" { yyval.users.users = NULL; yyval.users.find_uid = 0; } break; case 114: #line 1039 "parse.y" { yyval.users.users = NULL; yyval.users.find_uid = 1; } break; case 115: #line 1045 "parse.y" { yyval.users.users = xmalloc(sizeof *yyval.users.users); ARRAY_INIT(yyval.users.users); ARRAY_ADD(yyval.users.users, yyvsp[0].uid); yyval.users.find_uid = 0; } break; case 116: #line 1053 "parse.y" { yyval.users = yyvsp[-1].users; yyval.users.users = yyval.users.users; yyval.users.find_uid = 0; } break; case 117: #line 1062 "parse.y" { /* match case */ yyval.re.flags = 0; yyval.re.str = yyvsp[0].string; } break; case 118: #line 1069 "parse.y" { /* ignore case */ yyval.re.flags = RE_IGNCASE; yyval.re.str = yyvsp[0].string; } break; case 119: #line 1077 "parse.y" { yyval.flag = 1; } break; case 120: #line 1081 "parse.y" { yyval.flag = 0; } break; case 121: #line 1087 "parse.y" { yyval.flag = 1; } break; case 122: #line 1091 "parse.y" { yyval.flag = 0; } break; case 123: #line 1097 "parse.y" { yyval.flag = 1; } break; case 124: #line 1101 "parse.y" { yyval.flag = 0; } break; case 125: #line 1108 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid port"); yyval.string = yyvsp[0].string; } break; case 126: #line 1116 "parse.y" { if (yyvsp[0].number == 0 || yyvsp[0].number > 65535) yyerror("invalid port"); xasprintf(&yyval.string, "%lld", yyvsp[0].number); } break; case 127: #line 1126 "parse.y" { if (*yyvsp[-1].string == '\0') yyerror("invalid host"); yyval.server.host = yyvsp[-1].string; yyval.server.port = yyvsp[0].string; } break; case 128: #line 1135 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid host"); yyval.server.host = yyvsp[0].string; yyval.server.port = NULL; } break; case 129: #line 1145 "parse.y" { yyval.string = NULL; } break; case 130: #line 1150 "parse.y" { yyval.string = yyvsp[0].string; } break; case 131: #line 1156 "parse.y" { yyval.flag = 1; } break; case 132: #line 1160 "parse.y" { yyval.flag = 0; } break; case 133: #line 1167 "parse.y" { struct deliver_pipe_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid command"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_pipe; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->pipe = yyvsp[-1].flag; data->cmd.str = yyvsp[0].string; } break; case 134: #line 1184 "parse.y" { struct deliver_rewrite_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid command"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_rewrite; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->cmd.str = yyvsp[0].string; } break; case 135: #line 1200 "parse.y" { struct deliver_write_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_write; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->append = yyvsp[-1].flag; data->path.str = yyvsp[0].string; } break; case 136: #line 1217 "parse.y" { struct deliver_maildir_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid path"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_maildir; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->path.str = yyvsp[0].string; } break; case 137: #line 1233 "parse.y" { struct deliver_remove_header_data *data; yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_remove_header; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->hdrs = yyvsp[0].replstrs; } break; case 138: #line 1246 "parse.y" { struct deliver_add_header_data *data; if (*yyvsp[-1].string == '\0') yyerror("invalid header"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_add_header; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->hdr.str = yyvsp[-1].string; data->value.str = yyvsp[0].string; } break; case 139: #line 1263 "parse.y" { struct deliver_mbox_data *data; if (*yyvsp[-1].string == '\0') yyerror("invalid path"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_mbox; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->path.str = yyvsp[-1].string; data->compress = yyvsp[0].flag; } break; case 140: #line 1280 "parse.y" { struct deliver_smtp_data *data; yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_smtp; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->server.host = yyvsp[-1].server.host; if (yyvsp[-1].server.port != NULL) data->server.port = yyvsp[-1].server.port; else data->server.port = xstrdup("smtp"); data->server.ai = NULL; data->to.str = yyvsp[0].string; } break; case 141: #line 1298 "parse.y" { yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_stdout; } break; case 142: #line 1304 "parse.y" { struct deliver_tag_data *data; if (*yyvsp[-1].string == '\0') yyerror("invalid tag"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_tag; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->key.str = yyvsp[-1].string; data->value.str = yyvsp[0].string; } break; case 143: #line 1321 "parse.y" { struct deliver_to_cache_data *data; if (*yyvsp[-2].string == '\0') yyerror("invalid path"); if (*yyvsp[0].string == '\0') yyerror("invalid key"); yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_to_cache; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->key.str = yyvsp[0].string; data->path = yyvsp[-2].string; } break; case 144: #line 1340 "parse.y" { struct deliver_action_data *data; /* * This is a special-case, handled when the list of delivery * targets is resolved rather than by calling a deliver * function, so the deliver pointer is NULL. */ yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = NULL; data = xcalloc(1, sizeof *data); yyval.actitem->data = data; data->actions = yyvsp[0].replstrs; } break; case 145: #line 1357 "parse.y" { yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_drop; } break; case 146: #line 1362 "parse.y" { yyval.actitem = xcalloc(1, sizeof *yyval.actitem); yyval.actitem->deliver = &deliver_keep; } break; case 147: #line 1370 "parse.y" { yyval.actlist = yyvsp[-1].actlist; TAILQ_INSERT_TAIL(yyval.actlist, yyvsp[0].actitem, entry); yyvsp[0].actitem->idx = parse_actionidx++; } break; case 148: #line 1378 "parse.y" { yyval.actlist = xmalloc(sizeof *yyval.actlist); TAILQ_INIT(yyval.actlist); TAILQ_INSERT_HEAD(yyval.actlist, yyvsp[0].actitem, entry); yyvsp[0].actitem->idx = 0; parse_actionidx = 1; } break; case 149: #line 1392 "parse.y" { struct action *t; if (strlen(yyvsp[-2].string) >= MAXNAMESIZE) yyerror("action name too long: %s", yyvsp[-2].string); if (*yyvsp[-2].string == '\0') yyerror("invalid action name"); if (find_action(yyvsp[-2].string) != NULL) yyerror("duplicate action: %s", yyvsp[-2].string); t = xmalloc(sizeof *t); strlcpy(t->name, yyvsp[-2].string, sizeof t->name); t->list = xmalloc(sizeof *t->list); TAILQ_INIT(t->list); TAILQ_INSERT_HEAD(t->list, yyvsp[0].actitem, entry); yyvsp[0].actitem->idx = 0; t->users = yyvsp[-1].users.users; t->find_uid = yyvsp[-1].users.find_uid; TAILQ_INSERT_TAIL(&conf.actions, t, entry); print_action(t); xfree(yyvsp[-2].string); } break; case 150: #line 1421 "parse.y" { struct action *t; if (strlen(yyvsp[-4].string) >= MAXNAMESIZE) yyerror("action name too long: %s", yyvsp[-4].string); if (*yyvsp[-4].string == '\0') yyerror("invalid action name"); if (find_action(yyvsp[-4].string) != NULL) yyerror("duplicate action: %s", yyvsp[-4].string); t = xmalloc(sizeof *t); strlcpy(t->name, yyvsp[-4].string, sizeof t->name); t->list = yyvsp[-1].actlist; t->users = yyvsp[-3].users.users; t->find_uid = yyvsp[-3].users.find_uid; TAILQ_INSERT_TAIL(&conf.actions, t, entry); print_action(t); xfree(yyvsp[-4].string); } break; case 151: #line 1447 "parse.y" { yyval.replstrs = NULL; } break; case 152: #line 1452 "parse.y" { yyval.replstrs = yyvsp[0].replstrs; } break; case 153: #line 1459 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid account name"); if (!have_accounts(yyvsp[0].string)) yyerror("no matching accounts: %s", yyvsp[0].string); yyval.replstrs = xmalloc(sizeof *yyval.replstrs); ARRAY_INIT(yyval.replstrs); ARRAY_EXPAND(yyval.replstrs, 1); ARRAY_LAST(yyval.replstrs).str = yyvsp[0].string; } break; case 154: #line 1472 "parse.y" { yyval.replstrs = yyvsp[-1].replstrs; } break; case 155: #line 1479 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid action name"); yyval.replstrs = xmalloc(sizeof *yyval.replstrs); ARRAY_INIT(yyval.replstrs); ARRAY_EXPAND(yyval.replstrs, 1); ARRAY_LAST(yyval.replstrs).str = yyvsp[0].string; } break; case 156: #line 1490 "parse.y" { yyval.replstrs = yyvsp[-1].replstrs; } break; case 157: #line 1496 "parse.y" { yyval.flag = 0; } break; case 158: #line 1500 "parse.y" { yyval.flag = 1; } break; case 159: #line 1506 "parse.y" { yyval.area = AREA_ANY; } break; case 160: #line 1510 "parse.y" { yyval.area = AREA_ANY; } break; case 161: #line 1514 "parse.y" { yyval.area = AREA_HEADERS; } break; case 162: #line 1518 "parse.y" { yyval.area = AREA_BODY; } break; case 163: #line 1525 "parse.y" { if (yyvsp[0].number < 0 || yyvsp[0].number > 255) yyerror("invalid return code"); yyval.number = yyvsp[0].number; } break; case 164: #line 1532 "parse.y" { yyval.number = -1; } break; case 165: #line 1539 "parse.y" { yyval.re = yyvsp[0].re; } break; case 166: #line 1543 "parse.y" { yyval.re.str = NULL; } break; case 167: #line 1549 "parse.y" { yyval.cmp = CMP_LT; } break; case 168: #line 1553 "parse.y" { yyval.cmp = CMP_GT; } break; case 169: #line 1559 "parse.y" { yyval.cmp = CMP_EQ; } break; case 170: #line 1563 "parse.y" { yyval.cmp = CMP_NE; } break; case 171: #line 1570 "parse.y" { yyval.cmp = yyvsp[0].cmp; } break; case 172: #line 1575 "parse.y" { yyval.cmp = yyvsp[0].cmp; } break; case 173: #line 1581 "parse.y" { yyval.flag = 0; } break; case 174: #line 1585 "parse.y" { yyval.flag = 1; } break; case 175: #line 1591 "parse.y" { yyval.flag = 0; } break; case 176: #line 1595 "parse.y" { yyval.flag = 1; } break; case 177: #line 1601 "parse.y" { yyval.exprop = OP_AND; } break; case 178: #line 1605 "parse.y" { yyval.exprop = OP_OR; } break; case 179: #line 1612 "parse.y" { yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_all; yyval.expritem->inverted = yyvsp[-1].flag; } break; case 180: #line 1620 "parse.y" { struct match_regexp_data *data; char *cause; yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_regexp; yyval.expritem->inverted = yyvsp[-2].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->area = yyvsp[0].area; if (re_compile(&data->re, yyvsp[-1].re.str, yyvsp[-1].re.flags, &cause) != 0) yyerror("%s", cause); xfree(yyvsp[-1].re.str); } break; case 181: #line 1639 "parse.y" { struct match_account_data *data; yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_account; yyval.expritem->inverted = yyvsp[-1].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->accounts = yyvsp[0].replstrs; } break; case 182: #line 1655 "parse.y" { struct match_command_data *data; char *cause; if (*yyvsp[-7].string == '\0' || (yyvsp[-7].string[0] == '|' && yyvsp[-7].string[1] == '\0')) yyerror("invalid command"); if (yyvsp[-3].number == -1 && yyvsp[-1].re.str == NULL) yyerror("return code or regexp must be specified"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_command; yyval.expritem->inverted = yyvsp[-9].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->uid = yyvsp[-6].uid; data->pipe = yyvsp[-8].flag; data->cmd.str = yyvsp[-7].string; data->ret = yyvsp[-3].number; if (yyvsp[-1].re.str != NULL) { if (re_compile( &data->re, yyvsp[-1].re.str, yyvsp[-1].re.flags, &cause) != 0) yyerror("%s", cause); xfree(yyvsp[-1].re.str); } } break; case 183: #line 1687 "parse.y" { struct match_tagged_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid tag"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_tagged; yyval.expritem->inverted = yyvsp[-2].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->tag.str = yyvsp[0].string; } break; case 184: #line 1705 "parse.y" { struct match_size_data *data; #if SIZE_MAX < LLONG_MAX if (yyvsp[0].number > SIZE_MAX) yyerror("size too large"); #endif yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_size; yyval.expritem->inverted = yyvsp[-3].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->size = yyvsp[0].number; data->cmp = yyvsp[-1].cmp; } break; case 185: #line 1727 "parse.y" { struct match_string_data *data; char *cause; if (*yyvsp[-2].string == '\0') yyerror("invalid string"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_string; yyval.expritem->inverted = yyvsp[-4].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->str.str = yyvsp[-2].string; if (re_compile( &data->re, yyvsp[0].re.str, yyvsp[0].re.flags|RE_NOSUBST, &cause) != 0) yyerror("%s", cause); xfree(yyvsp[0].re.str); } break; case 186: #line 1750 "parse.y" { struct match_in_cache_data *data; if (*yyvsp[-2].string == '\0') yyerror("invalid path"); if (*yyvsp[0].string == '\0') yyerror("invalid key"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_in_cache; yyval.expritem->inverted = yyvsp[-4].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->key.str = yyvsp[0].string; data->path = yyvsp[-2].string; } break; case 187: #line 1771 "parse.y" { yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_matched; yyval.expritem->inverted = yyvsp[-1].flag; } break; case 188: #line 1779 "parse.y" { yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_unmatched; yyval.expritem->inverted = yyvsp[-1].flag; } break; case 189: #line 1787 "parse.y" { struct match_age_data *data; if (yyvsp[0].number == 0) yyerror("invalid time"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_age; yyval.expritem->inverted = yyvsp[-3].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->time = yyvsp[0].number; data->cmp = yyvsp[-1].cmp; } break; case 190: #line 1806 "parse.y" { struct match_age_data *data; yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_age; yyval.expritem->inverted = yyvsp[-2].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->time = -1; } break; case 191: #line 1821 "parse.y" { struct match_attachment_data *data; yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_attachment; yyval.expritem->inverted = yyvsp[-4].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->op = ATTACHOP_COUNT; data->cmp = yyvsp[-1].cmp; data->value.num = yyvsp[0].number; } break; case 192: #line 1838 "parse.y" { struct match_attachment_data *data; #if SIZE_MAX < LLONG_MAX if (yyvsp[0].number > SIZE_MAX) yyerror("size too large"); #endif yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_attachment; yyval.expritem->inverted = yyvsp[-4].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->op = ATTACHOP_TOTALSIZE; data->cmp = yyvsp[-1].cmp; data->value.size = yyvsp[0].number; } break; case 193: #line 1860 "parse.y" { struct match_attachment_data *data; #if SIZE_MAX < LLONG_MAX if (yyvsp[0].number > SIZE_MAX) yyerror("size too large"); #endif yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_attachment; yyval.expritem->inverted = yyvsp[-4].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->op = ATTACHOP_ANYSIZE; data->cmp = yyvsp[-1].cmp; data->value.size = yyvsp[0].number; } break; case 194: #line 1882 "parse.y" { struct match_attachment_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid string"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_attachment; yyval.expritem->inverted = yyvsp[-3].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->op = ATTACHOP_ANYTYPE; data->value.str.str = yyvsp[0].string; } break; case 195: #line 1901 "parse.y" { struct match_attachment_data *data; if (*yyvsp[0].string == '\0') yyerror("invalid string"); yyval.expritem = xcalloc(1, sizeof *yyval.expritem); yyval.expritem->match = &match_attachment; yyval.expritem->inverted = yyvsp[-3].flag; data = xcalloc(1, sizeof *data); yyval.expritem->data = data; data->op = ATTACHOP_ANYNAME; data->value.str.str = yyvsp[0].string; } break; case 196: #line 1923 "parse.y" { yyval.expr = yyvsp[-2].expr; yyvsp[0].expritem->op = yyvsp[-1].exprop; TAILQ_INSERT_TAIL(yyval.expr, yyvsp[0].expritem, entry); } break; case 197: #line 1931 "parse.y" { yyval.expr = xmalloc(sizeof *yyval.expr); TAILQ_INIT(yyval.expr); yyvsp[0].expritem->op = yyvsp[-1].exprop; TAILQ_INSERT_HEAD(yyval.expr, yyvsp[0].expritem, entry); } break; case 198: #line 1942 "parse.y" { yyval.expr = xmalloc(sizeof *yyval.expr); TAILQ_INIT(yyval.expr); TAILQ_INSERT_HEAD(yyval.expr, yyvsp[0].expritem, entry); } break; case 199: #line 1950 "parse.y" { yyval.expr = yyvsp[0].expr; TAILQ_INSERT_HEAD(yyval.expr, yyvsp[-1].expritem, entry); } break; case 200: #line 1960 "parse.y" { struct action *t; yyval.rule = xcalloc(1, sizeof *yyval.rule); yyval.rule->idx = parse_ruleidx++; yyval.rule->actions = NULL; TAILQ_INIT(&yyval.rule->rules); yyval.rule->stop = !yyvsp[0].flag; yyval.rule->users = yyvsp[-3].users.users; yyval.rule->find_uid = yyvsp[-3].users.find_uid; t = yyval.rule->lambda = xcalloc(1, sizeof *yyval.rule->lambda); xsnprintf(t->name, sizeof t->name, "", yyval.rule->idx); t->users = NULL; t->find_uid = 0; t->list = xmalloc(sizeof *t->list); TAILQ_INIT(t->list); TAILQ_INSERT_HEAD(t->list, yyvsp[-1].actitem, entry); yyvsp[-1].actitem->idx = 0; if (parse_rule == NULL) TAILQ_INSERT_TAIL(&conf.rules, yyval.rule, entry); else TAILQ_INSERT_TAIL(&parse_rule->rules, yyval.rule, entry); } break; case 201: #line 1988 "parse.y" { struct action *t; yyval.rule = xcalloc(1, sizeof *yyval.rule); yyval.rule->idx = parse_ruleidx++; yyval.rule->actions = NULL; TAILQ_INIT(&yyval.rule->rules); yyval.rule->stop = !yyvsp[0].flag; yyval.rule->users = yyvsp[-5].users.users; yyval.rule->find_uid = yyvsp[-5].users.find_uid; t = yyval.rule->lambda = xcalloc(1, sizeof *yyval.rule->lambda); xsnprintf(t->name, sizeof t->name, "", yyval.rule->idx); t->users = NULL; t->find_uid = 0; t->list = yyvsp[-2].actlist; if (parse_rule == NULL) TAILQ_INSERT_TAIL(&conf.rules, yyval.rule, entry); else TAILQ_INSERT_TAIL(&parse_rule->rules, yyval.rule, entry); } break; case 202: #line 2013 "parse.y" { yyval.rule = xcalloc(1, sizeof *yyval.rule); yyval.rule->idx = parse_ruleidx++; yyval.rule->lambda = NULL; yyval.rule->actions = yyvsp[-1].replstrs; TAILQ_INIT(&yyval.rule->rules); yyval.rule->stop = !yyvsp[0].flag; yyval.rule->users = yyvsp[-2].users.users; yyval.rule->find_uid = yyvsp[-2].users.find_uid; if (parse_rule == NULL) TAILQ_INSERT_TAIL(&conf.rules, yyval.rule, entry); else TAILQ_INSERT_TAIL(&parse_rule->rules, yyval.rule, entry); } break; case 203: #line 2029 "parse.y" { yyval.rule = xcalloc(1, sizeof *yyval.rule); yyval.rule->idx = parse_ruleidx++; yyval.rule->lambda = NULL; yyval.rule->actions = NULL; TAILQ_INIT(&yyval.rule->rules); yyval.rule->stop = 0; yyval.rule->users = NULL; yyval.rule->find_uid = 0; if (parse_rule == NULL) TAILQ_INSERT_TAIL(&conf.rules, yyval.rule, entry); else TAILQ_INSERT_TAIL(&parse_rule->rules, yyval.rule, entry); ARRAY_ADD(&parse_rulestack, parse_rule); parse_rule = yyval.rule; } break; case 204: #line 2050 "parse.y" { if (parse_rule == NULL) yyerror("missing {"); parse_rule = ARRAY_LAST(&parse_rulestack); ARRAY_TRUNC(&parse_rulestack, 1); } break; case 205: #line 2062 "parse.y" { struct expritem *ei; struct match_account_data *data; yyvsp[0].rule->expr = yyvsp[-2].expr; /* Prepend an accounts rule to the expression. */ if (yyvsp[-1].replstrs != NULL) { yywarn("match ... accounts ... is deprecated"); yywarn("please use the 'accounts' match condition"); if (yyvsp[0].rule->expr == NULL) { yyvsp[0].rule->expr = xmalloc(sizeof *yyvsp[0].rule->expr); TAILQ_INIT(yyvsp[0].rule->expr); } else TAILQ_FIRST(yyvsp[0].rule->expr)->op = OP_AND; ei = xcalloc(1, sizeof *ei); ei->match = &match_account; ei->op = OP_NONE; TAILQ_INSERT_HEAD(yyvsp[0].rule->expr, ei, entry); data = xcalloc(1, sizeof *data); ei->data = data; data->accounts = yyvsp[-1].replstrs; } print_rule(yyvsp[0].rule); } break; case 206: #line 2095 "parse.y" { yyval.string = NULL; } break; case 207: #line 2100 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid folder"); yyval.string = yyvsp[0].string; } break; case 208: #line 2110 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid group"); yyval.strings = xmalloc(sizeof *yyval.strings); ARRAY_INIT(yyval.strings); ARRAY_ADD(yyval.strings, yyvsp[0].string); } break; case 209: #line 2120 "parse.y" { yyval.strings = yyvsp[-1].strings; } break; case 210: #line 2126 "parse.y" { yyval.flag = 0; } break; case 211: #line 2130 "parse.y" { yyval.flag = 1; } break; case 212: #line 2136 "parse.y" { yyval.flag = 0; } break; case 213: #line 2140 "parse.y" { yyval.flag = 1; } break; case 214: #line 2146 "parse.y" { yyval.only = FETCH_ONLY_NEW; } break; case 215: #line 2150 "parse.y" { yyval.only = FETCH_ONLY_OLD; } break; case 216: #line 2156 "parse.y" { yyval.flag = 0; } break; case 217: #line 2160 "parse.y" { yyval.flag = 1; } break; case 218: #line 2166 "parse.y" { yyval.flag = 0; } break; case 219: #line 2170 "parse.y" { yyval.flag = 1; } break; case 220: #line 2176 "parse.y" { yyval.flag = 0; } break; case 221: #line 2180 "parse.y" { yyval.flag = 1; } break; case 222: #line 2187 "parse.y" { if (*yyvsp[-2].string == '\0') yyerror("invalid user"); if (*yyvsp[0].string == '\0') yyerror("invalid pass"); yyval.userpass.user = yyvsp[-2].string; yyval.userpass.user_netrc = 0; yyval.userpass.pass = yyvsp[0].string; yyval.userpass.pass_netrc = 0; } break; case 223: #line 2199 "parse.y" { yyval.userpass.user = NULL; yyval.userpass.user_netrc = 1; yyval.userpass.pass = NULL; yyval.userpass.pass_netrc = 1; } break; case 224: #line 2207 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid user"); yyval.userpass.user = yyvsp[0].string; yyval.userpass.user_netrc = 0; yyval.userpass.pass = NULL; yyval.userpass.pass_netrc = 1; } break; case 225: #line 2218 "parse.y" { if (*yyvsp[0].string == '\0') yyerror("invalid pass"); yyval.userpass.user = NULL; yyval.userpass.user_netrc = 1; yyval.userpass.pass = yyvsp[0].string; yyval.userpass.pass_netrc = 0; } break; case 226: #line 2231 "parse.y" { if (*yyvsp[-2].string == '\0') yyerror("invalid user"); if (*yyvsp[0].string == '\0') yyerror("invalid pass"); yyval.userpass.user = yyvsp[-2].string; yyval.userpass.user_netrc = 0; yyval.userpass.pass = yyvsp[0].string; yyval.userpass.pass_netrc = 0; } break; case 227: #line 2246 "parse.y" { yyval.userpass.user = yyvsp[0].userpass.user; yyval.userpass.user_netrc = yyvsp[0].userpass.user_netrc; yyval.userpass.pass = yyvsp[0].userpass.pass; yyval.userpass.pass_netrc = yyvsp[0].userpass.pass_netrc; } break; case 228: #line 2253 "parse.y" { yyval.userpass.user = NULL; yyval.userpass.user_netrc = 0; yyval.userpass.pass = NULL; yyval.userpass.pass_netrc = 0; } break; case 229: #line 2263 "parse.y" { yyval.poponly.path = yyvsp[0].string; yyval.poponly.only = yyvsp[-2].only; } break; case 230: #line 2268 "parse.y" { yyval.poponly.path = NULL; yyval.poponly.only = FETCH_ONLY_ALL; } break; case 231: #line 2276 "parse.y" { yyval.only = yyvsp[0].only; } break; case 232: #line 2280 "parse.y" { yyval.only = FETCH_ONLY_ALL; } break; case 233: #line 2289 "parse.y" { struct fetch_pop3_data *data; yyval.fetch.fetch = &fetch_pop3; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; if (yyvsp[-3].userpass.user_netrc && yyvsp[-3].userpass.pass_netrc) find_netrc(yyvsp[-4].server.host, &data->user, &data->pass); else { if (yyvsp[-3].userpass.user_netrc) find_netrc(yyvsp[-4].server.host, &data->user, NULL); else data->user = yyvsp[-3].userpass.user; if (yyvsp[-3].userpass.pass_netrc) find_netrc(yyvsp[-4].server.host, NULL, &data->pass); else data->pass = yyvsp[-3].userpass.pass; } data->server.ssl = yyvsp[-5].flag; data->server.verify = yyvsp[0].flag; data->server.host = yyvsp[-4].server.host; if (yyvsp[-4].server.port != NULL) data->server.port = yyvsp[-4].server.port; else if (yyvsp[-5].flag) data->server.port = xstrdup("pop3s"); else data->server.port = xstrdup("pop3"); data->server.ai = NULL; data->apop = yyvsp[-1].flag; data->path = yyvsp[-2].poponly.path; data->only = yyvsp[-2].poponly.only; } break; case 234: #line 2328 "parse.y" { struct fetch_pop3_data *data; yyval.fetch.fetch = &fetch_pop3pipe; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; data->user = yyvsp[-2].userpass.user; data->pass = yyvsp[-2].userpass.pass; data->pipecmd = yyvsp[-3].string; if (data->pipecmd == NULL || *data->pipecmd == '\0') yyerror("invalid pipe command"); data->apop = yyvsp[0].flag; data->path = yyvsp[-1].poponly.path; data->only = yyvsp[-1].poponly.only; } break; case 235: #line 2347 "parse.y" { struct fetch_imap_data *data; if (yyvsp[-2].string != NULL && *yyvsp[-2].string == '\0') yyerror("invalid folder"); yyval.fetch.fetch = &fetch_imap; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; if (yyvsp[-3].userpass.user_netrc && yyvsp[-3].userpass.pass_netrc) find_netrc(yyvsp[-4].server.host, &data->user, &data->pass); else { if (yyvsp[-3].userpass.user_netrc) find_netrc(yyvsp[-4].server.host, &data->user, NULL); else data->user = yyvsp[-3].userpass.user; if (yyvsp[-3].userpass.pass_netrc) find_netrc(yyvsp[-4].server.host, NULL, &data->pass); else data->pass = yyvsp[-3].userpass.pass; } data->folder = yyvsp[-2].string == NULL ? xstrdup("INBOX") : yyvsp[-2].string; data->server.ssl = yyvsp[-5].flag; data->server.verify = yyvsp[0].flag; data->server.host = yyvsp[-4].server.host; if (yyvsp[-4].server.port != NULL) data->server.port = yyvsp[-4].server.port; else if (yyvsp[-5].flag) data->server.port = xstrdup("imaps"); else data->server.port = xstrdup("imap"); data->server.ai = NULL; data->only = yyvsp[-1].only; } break; case 236: #line 2387 "parse.y" { struct fetch_imap_data *data; if (yyvsp[-1].string != NULL && *yyvsp[-1].string == '\0') yyerror("invalid folder"); yyval.fetch.fetch = &fetch_imappipe; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; data->user = yyvsp[-2].userpass.user; data->pass = yyvsp[-2].userpass.pass; data->folder = yyvsp[-1].string == NULL ? xstrdup("INBOX") : yyvsp[-1].string; data->pipecmd = yyvsp[-3].string; if (data->pipecmd == NULL || *data->pipecmd == '\0') yyerror("invalid pipe command"); data->only = yyvsp[0].only; } break; case 237: #line 2405 "parse.y" { yyval.fetch.fetch = &fetch_stdin; } break; case 238: #line 2410 "parse.y" { struct fetch_maildir_data *data; yyval.fetch.fetch = &fetch_maildir; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; data->maildirs = yyvsp[0].strings; } break; case 239: #line 2420 "parse.y" { struct fetch_mbox_data *data; yyval.fetch.fetch = &fetch_mbox; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; data->mboxes = yyvsp[0].strings; } break; case 240: #line 2432 "parse.y" { struct fetch_nntp_data *data; char *group; if (*yyvsp[-1].string == '\0') yyerror("invalid cache"); yyval.fetch.fetch = &fetch_nntp; data = xcalloc(1, sizeof *data); yyval.fetch.data = data; data->names = yyvsp[-3].strings; if (ARRAY_LENGTH(yyvsp[-3].strings) == 1) group = ARRAY_FIRST(yyvsp[-3].strings); else group = NULL; data->path = yyvsp[-1].string; if (data->path == NULL || *data->path == '\0') yyerror("invalid cache"); data->server.ssl = yyvsp[-5].flag; data->server.verify = yyvsp[0].flag; data->server.host = yyvsp[-4].server.host; if (yyvsp[-4].server.port != NULL) data->server.port = yyvsp[-4].server.port; else if (yyvsp[-5].flag) data->server.port = xstrdup("nntps"); else data->server.port = xstrdup("nntp"); data->server.ai = NULL; } break; case 241: #line 2469 "parse.y" { struct account *a; char *su, desc[DESCBUFSIZE]; if (strlen(yyvsp[-4].string) >= MAXNAMESIZE) yyerror("account name too long: %s", yyvsp[-4].string); if (*yyvsp[-4].string == '\0') yyerror("invalid account name"); if (find_account(yyvsp[-4].string) != NULL) yyerror("duplicate account: %s", yyvsp[-4].string); a = xcalloc(1, sizeof *a); strlcpy(a->name, yyvsp[-4].string, sizeof a->name); a->keep = yyvsp[0].flag; a->disabled = yyvsp[-3].flag; a->users = yyvsp[-2].users.users; a->find_uid = yyvsp[-2].users.find_uid; a->fetch = yyvsp[-1].fetch.fetch; a->data = yyvsp[-1].fetch.data; TAILQ_INSERT_TAIL(&conf.accounts, a, entry); if (a->users != NULL) su = fmt_users(" users=", a->users); else su = xstrdup(""); a->fetch->desc(a, desc, sizeof desc); log_debug2("added account \"%s\":%s fetch=%s", a->name, su, desc); xfree(su); xfree(yyvsp[-4].string); } break; #line 3809 "y.tab.c" } yyssp -= yym; yystate = *yyssp; yyvsp -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yyssp = YYFINAL; *++yyvsp = yyval; if (yychar < 0) { if ((yychar = yylex()) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == 0) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yyssp, yystate); #endif if (yyssp >= yysslim && yygrowstack()) { goto yyoverflow; } *++yyssp = yystate; *++yyvsp = yyval; goto yyloop; yyoverflow: yyerror("yacc stack overflow"); yyabort: return (1); yyaccept: return (0); }