Adam D. McKenna <[EMAIL PROTECTED]> writes on 5 June 1999 at 23:51:49 -0400
 > You might try using the -b flag with rblsmtpd, this will send 553 error code 
 >(permanent) instead of 451 (temporary)..

Yes, that would cure the problem I guess.  1 second seems awfully fast
retry, I didn't think of it being just normal message retry.

Also wouldn't tell me where it was coming from, and I was curious.  As
so often happens in real life, shortly after posting my query I got
energetic and actually wrote the patch; turned out to be easy to do,
of course.  Found out what system, made a temporary hole, got the
email (innocuous), closed the hole again.

So now I'm back to giving a permanent error (I've flip-flopped on this
a few times), AND I'm logging the IP that RBLSMTPD refuses connections
from. 

So now the log lines look like this (here):

Jun  5 23:23:20 gw smtpd: 928643000.144593 rblsmtpd: pid 7320: ip 24.2.7.66: 553 See 
http://www.orbs.org/blocked.cgi. Your mailserver is in the ORBS database as an 
insecure email relay. This is a generic text message.

(That's the TXT record from ORBS at the end; on an RBL connect, it'd
show the IP twice, once from my patch and once embedded in the TXT
record.) 

One of the reasons this is useful to me is that I do sometimes need to
make a hole; this makes it easier to find the IP I need to make the
hole for (especially since the inbound MXs aren't the systems sending
outbound for some domains).

Here's the patch, for anybody that's interested.  This could go on
qmail.org if you think it's of general interest, Russel.

--- rblsmtpd.c.orig     Wed May 12 21:56:04 1999
+++ rblsmtpd.c  Sun Jun  6 04:07:05 1999
@@ -48,7 +48,9 @@
 {
   int i;
   char *x;
+  char *remip;
 
+  remip = 0;
   x = env_get("RBLSMTPD");
   if (x) {
     if (!*x) return;
@@ -65,6 +67,7 @@
     if (!x) return;
     if (!*x) return;
     if (x[ip_scan(x,&ip)]) return;
+    remip = x;
 
     switch(txt(&rbltext,&ip,rbldomain)) {
       case 0:
@@ -86,6 +89,11 @@
   substdio_puts(subfderr,"rblsmtpd: pid ");
   substdio_put(subfderr,strnum,fmt_ulong(strnum,(unsigned long) getpid()));
   substdio_puts(subfderr,": ");
+  if (remip) {
+    substdio_puts(subfderr,"ip ");
+    substdio_puts(subfderr,remip);
+    substdio_puts(subfderr,": ");
+  }
   substdio_put(subfderr,message.s,message.len);
   substdio_puts(subfderr,"\n");
   substdio_flush(subfderr);

-- 
David Dyer-Bennet                                              [EMAIL PROTECTED]
http://www.ddb.com/~ddb (photos, sf) Minicon: http://www.mnstf.org/minicon
http://ouroboros.demesne.com/ The Ouroboros Bookworms
Join the 20th century before it's too late!

Reply via email to