comparison src/dnsbl.cpp @ 301:13905d36ca82

Generic regex now matches against the reverse dns PTR value
author Carl Byington <carl@five-ten-sg.com>
date Mon, 13 Oct 2014 20:48:40 -0700
parents 05b604c99e06
children 802e2b779ed1
comparison
equal deleted inserted replaced
300:3a3b0cbcaf6e 301:13905d36ca82
1317 snprintf(buf, sizeof(buf), "%s is not acceptable", priv.client_name); 1317 snprintf(buf, sizeof(buf), "%s is not acceptable", priv.client_name);
1318 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", buf); 1318 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", buf);
1319 return SMFIS_REJECT; 1319 return SMFIS_REJECT;
1320 } 1320 }
1321 // check generic rdns 1321 // check generic rdns
1322 const char *msg = con.generic_match(priv.client_name); 1322 if (priv.client_dns_name) {
1323 if (msg) { 1323 const char *msg = con.generic_match(priv.client_dns_name);
1324 // reject the recipient based on generic reverse dns 1324 if (msg) {
1325 char buf[maxlen]; 1325 // reject the recipient based on generic reverse dns
1326 snprintf(buf, sizeof(buf), msg, priv.client_name); 1326 char buf[maxlen];
1327 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", buf); 1327 snprintf(buf, sizeof(buf), msg, priv.client_name);
1328 return SMFIS_REJECT; 1328 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", buf);
1329 return SMFIS_REJECT;
1330 }
1329 } 1331 }
1330 } 1332 }
1331 if (st == black) { 1333 if (st == black) {
1332 // reject the recipient based on blacklisting either from or to 1334 // reject the recipient based on blacklisting either from or to
1333 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user"); 1335 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user");