it's not always clear which of several RBLs list an address -- because
several of them do not include descriptive enough info in their TXT
records.  this patch logs the base rbl name along with the record so that
the logs are at least foolproof (which is nice for automatic log
processing).

-dean

--- ucspi-tcp-0.88/rblsmtpd.c.orig	2003-11-16 23:52:05.000000000 -0800
+++ ucspi-tcp-0.88/rblsmtpd.c	2003-12-28 14:48:26.000000000 -0800
@@ -55,6 +55,7 @@
 
 int decision = 0; /* 0 undecided, 1 accept, 2 reject, 3 bounce */
 static stralloc text; /* defined if decision is 2 or 3 */
+static char *decision_base;
 
 static stralloc tmp;
 
@@ -76,6 +77,7 @@
       if (flagfailclosed) {
         if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
         decision = 2;
+	decision_base = base;
       }
       return;
     }
@@ -105,15 +107,18 @@
       if (flagfailclosed) {
         if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
         decision = 2;
+	decision_base = base;
       }
       return;
     }
   }
-  if (text.len)
+  if (text.len) {
     if (flagrblbounce)
       decision = 3;
     else
       decision = 2;
+    decision_base = base;
+  }
 }
 
 void antirbl(char *base)
@@ -173,6 +178,10 @@
   buffer_puts(buffer_2,ip_env);
   buffer_puts(buffer_2," pid ");
   buffer_put(buffer_2,strnum,fmt_ulong(strnum,getpid()));
+  if (decision_base) {
+    buffer_puts(buffer_2, " ");
+    buffer_puts(buffer_2,decision_base);
+  }
   buffer_puts(buffer_2,": ");
   buffer_put(buffer_2,message.s,message.len);
   buffer_puts(buffer_2,"\n");
