From b0feacc0fe2d006ac4536f5069c9373beffe2cf5 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 9 Dec 2003 01:25:08 +0000 Subject: Added blacklist command; fixed a few dodgy frees (oops) --- src/dbase.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/dbase.c') diff --git a/src/dbase.c b/src/dbase.c index 43fe0b5..98a7629 100644 --- a/src/dbase.c +++ b/src/dbase.c @@ -62,9 +62,11 @@ static Domain *tail; static int no_trusted_users=0; static int no_trusted_domains=0; +static int no_blacklist=0; static char **trusted_user=NULL; static char **trusted_domain=NULL; +static RE_Expression **blacklist=NULL; static const char *reason; @@ -220,6 +222,14 @@ void DBTrustedDomain(const char *domain) } +void DBBlacklist(RE_Expression re) +{ + no_blacklist++; + blacklist=Realloc(blacklist,sizeof(RE_Expression)*no_blacklist); + blacklist[no_blacklist-1]=re; +} + + int DBBlockMessage(const POP3Message *msg) { static const char *html="text/html"; @@ -243,6 +253,15 @@ int DBBlockMessage(const POP3Message *msg) return TRUE; } + for(f=0;ffrom_domain)) + { + reason="blacklisted"; + return TRUE; + } + } + if (!(dom=GetDomain(msg->from_domain))) return FALSE; @@ -316,6 +335,11 @@ void DBClose(void) free(trusted_user); + for(f=0;fblock); for(f=0;fno_allow;f++) - free(t->allow[f]); + REFree(t->allow[f]); free(t->allow); -- cgit v1.2.3