)
addresses.each do |address,count|
- if count > 2
+ if count > 1
acl = Acl.find(:first, :conditions => {
:address => address,
- :netmask => "255.255.255.255"
})
unless acl
- Acl.create(
+ Acl.create({
:address => address,
- :netmask => "255.255.255.255",
:k => "no_account_creation",
:v => "auto_spam_block"
- )
+ }, :without_protection => true)
puts "Blocked #{address}"
end
end
acls = Acl.find(:all, :conditions => {
- :netmask => "255.255.255.255",
:k => "no_account_creation",
:v => "auto_spam_block"
})