Templates / Report spam and phishing URLs from IMAP mailboxes to Spamhaus

Report spam and phishing URLs from IMAP mailboxes to Spamhaus

Ready for 3.0

by Vitali ✓ · 386 views · created 2026-01-20 · SecOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 14 nodes and runs when a new email arrives over IMAP (plus 1 other trigger). It uses only n8n's built-in nodes. It also calls submit.spamhaus.org over HTTP.

How it runs

Trigger: When a new email arrives over IMAP (plus 1 other trigger).

  1. initial config spam (Edit Fields (Set)): sets 3 fields: email, threat_type, reason.url
  2. initial phish config (Edit Fields (Set)): sets 3 fields: email, threat_type, reason.url
  3. Loop over each email (Loop Over Items (Split in Batches)): loops over the items in batches
  4. extract all URLs (Code): runs custom JavaScript code
  5. de-duplicate URLs (Remove Duplicates): removes duplicate items
  6. split URLs to array (Split Out): splits a list into separate items
  7. Filter: keeps only the items that match a condition
  8. create item for spamhaus (Edit Fields (Set)): sets 3 fields: source.object, threat_type, reason
  9. Spamhaus submit url (HTTP Request): calls submit.spamhaus.org (POST)
  10. Aggregate: combines items into one

HTTP calls to: submit.spamhaus.org

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (10)

From the author

This workflow automates URL reporting to Spamhaus based on incoming spam/phishing sample emails. It watches one or more IMAP folders, extracts URLs from each email body, removes duplicates and common noise, and submits the remaining URLs to the Spamhaus…

Excerpt from Vitali's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.