Skip to main content

Analyze email headers for IP reputation and spoofing detection - Outlook

Workflow preview

Workflow preview
100%
Analyze email headers for IP reputation and spoofing detection - Outlook preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Analyze Emails for Security Insights Who is this for? This workflow is ideal for security teams, IT Ops professionals, and managed service providers (MSPs) responsible for monitoring and validating...

Best for

  • SecOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.microsoftoutlooktrigger, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.limit, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.merge, n8n-nodes-base.aggregate

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Angel Menendez.

Original n8n.io source

1.1 Workflow description

Title
Analyze email headers for IP reputation and spoofing detection - Outlook
Workflow name
Analyze email headers for IP reputation and spoofing detection - Outlook

Analyze Emails for Security Insights

Who is this for?

This workflow is ideal for security teams, IT Ops professionals, and managed service providers (MSPs) responsible for monitoring and validating email traffic. It’s especially useful for organizations that need to identify potential phishing attempts, spam, or compromised accounts by analyzing email headers and IP reputation.


What problem is this workflow solving?

This workflow helps identify malicious or suspicious emails by verifying email authentication headers (SPF, DKIM, DMARC) and analyzing the reputation of the originating IP address. By automating these checks, it reduces manual analysis time and flags potential threats efficiently.


What this workflow does
  • Email Monitoring: Polls a specified Microsoft Outlook folder for new emails in real-time.
  • Header Analysis: Retrieves and processes email headers to extract critical information such as authentication results and the sender’s IP address.
  • IP Reputation Check: Leverages external APIs (IP Quality Score and IP-API) to analyze the originating IP for potential spam or malicious activity.
  • Authentication Validation: Validates SPF, DKIM, and DMARC headers, determining if the email passes industry-standard authentication protocols.
  • Data Aggregation and Reporting: Combines all analyzed data into a unified format, ready for reporting or integration into downstream systems.
  • Webhook Integration: Outputs the findings via a webhook, enabling integration with alerting tools or security information and event management (SIEM) platforms.

Setup
  1. Connect to Outlook:

    • Configure the Microsoft Outlook trigger node with valid OAuth2 credentials.
    • Specify the email folder to monitor for new messages.
  2. API Keys (Optional):

    • Obtain an API key for IP Quality Score (https://ipqualityscore.com).
    • Ensure the IP-API endpoint is accessible.
    • This step is optional as ipqualityscore.com will provide a limited number of free lookups each month. See more details here.
  3. Webhook Configuration:

    • Set up a webhook endpoint to receive the output of the workflow.
  4. Optional Adjustments:

    • Customize polling intervals in the trigger node.
    • Modify header filters or extend the validation logic as needed.

How to customize this workflow to your needs
  • Add Alerts: Use the Respond to Webhook node to trigger notifications in Slack, email, or any other communication channel.
  • Integrate with SIEM: Forward the workflow output to SIEM tools like Splunk or ELK Stack for further analysis.
  • Modify Validation Rules: Update SPF, DKIM, or DMARC logic in the Set nodes to align with your organization’s security policies.
  • Expand IP Analysis: Add more APIs or services to enrich IP reputation data, such as VirusTotal or AbuseIPDB.

This workflow provides a robust foundation for email security monitoring and can be tailored to fit your organization's unique requirements. With its modular design and integration options, it’s a versatile tool to enhance your cybersecurity operations.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Trigger on New Email

Type / Role
n8n-nodes-base.microsoftOutlookTrigger - microsoftOutlookTrigger
Config choices
Version 1

Block 2 - Retrieve Headers of Email

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Extract Received Headers

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Remove Extra Received Headers

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 5 - Extract Original From IP

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Query IP Quality Score API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Query IP API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Authentication-Results Header?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Extract Authentication-Results Header

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Received-SPF Header?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - DKIM-Signature Header?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Set SPF Value

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Extract Received-SPF Header

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - DKIM Signature Found

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - DMARC Header?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 16 - No DMARC Header

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - Extract DMARC Header

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Set DMARC Value

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 19 - Original IP Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 20 - No DKIM Signature Found

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Determine Auth Values

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 22 - No SPF Found

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 23 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 24 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Showing the first 24 of 41 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Analyze email headers for IP reputation and spoofing detection - Outlook
Complexity advanced
Nodes 41
Categories SecOps
Author Angel Menendez
Published 27 Dec 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2676/2676.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Analyze email headers for IP reputation and spoofing detection - Outlook do?

Analyze Emails for Security Insights Who is this for? This workflow is ideal for security teams, IT Ops professionals, and managed service providers (MSPs) responsible for monitoring and validating...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your SecOps use case.