Search
j0ke.net Open Build Service
>
Projects
>
server:dns
>
ucspi-tcp
> ucspi-tcp-0.88-rblsmtpd.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File ucspi-tcp-0.88-rblsmtpd.diff of Package ucspi-tcp
diff -ruN ucspi-tcp-0.88-orig/rblsmtpd.c ucspi-tcp-0.88/rblsmtpd.c --- ucspi-tcp-0.88-orig/rblsmtpd.c 2000-03-18 16:18:42.000000000 +0100 +++ ucspi-tcp-0.88/rblsmtpd.c 2005-12-05 12:36:06.000000000 +0100 @@ -60,16 +60,54 @@ void rbl(char *base) { + int i; + char *altreply = 0; if (decision) return; if (!stralloc_copy(&tmp,&ip_reverse)) nomem(); + i = str_chr(base, ':'); + if (base[i]) { + base[i] = 0; + altreply = base+i+1; + } if (!stralloc_cats(&tmp,base)) nomem(); - if (dns_txt(&text,&tmp) == -1) { - flagmustnotbounce = 1; - if (flagfailclosed) { - if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem(); - decision = 2; + if (altreply) { + if (dns_ip4(&text,&tmp) == -1) { + flagmustnotbounce = 1; + if (flagfailclosed) { + if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem(); + decision = 2; + } + return; + } + if (text.len) { + if(!stralloc_copys(&text, "")) nomem(); + while(*altreply) { + char *x; + i = str_chr(altreply, '%'); + if(!stralloc_catb(&text, altreply, i)) nomem(); + if(altreply[i] && + altreply[i+1]=='I' && + altreply[i+2]=='P' && + altreply[i+3]=='%') { + if(!stralloc_catb(&text, ip_env, str_len(ip_env))) nomem(); + altreply+=i+4; + } else if(altreply[i]) { + if(!stralloc_cats(&text, "%")) nomem(); + altreply+=i+1; + } else { + altreply+=i; + } + } + } + } else { + if (dns_txt(&text,&tmp) == -1) { + flagmustnotbounce = 1; + if (flagfailclosed) { + if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem(); + decision = 2; + } + return; } - return; } if (text.len) if (flagrblbounce) @@ -125,7 +163,7 @@ else if (!stralloc_copys(&message,"553 ")) nomem(); - if (text.len > 200) text.len = 200; + if (text.len > 500) text.len = 500; if (!stralloc_cat(&message,&text)) nomem(); for (i = 0;i < message.len;++i) if ((message.s[i] < 32) || (message.s[i] > 126))