Apple is, so far, immune to viruses, though there are a few Trojans and other exploits to be aware of.
Spam has nothing to do with any kind of malware, it's just email you don't want. Somewhere, you got on a spam list. You may have put your email into a web site that required a valid email address to enter a contest, to enter the site itself, etc. In many such cases, your email address is then sold and shared with virtually every spammer on the planet.
The mail app has a SPAM filter - have you turned that on? You can also use custom rules to get rid of persistent incoming addresses or domains.
If you have been signing up for online contests, then your email address is already spread throughout the globe by now so will have to make some effort to deal with the flood. Does your email provider have a web site with server side options like server side rules or SPAM filtering, whitelists and blacklists?
You might even want to think about getting another email address to use just for messages to people and places you do want to hear back from, since you may have already spread your existing one far and wide amongst the spammers.
Usually, it will taper off. I dealt with one of those some years back. A newspaper article mentioned a contest to win something rather extravagant. I went to the site and it asked for a valid email before you could enter. I tried a couple of fakes, and it reported back almost instantly the address was no good.
This, by the way, was a contest connected with Disney, Corp. I even called their 1-800 number to see if it was really their contest. They said yes, so I went ahead and put in my real email address. In less than 10 minutes, spam started appearing. It kept growing each day. I went from about 10 or less spam messages a day, to about 250 a day by the end of the week. And this was Disney selling and sharing my address within seconds of confirming it was valid address. Thanks for nothing! Not at all what I expected such a company to do.
It took almost 8 months for the onslaught to end and come back down to a minor trickle.