petidomo/acl_scan.l
Peter Simons e4beacc940 Added new action keyword to the Access Control Language: approve. This
keyword will -- unlike to "pass" -- not only pass the mail, but will
also make sure that the mail passes all other authorization controls.
This means, the mail will be treated as if the Petidomo master
password had been given in the header.
2001-01-16 10:49:08 +00:00

59 lines
1.4 KiB
Plaintext

/*
$Source$
$Revision$
Copyright (C) 2000 by CyberSolutions GmbH, Germany.
This file is part of OpenPetidomo.
OpenPetidomo is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
OpenPetidomo is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*/
%{
#include <ctype.h>
#include "acl_scan.h"
%}
%%
^[ \t]*#.*$ /* ignore comments */
[ \t] /* ignore whitespace */
\n lineno++;
if return TOK_IF;
= return TOK_EQUAL;
== return TOK_EQUAL;
from return TOK_FROM;
subject return TOK_SUBJECT;
envelope return TOK_ENVELOPE;
header return TOK_HEADER;
body return TOK_BODY;
and return TOK_AND;
or return TOK_OR;
not return TOK_NOT;
then return TOK_THEN;
match(es)? return TOK_MATCH;
\"[^\"]*\" {
yytext[yyleng-1] = '\0';
yytext++;
yyleng -= 2;
return TOK_STRING;
}
drop return TOK_DROP;
pass return TOK_PASS;
approve return TOK_APPROVE;
redirect return TOK_REDIRECT;
forward return TOK_FORWARD;
reject return TOK_REJECT;
rejectwith return TOK_REJECTWITH;
filter return TOK_FILTER;
. { yylval = yytext[0]; return yylval; } /* literal */
%%