Spam & Virus Detection
AgentMail automatically scans every inbound message for spam and viruses before it reaches your inbox. This happens transparently — there is nothing you need to configure.
Virus Detection
Emails that contain viruses or malware are dropped before they reach your inbox. The mail server accepts the message and then discards it silently, so the sender gets no bounce and no message is created. Your inboxes will never contain a message flagged as infected, and no webhook or WebSocket event is sent for it. This protects your agents from processing potentially dangerous content.
Spam Detection
Emails identified as spam are still stored in your inbox so you never lose a message that might be a false positive. However, they are excluded from API results by default to keep your agent’s workflow clean.
When you call the List Threads or List Messages endpoint, spam messages are filtered out unless you explicitly request them.
Accessing Spam Threads
To include spam in your results, pass the include_spam (includeSpam in TypeScript) parameter when listing threads.
Each thread object includes a spam label indicating whether it was flagged as spam, so you can handle flagged threads differently in your application logic.
