Mercurial > dnsbl
changeset 77:8487650c98ee
start coding on new config syntax
author | carl |
---|---|
date | Sat, 16 Jul 2005 14:11:07 -0700 |
parents | 81f1e400e8ab |
children | b6beb282fd83 |
files | install.bash src/context.cpp src/dnsbl.cpp |
diffstat | 3 files changed, 2 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/install.bash Sat Jul 16 13:47:19 2005 -0700 +++ b/install.bash Sat Jul 16 14:11:07 2005 -0700 @@ -36,8 +36,8 @@ rmdir /var/dnsbl fi CONF=$DST/dnsbl.conf -if [ -f $CONF [; then - grep $CONF '^context' >/dev/null +if [ -f $CONF ]; then + grep '^context' $CONF >/dev/null if [ $? -eq 1 ]; then # config file exists, but it is for the older version # preserve it and start over
--- a/src/context.cpp Sat Jul 16 13:47:19 2005 -0700 +++ b/src/context.cpp Sat Jul 16 14:11:07 2005 -0700 @@ -61,7 +61,6 @@ CONFIG::~CONFIG() { - if (debug_syslog) my_syslog("config::~config destructor"); for (context_list::iterator i=contexts.begin(); i!=contexts.end(); i++) { CONTEXT *c = *i; delete c;
--- a/src/dnsbl.cpp Sat Jul 16 13:47:19 2005 -0700 +++ b/src/dnsbl.cpp Sat Jul 16 14:11:07 2005 -0700 @@ -251,7 +251,6 @@ } void mlfiPriv::reset(bool final) { - if (debug_syslog) my_syslog(this, "mlfiPriv::reset"); if (mailaddr) free(mailaddr); if (queueid) free(queueid); discard(env_to); @@ -269,7 +268,6 @@ content_message = NULL; content_host_ignore = NULL; } - if (debug_syslog) my_syslog("mlfiPriv::reset exit"); } void mlfiPriv::get_fd() { @@ -370,7 +368,6 @@ } void mlfiPriv::need_content_filter(char *rcpt, CONTEXT &con) { - if (debug_syslog) my_syslog(this, "need_content_filter"); register_string(env_to, rcpt, &con); if (!memory) { // first recipient that needs content filtering sets all @@ -381,7 +378,6 @@ content_message = con.get_content_message(); content_host_ignore = &con.get_content_host_ignore(); } - if (debug_syslog) my_syslog(this, "need_content_filter exit"); } #define MLFIPRIV ((struct mlfiPriv *) smfi_getpriv(ctx)) @@ -777,7 +773,6 @@ // sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) { - if (debug_syslog) my_syslog("mlfi_connect"); // allocate some private memory mlfiPriv *priv = new mlfiPriv; if (hostaddr->sa_family == AF_INET) { @@ -794,7 +789,6 @@ sfsistat mlfi_envfrom(SMFICTX *ctx, char **from) { mlfiPriv &priv = *MLFIPRIV; - if (debug_syslog) my_syslog(&priv, "mlfi_envfrom"); priv.mailaddr = to_lower_string(from[0]); priv.authenticated = (smfi_getsymval(ctx, "{auth_authen}") != NULL); return SMFIS_CONTINUE; @@ -804,12 +798,10 @@ { DNSBLP rejectlist = NULL; // list that caused the reject mlfiPriv &priv = *MLFIPRIV; - if (debug_syslog) my_syslog(&priv, "mlfi_envrcpt"); CONFIG &dc = *priv.pc; if (!priv.queueid) priv.queueid = strdup(smfi_getsymval(ctx, "i")); char *rcptaddr = rcpt[0]; char *loto = to_lower_string(rcptaddr); - if (debug_syslog) my_syslog(&priv, "finding context"); CONTEXT &con = *(dc.find_context(loto)->find_context(priv.mailaddr)); if (debug_syslog) { char buf[maxlen]; @@ -817,7 +809,6 @@ snprintf(msg, sizeof(msg), "from <%s> to <%s> using context %s", priv.mailaddr, loto, con.get_full_name(buf,maxlen)); my_syslog(&priv, msg); } - if (debug_syslog) my_syslog(&priv, "finding from value"); char *fromvalue = con.find_from(priv.mailaddr); free(loto); status st; @@ -829,7 +820,6 @@ } else { // check the dns based lists - if (debug_syslog) my_syslog(&priv, "checking dns lists"); st = (check_dnsbl(priv, con.get_dnsbl_list(), rejectlist)) ? black : oksofar; } if (st == reject) { @@ -849,7 +839,6 @@ } else { // accept the recipient - if (debug_syslog) my_syslog(&priv, "checking content filtering"); if (!con.get_content_filtering()) st = white; if (st == oksofar) { // but remember the non-whites @@ -866,7 +855,6 @@ sfsistat mlfi_body(SMFICTX *ctx, u_char *data, size_t len) { mlfiPriv &priv = *MLFIPRIV; - if (debug_syslog) my_syslog(&priv, "mlfi_body"); if (priv.authenticated) return SMFIS_CONTINUE; if (priv.only_whites) return SMFIS_CONTINUE; priv.scanner->scan(data, len); @@ -875,10 +863,8 @@ sfsistat mlfi_eom(SMFICTX *ctx) { - if (debug_syslog) my_syslog("mlfi_eom"); sfsistat rc; mlfiPriv &priv = *MLFIPRIV; - if (debug_syslog) my_syslog(&priv, "mlfi_eom"); CONFIG &dc = *priv.pc; char *host = NULL; int ip; @@ -941,7 +927,6 @@ sfsistat mlfi_abort(SMFICTX *ctx) { mlfiPriv &priv = *MLFIPRIV; - if (debug_syslog) my_syslog(&priv, "mlfi_abort"); priv.reset(); return SMFIS_CONTINUE; } @@ -949,7 +934,6 @@ sfsistat mlfi_close(SMFICTX *ctx) { mlfiPriv *priv = MLFIPRIV; - if (debug_syslog) my_syslog(priv, "mlfi_close"); if (!priv) return SMFIS_CONTINUE; delete priv; smfi_setpriv(ctx, NULL);