Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X ban support #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions zapdnsbl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace eval ::zapdnsbl {
# Channel flags
setudef flag zapdnsbl
setudef flag zapdnsbl.pubcmd
setudef flag zapdnsbl.xonly
setudef int zapdnsbl.bantime

# Packages
Expand Down Expand Up @@ -241,13 +242,21 @@ proc ::zapdnsbl::dnsblCallback { ip hostname status data } {

if {[dict exists $data ident]} {
regexp {(.+)@[^\.]+\.(.+)} $host -> hex webHost
if {[matchban "*!$hex@*.$webHost" $channel]} { return 1 }
newchanban $channel "*!$hex@*.$webHost" $::zapdnsbl::name [dict get $dnsblData banreason] $bantime
} else {
if {[matchban "*!@hex@*.$webHost" $channel]} { return 1 }
if {[channel get $channel zapdnsbl.xonly] && [onchan "X" $channel]} {
putquick "PRIVMSG X :ban $channel *!$hex@* $bantime [dict get $dnsblData banreason]"
} else {
newchanban $channel "*!$hex@*" $::zapdnsbl::name [dict get $dnsblData banreason] $bantime
}
} else {
regexp ".+@(.+)" $host -> iphost
if {[matchban "*!*@$iphost" $channel]} { return 1 }
newchanban $channel "*!*@$iphost" $::zapdnsbl::name [dict get $dnsblData banreason] $bantime
}
if {[channel get $channel zapdnsbl.xonly] && [onchan "X" $channel]} {
putquick "PRIVMSG X :ban $channel *!*@$iphost $bantime [dict get $dnsblData banreason]"
} else {
newchanban $channel "*!*@$iphost" $::zapdnsbl::name [dict get $dnsblData banreason] $bantime
}
}
putlog "$::zapdnsbl::name - Host '[dict get $data host] ([dict get $data ip])' found in [dict get $dnsblData blacklist] reason '[dict get $dnsblData reason]' on channel '$channel', banning with reason '[dict get $dnsblData banreason]'!"
}
}
Expand Down