You can check an IP address, there are several organizations dedicated to identifying and listing IP addresses sending out spam. As **ZipperJJ **says, it’s like whack-a-mole. One of the common sources nowadays is infected machines - not just servers, but personal PC’s too.
The problem is that by default, there is no specific authentication for email. This is by original design. Originally, servers in the networks would come and go offline, perhaps some smaller universities would be dialling other servers or maybe a few bigger ones had a few dedicated lines from one to another. Thus a server could act as a relay, accepting Email from A for B and passing it on when B came online. At the time, nobody imagined anonymous servers sending floods of Viagra and Rolex ads.
Many years ago, certain ISP’s allowed spammers to operate, but between laws and blacklisting, that option has disappeared.
So most servers accept any incoming TCP/IP connection on port 25. Now, firewalls and filters will check any incoming connection against common blacklists, so a server might be useful for only a few hours or days before it is almost universally blocked. Large organizations’ firewalls block port 25 outbound except for their dedicated email servers, so infecting a machine behind a commercial firewall (if you can get past the antivirus) is useless. (Plus the firewall will report attempts, and the PC is usually fixed right away.)
You can’t block email from all of China, for example, because there may actually be someone who needs to get email from a contact in Hong Kong or Shanghai.
The best bet for spammers now is to infect home PC’s - less monitored, less technical oversight, more likely to visit inappropriate websites and pick up a virus. However, many larger ISP’s block port 25 outbound on their networks - the only place a home PC might send email, is to the local ISP email server where filters can be applied.
As a result, another useful target is smaller business server, with the right to send email not blocked. Again, after a day or two the rest of the world adds them to the blacklist, and some tech support person has to clean up the infection, go through the trouble of removing the balcklisting, etc.
Plus, blacklists and filters use sophisticated “smart” programs- looking for patterns. Thus you’ll see V1agra spelled with a “1” instead of an “I”, or with spaces between the letters, or using a few Cyrillic characters, to fool dictionary checks - which smarter programs can now catch. You will see email with only a picture in the body of the email blocked, because to avoid filters parsing the content, the spam sends a picture that looks like text body.
it’s an escalating arms race, or maybe whack-a-mole. Someone comes up with an idea to get past the filters, the filters are updated to cover that. Someone discovers a new way to infect machines, the anti-virus companies eventually cover that. All that this guarantees is that you need to stay up to date to stay safe(r).