The primary difference between spam and graymail lies in the consent of the recipient. Spam emails are unsolicited and often sent in bulk without the recipient's permission. They can also contain malicious links or requests for personal information. On the other hand, legitimate sources typically send graymail to recipients who have given permission or opted-in to receive them. Although graymail can become excessive or unwanted, it usually doesn't carry malicious intent.