source: npl/commonservers/ucspi-tcp/ucspi-tcp-0.88.a_record.patch

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[c5c522c]1diff -ruN --exclude conf-* ucspi-tcp-0.88/rblsmtpd.c ucspi-tcp-0.88.fix/rblsmtpd.c
2--- ucspi-tcp-0.88/rblsmtpd.c   Sat Mar 18 10:18:42 2000
3+++ ucspi-tcp-0.88.fix/rblsmtpd.c       Wed Aug  9 16:42:33 2000
4@@ -60,16 +60,54 @@
5 
6 void rbl(char *base)
7 {
8+  int i;
9+  char *altreply = 0;
10   if (decision) return;
11   if (!stralloc_copy(&tmp,&ip_reverse)) nomem();
12+  i = str_chr(base, ':');
13+  if (base[i]) {
14+    base[i] = 0;
15+    altreply = base+i+1;
16+  }
17   if (!stralloc_cats(&tmp,base)) nomem();
18-  if (dns_txt(&text,&tmp) == -1) {
19-    flagmustnotbounce = 1;
20-    if (flagfailclosed) {
21-      if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
22-      decision = 2;
23+  if (altreply) {
24+    if (dns_ip4(&text,&tmp) == -1) {
25+      flagmustnotbounce = 1;
26+      if (flagfailclosed) {
27+        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
28+        decision = 2;
29+      }
30+      return;
31+    }
32+    if (text.len) {
33+      if(!stralloc_copys(&text, "")) nomem();
34+      while(*altreply) {
35+        char *x;
36+        i = str_chr(altreply, '%');
37+        if(!stralloc_catb(&text, altreply, i)) nomem();
38+        if(altreply[i] &&
39+           altreply[i+1]=='I' &&
40+           altreply[i+2]=='P' &&
41+           altreply[i+3]=='%') {
42+          if(!stralloc_catb(&text, ip_env, str_len(ip_env))) nomem();
43+          altreply+=i+4;
44+        } else if(altreply[i]) {
45+          if(!stralloc_cats(&text, "%")) nomem();
46+          altreply+=i+1;
47+        } else {
48+          altreply+=i;
49+        }
50+      }
51+    }
52+  } else {
53+    if (dns_txt(&text,&tmp) == -1) {
54+      flagmustnotbounce = 1;
55+      if (flagfailclosed) {
56+        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
57+        decision = 2;
58+      }
59+      return;
60     }
61-    return;
62   }
63   if (text.len)
64     if (flagrblbounce)
Note: See TracBrowser for help on using the repository browser.