- substitution_append_var(&varlist, "nick", source_p->name);
- substitution_append_var(&varlist, "ip", source_p->sockhost);
- substitution_append_var(&varlist, "host", source_p->host);
- substitution_append_var(&varlist, "dnsbl-host", source_p->preClient->dnsbl_listed->host);
- substitution_append_var(&varlist, "network-name", ServerInfo.network_name);
-
- ServerStats.is_ref++;
-
- sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP),
- me.name, source_p->name,
- substitution_parse(source_p->preClient->dnsbl_listed->reject_reason, &varlist));
-
- substitution_free(&varlist);
-
- sendto_one_notice(source_p, ":*** Your IP address %s is listed in %s",
- source_p->sockhost, source_p->preClient->dnsbl_listed->host);
- source_p->preClient->dnsbl_listed->hits++;
- add_reject(source_p, NULL, NULL);
- exit_client(client_p, source_p, &me, "*** Banned (DNS blacklist)");
- return CLIENT_EXITED;
+ if(IsExemptKline(source_p) || IsConfExemptDNSBL(aconf))
+ {
+ sendto_one_notice(source_p, ":*** Your IP address %s is listed in %s, but you are exempt",
+ source_p->sockhost, source_p->preClient->authd_data);
+ }
+ else
+ {
+ sendto_realops_snomask(SNO_REJ, L_NETWIDE,
+ "Listed on DNSBL %s: %s (%s@%s) [%s] [%s]",
+ source_p->preClient->authd_data,
+ source_p->name,
+ source_p->username, source_p->host,
+ IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
+ source_p->info);
+
+ ServerStats.is_ref++;
+
+ sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP),
+ me.name, source_p->name, reason);
+
+ sendto_one_notice(source_p, ":*** Your IP address %s is listed in %s",
+ source_p->sockhost, source_p->preClient->authd_data);
+ add_reject(source_p, NULL, NULL);
+ exit_client(client_p, source_p, &me, "*** Banned (DNS blacklist)");
+ substitution_free(&varlist);
+ return CLIENT_EXITED;
+ }
+ break;
+ case 'O':
+ if(IsExemptKline(source_p) || IsConfExemptProxy(aconf))
+ {
+ sendto_one_notice(source_p, ":*** Your IP address %s has been detected as an open proxy (ip:port %s), but you are exempt",
+ source_p->sockhost, source_p->preClient->authd_data);
+ }
+ else
+ {
+ sendto_realops_snomask(SNO_REJ, L_NETWIDE,
+ "Open proxy %s: %s (%s@%s) [%s] [%s]",
+ source_p->preClient->authd_data,
+ source_p->name,
+ source_p->username, source_p->host,
+ IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
+ source_p->info);
+
+ ServerStats.is_ref++;
+
+ sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP),
+ me.name, source_p->name, reason);
+
+ sendto_one_notice(source_p, ":*** Your IP address %s has been detected as an open proxy (ip:port %s)",
+ source_p->sockhost, source_p->preClient->authd_data);
+ add_reject(source_p, NULL, NULL);
+ exit_client(client_p, source_p, &me, "*** Banned (Open proxy)");
+ substitution_free(&varlist);
+ return CLIENT_EXITED;
+ }
+ default: /* Unknown, but handle the case properly */
+ if (IsExemptKline(source_p))
+ {
+ sendto_one_notice(source_p, ":*** You were rejected, but you are exempt (reason: %s)",
+ reason);
+ }
+ else
+ {
+ sendto_realops_snomask(SNO_REJ, L_NETWIDE,
+ "Rejected by authentication system (reason %s): %s (%s@%s) [%s] [%s]",
+ reason, source_p->name, source_p->username, source_p->host,
+ IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
+ source_p->info);
+
+ ServerStats.is_ref++;
+
+ sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP),
+ me.name, source_p->name, reason);
+
+ sendto_one_notice(source_p, ":*** Rejected by authentication system: %s",
+ reason);
+ add_reject(source_p, NULL, NULL);
+ exit_client(client_p, source_p, &me, "*** Banned (authentication system)");
+ substitution_free(&varlist);
+ return CLIENT_EXITED;
+ }