Blocking E-Mail By IP Address Using Sun Messaging Server
I’ve been getting increasing amounts of Unsolicited Bulk E-Mail, or Spam from certain ranges of IP Addresses that have not been sending any legitimate E-Mail. I’ve wanted to block these IP ranges when they first connect to the mail server, and before my (expensive) Spam filter needs to run.
The first step is to identify the IP addresses sending you bulk E-Mail; or if you want, you can get an entire set of IP Addresses, already sub-netted for use by Sun Messaging Server at http://ip.ludost.net/. For our purposes here, we want to block the IP Address range 192.231.176.0/24.
Create a file (much easier to maintain a single file than to continually edit the mappings file); with a name like port_access_block.txt and add the line as such (note, there are 2 spaces at the beginning of the line):
TCP|*|25|$(192.231.176.0/24)|* $T$N500$ No$ thank$ you
when the file is created, edit the mappings file, adding a link to your newly created file in the PORT_ACCESS section. My updated PORT_ACCESS section looked like:
PORT_ACCESS
</opt/msg/msg-test/config/port_access_block.txt
*|*|*|*|* $C$|INTERNAL_IP;$3|$Y$E
* $YEXTERNAL
Ensure the port_access_block.txt is readable by the user running your mail server; then recompile and restart your messaging server.
All E-mail to your mail server from remote machines in the IP address range listed will rejected immediately with a fatal error.








