Mercurial > sm-archive
changeset 3:01268466f0dc
initial version
author | carl |
---|---|
date | Fri, 10 Mar 2006 11:00:12 -0800 |
parents | 32b57406b656 |
children | 311e331f1bab |
files | src/Makefile.am src/context.cpp src/context.h src/sm-archive.cpp |
diffstat | 4 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Makefile.am Fri Mar 10 10:47:12 2006 -0800 +++ b/src/Makefile.am Fri Mar 10 11:00:12 2006 -0800 @@ -6,7 +6,7 @@ INCLUDES= $(all_includes) # the library search path. -smarchive_LDFLAGS = $(all_libraries) /usr/lib/libresolv.a -lmilter -pthread +smarchive_LDFLAGS = $(all_libraries) -lmilter -pthread # default compile flags smarchive_CXXFLAGS = -pthread
--- a/src/context.cpp Fri Mar 10 10:47:12 2006 -0800 +++ b/src/context.cpp Fri Mar 10 11:00:12 2006 -0800 @@ -22,6 +22,7 @@ static char* context_version="$Id$"; char *token_envfrom; +char *token_include; char *token_lbrace; char *token_rbrace; char *token_rcptto; @@ -41,7 +42,7 @@ } -char *CONFIG::find(char *needle, &string_map haystack) { +char *CONFIG::find(char *needle, string_map &haystack) { string_map::iterator i = haystack.find(needle); if (i != haystack.end()) return (*i).second; // found user@domain.tld key char *x = strchr(needle, '@'); @@ -182,7 +183,7 @@ } } else { - tok.token_error(token_context, have); + tok.token_error("env_from/rcpt_to", have); return false; } } @@ -195,6 +196,7 @@ // void token_init() { token_envfrom = register_string("env_from"); + token_include = register_string("include"); token_lbrace = register_string("{"); token_rbrace = register_string("}"); token_rcptto = register_string("rcpt_to");
--- a/src/context.h Fri Mar 10 10:47:12 2006 -0800 +++ b/src/context.h Fri Mar 10 11:00:12 2006 -0800 @@ -22,12 +22,13 @@ void add_from(char *from, char *target) {env_from[from] = target; }; void add_to(char *to, char *target) {rcpt_to[to] = target; }; char * find_from(char *from) {return find(from, env_from);}; - char * find_to(char *to) {return find(to, env_to); }; - char * find(char *needle, &string_map haystack); + char * find_to(char *to) {return find(to, rcpt_to); }; + char * find(char *needle, string_map &haystack); void dump(); }; extern char *token_envfrom; +extern char *token_include; extern char *token_lbrace; extern char *token_rbrace; extern char *token_rcptto;
--- a/src/sm-archive.cpp Fri Mar 10 10:47:12 2006 -0800 +++ b/src/sm-archive.cpp Fri Mar 10 11:00:12 2006 -0800 @@ -190,10 +190,10 @@ char *target = dc.find_to(rcptaddr); if (target) smfi_addrcpt(ctx, target); free(rcptaddr); - if (!processed_from) { + if (!priv.processed_from) { target = dc.find_from(priv.mailaddr); if (target) smfi_addrcpt(ctx, target); - processed_from = true; + priv.processed_from = true; } return SMFIS_CONTINUE; } @@ -208,7 +208,6 @@ sfsistat mlfi_abort(SMFICTX *ctx) { mlfiPriv &priv = *MLFIPRIV; - if (!priv) return SMFIS_CONTINUE; priv.reset(); return SMFIS_CONTINUE; }