X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fmod-blacklist.c;h=e202f739302e9de2a8c4a90fb338eb406d762520;hb=80d9ed728be4b02ac483f3339cbb184f6602d15b;hp=c06ef7d761e80d00eb1160148650eba56eb60aca;hpb=51d185d9c8adfa87cbc5376beebb6c467a6a1bd2;p=srvx.git diff --git a/src/mod-blacklist.c b/src/mod-blacklist.c index c06ef7d..e202f73 100644 --- a/src/mod-blacklist.c +++ b/src/mod-blacklist.c @@ -142,8 +142,11 @@ dnsbl_hit(struct sar_request *req, struct dns_header *hdr, struct dns_rr *rr, un message = "client is blacklisted"; } + /* Prepend "AUTO " prefix so the g-lined are put in a different snomask */ + strcpy(reason, "AUTO "); + /* Expand elements of the message as necessary. */ - do_expandos(reason, sizeof(reason), message, "%txt%", (txt ? txt : "(no-txt)"), "%ip%", data->client_ip, NULL); + do_expandos(reason + 5, sizeof(reason) - 5, message, "%txt%", (txt ? txt : "(no-txt)"), "%ip%", data->client_ip, NULL); if (zone->debug) { blacklist_debug("DNSBL match: [%s] %s (%s)", zone->zone, data->client_ip, reason); @@ -152,7 +155,7 @@ dnsbl_hit(struct sar_request *req, struct dns_header *hdr, struct dns_rr *rr, un target[0] = '*'; target[1] = '@'; strcpy(target + 2, data->client_ip); - gline_add(self->name, target, zone->duration, reason, now, now, 1); + gline_add(self->name, target, zone->duration, reason, now, now, 0, 1); } } free(txt); @@ -190,7 +193,8 @@ blacklist_check_user(struct userNode *user) target[0] = '*'; target[1] = '@'; strcpy(target + 2, host); - gline_add(self->name, target, conf.gline_duration, reason, now, now, 1); + /* We do not prepend AUTO here so it can be done in the blacklist file. */ + gline_add(self->name, target, conf.gline_duration, reason, now, now, 0, 1); } /* Figure out the base part of a DNS blacklist hostname. */