Fortunately there are some very effective means to combat spam. Not every platform that can receive spam has equally good means to combat it, but often similar techniques and tools can be used. For example, fax spam has legal barriers now, and while that has not eliminated these sorts of faxes, it has reduced them greatly. E-mail has been such a problem over the years due to the ease of spammers in finding the ways and means to send it that there has been much expert focus on combating it.
There are many techniques that are used to fight e-mail spam. Two main categoires are client-side spam filtering, and server-side or mail gateway filtering. The next major comparison of techniques might be considered blacklisting versus whitelisting. E-mail gateways for example almost always only allow authorized, intended users to send messages. This very often prevents spammers from getting started. In the past often a misconfigured e-mail server, called an open relay, could be used by anyone to send mail. Spammers look hard to find servers that they can trick into allowing them to send messages, or find means to access the servers from a trusted location, application, or system they have hacked. Often now e-mail servers require authentication to send messages, although your e-mail client may take care of this automatically for you.
There are other server-side techniques used for inbound messages. Very often known sources of spam can be blocked, whether it is entire servers, domains, or IP addresses or ranges that are blocked. This is one of the more extreme means of filtering, but can be the most effective if the source of the spam is sending no legitimate e-mail. The servers also scan the content of messages and filter them based on advanced algorithms and content filtering of key words, phrases, or other content. This is one of the most effective means of filtering. Servers often have networked databases of spam information, allowing others to benefit from their identification of spam sources. The various techniques are almost always combined to gain the maximum spam prevention effect.