changeset 170:bd33eaccfed8

fix pre/post scripts in rpm spec file
author carl
date Thu, 30 Aug 2007 14:07:09 -0700
parents 44021d570958
children 8deb51871b3d
files src/context.cpp src/context.h src/spamass.cpp.in xml/dnsbl.in
diffstat 4 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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;
 	}
--- 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
--- 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");
--- 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 @@
                 </para></listitem>
                 <listitem><para>
                     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.
                 </para></listitem>
                 <listitem><para>
                     If the mail has not been accepted or rejected yet, we look for a