For the origin of the term “spam” with regards to email, see:
https://www.templetons.com/brad/spamterm.html
The term “ham” is commonly used for non-spam. I’m an amateur radio operator, and we are also called “hams”. This radio related use of “ham” has a long history but the source of that term has been disputed for over 50 years.
Bill