From e4beacc940d9d0146801cf64015cafcb04ab0252 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 16 Jan 2001 10:49:08 +0000 Subject: [PATCH] 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. --- acl.y | 3 ++- acl_scan.l | 1 + handleacl.c | 3 +++ petidomo.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/acl.y b/acl.y index 7c5f990..3e13b3a 100644 --- a/acl.y +++ b/acl.y @@ -45,7 +45,7 @@ struct Mail * g_MailStruct; %} %token TOK_IF TOK_EQUAL TOK_EQUAL TOK_FROM TOK_SUBJECT %token TOK_ENVELOPE TOK_HEADER TOK_BODY TOK_AND TOK_OR TOK_NOT -%token TOK_THEN TOK_MATCH TOK_STRING TOK_DROP TOK_PASS +%token TOK_THEN TOK_MATCH TOK_STRING TOK_DROP TOK_PASS TOK_APPROVE %token TOK_REDIRECT TOK_FORWARD TOK_REJECT TOK_REJECTWITH %token TOK_FILTER %left TOK_AND @@ -97,6 +97,7 @@ qualifier: TOK_FROM { $$ = TOK_FROM; } ; action: TOK_PASS { $$ = ACL_PASS; } + | TOK_APPROVE { $$ = ACL_APPROVE; } | TOK_DROP { $$ = ACL_DROP; } | TOK_REJECT { $$ = ACL_REJECT; } | TOK_REJECTWITH TOK_STRING { diff --git a/acl_scan.l b/acl_scan.l index 3237320..d9f7189 100644 --- a/acl_scan.l +++ b/acl_scan.l @@ -47,6 +47,7 @@ match(es)? return TOK_MATCH; } drop return TOK_DROP; pass return TOK_PASS; +approve return TOK_APPROVE; redirect return TOK_REDIRECT; forward return TOK_FORWARD; reject return TOK_REJECT; diff --git a/handleacl.c b/handleacl.c index a48e272..1a6a412 100644 --- a/handleacl.c +++ b/handleacl.c @@ -54,6 +54,9 @@ handleACL(struct Mail * MailStruct, const char * listname, int operation, char * break; case ACL_PASS: break; + case ACL_APPROVE: + MailStruct->Approve = MasterConfig->master_password; + break; case ACL_DROP: return 1; case ACL_REJECTWITH: diff --git a/petidomo.h b/petidomo.h index fad92ed..8cc2229 100644 --- a/petidomo.h +++ b/petidomo.h @@ -160,6 +160,7 @@ enum { ACL_DROP, ACL_PASS, + ACL_APPROVE, ACL_REDIRECT, ACL_FORWARD, ACL_REJECT,