First of all you have to specify where did you get spam ?
1) Mail server, then you have to improve mail server settings.
2) If you have open proxy on the router that is being used as spam relay, restrict access to the router by 'ip proxy access' or 'ip firewall.