# HG changeset patch # User carl # Date 1188508029 25200 # Node ID bd33eaccfed8fcf71bc6aca3a2751754f1c46fe5 # Parent 44021d570958648470bf7eca413f633a29da12ef fix pre/post scripts in rpm spec file diff -r 44021d570958 -r bd33eaccfed8 src/context.cpp --- a/src/context.cpp Thu Aug 30 12:05:44 2007 -0700 +++ b/src/context.cpp Thu Aug 30 14:07:09 2007 -0700 @@ -697,7 +697,7 @@ // delete the underlying DNSBL objects. delete d; } - if (generic_regx && strlen(generic_regx)) regfree(&generic_pattern); + if (generic_regx) regfree(&generic_pattern); } @@ -719,10 +719,10 @@ bool CONTEXT::set_generic(char *regx, char *msg) { int rc = 0; - if (generic_regx && strlen(generic_regx)) regfree(&generic_pattern); + if (generic_regx) regfree(&generic_pattern); generic_regx = regx; generic_message = msg; - if (generic_regx && strlen(generic_regx)) { + if (generic_regx) { rc = regcomp(&generic_pattern, regx, REG_NOSUB | REG_ICASE | REG_EXTENDED); } return rc; // true iff bad pattern @@ -732,7 +732,7 @@ char *CONTEXT::generic_match(char *client) { if (parent && !generic_regx) return parent->generic_match(client); - if (!strlen(generic_regx)) return NULL; + if (!generic_regx) return NULL; if (0 == regexec(&generic_pattern, client, 0, NULL, 0)) { return generic_message; } diff -r 44021d570958 -r bd33eaccfed8 src/context.h --- a/src/context.h Thu Aug 30 12:05:44 2007 -0700 +++ b/src/context.h Thu Aug 30 14:07:09 2007 -0700 @@ -126,7 +126,7 @@ VERIFYP verifier; // pointer to the verifier structure char * generic_regx; // pointer to generic regular expression char * generic_message; // pointer to generic message with one %s - regex_t generic_pattern; // compiled regular expression + regex_t generic_pattern; // compiled regex pattern char * autowhite_file; // file to use for automatic whitelisting WHITELISTERP whitelister; // pointer to the auto whitelister structure string_map env_from; // map senders to white/black/unknown diff -r 44021d570958 -r bd33eaccfed8 src/spamass.cpp.in --- a/src/spamass.cpp.in Thu Aug 30 12:05:44 2007 -0700 +++ b/src/spamass.cpp.in Thu Aug 30 14:07:09 2007 -0700 @@ -99,16 +99,17 @@ // FQDN of this site macro_j = getorwarnmacro(ctx, "j", "localhost", "ENVRCPT"); - // Protocol used to receive the message */ - macro_r = getorwarnmacro(ctx, "r", "SMTP", "ENVRCPT"); + // Protocol used to receive the message, not really needed by spam assassin + macro_r = "SMTP"; + // helo value we already have macro_s = helo; - // Sendmail binary version - macro_v = getorwarnmacro(ctx, "v", "8.13.0", "ENVRCPT"); + // Sendmail binary version, not really needed by spam assassin + macro_v = "8.13.0"; - // Sendmail .cf version - macro_Z = getorwarnmacro(ctx, "Z", "8.13.0", "ENVRCPT"); + // Sendmail .cf version, not really needed by spam assassin + macro_Z = "8.13.0"; // Validated sending site's address macro__ = getorwarnmacro(ctx, "_", "unknown", "ENVRCPT"); diff -r 44021d570958 -r bd33eaccfed8 xml/dnsbl.in --- a/xml/dnsbl.in Thu Aug 30 12:05:44 2007 -0700 +++ b/xml/dnsbl.in Thu Aug 30 14:07:09 2007 -0700 @@ -333,10 +333,10 @@ If the mail has not been accepted or rejected yet, and the filtering - context specifies a non-empty generic regular expression, then we check - the fully qualified client name (obtained via the sendmail macro "_"). - The mail is rejected if the client name matches the specified regular - expression. + context (or any ancestor context) specifies a non-empty generic regular + expression, then we check the fully qualified client name (obtained via + the sendmail macro "_"). The mail is rejected if the client name + matches the specified regular expression. If the mail has not been accepted or rejected yet, we look for a