A spam gateway is an email-security system positioned in the mail-delivery path. It examines incoming messages and attempts to identify spam, phishing messages, malicious attachments, suspicious links, spoofed senders, and other unwanted content.
Depending on its configuration, a spam gateway can:
Quarantine it for review.
Mark it as spam.
Deliver it to a junk-mail folder.
Remove or block malicious content.
Because the question specifically asks about preventing unwanted email from reaching an inbox, a spam gateway is the most precise answer.
An intrusion detection system monitors activity and generates alerts but does not primarily filter email.
A firewall filters network connections and ports but normally does not perform detailed email-content classification.
CompTIA objective 2.3 explicitly identifies spam gateways as network-based internet appliances. Microsoft’s anti-spam documentation explains that spam filtering identifies and separates unwanted email from legitimate messages
Submit