Tools/Message Filters
select e-mail account that receives the SPAM (unsure how to make filter for all)
New (button)
set name for example: Delete if sender IP or hostname contains
set radio button "Match any of the following"
set new rule: Customize...
set header variable: Received
(because when you click SPAM mail in inbox, "More" button, "View source", you could see following line for example:
Received: from [] (port=54178
then in filters set next column to "contains"
next column to 198.23.211.
(that should match all IPs - use only if you are receiving many messages from single SPAM range (IP differs only in last octet: x.x.x.0-x.x.x.254))

It can also be done via addon, but it needs knowledge of regex. see here and here