WorkflowOutlookOpen

Email header IP analysis for Outlook in n8n

This n8n workflow analyses email headers to check where a message really came from and whether the sender's IP looks risky. It is for security and IT teams who want to inspect suspicious Outlook mail, first through an Outlook trigger and later as an API for other platforms.

What it does

When a new email arrives it retrieves the headers, extracts the Received lines, keeps the first one to find the original sender IP and queries IP Quality Score and an IP lookup API. It also checks the Authentication-Results header, then aggregates the findings and returns them through the webhook.

How to use it

Test with the Outlook trigger section, connect Microsoft Outlook, add your IP Quality Score key, then call the webhook version from other tools.

More in Outlook and the n8n workflow library.

Full text

Front matter
name: Microsoftoutlooktrigger Workflow
description: Triggered by a webhook. Connects Aggregate, Code, Condition, HTTP request, Limit, Respond To Webhook, Webhook. ![]({{ $env.WEBHOOK_URL }} ## **Testing Email Header Analysis Workflow** This section of the workflow is designed for testing purposes to ensure that the setup functions correctly with your Outlook email client before deploying it as an API for third-party platforms. The process begins with the `Trigger on New Email` node, which monitors a specified folder in your Outlook mailbox and triggers the workflow whenever a new email arrives. Configured to poll every minute, it ensures timely detection
category: Automation
kind: Workflow
software: Aggregate|Code|Condition|HTTP request|Limit|Respond To Webhook|Webhook

Microsoftoutlooktrigger Workflow

Triggered by a webhook. Connects Aggregate, Code, Condition, HTTP request, Limit, Respond To Webhook, Webhook. ![]({{ $env.WEBHOOK_URL }}

Testing Email Header Analysis Workflow

This section of the workflow is designed for testing purposes to ensure that the setup functions correctly with your Outlook email client before deploying it as an API for third-party platforms. The process begins with the Trigger on New Email node, which monitors a specified folder in your Outlook mailbox and triggers the workflow whenever a new email arrives. Configured to poll every minute, it ensures timely detection

Steps

  • Trigger on New Email (microsoftOutlookTrigger)
  • Retrieve Headers of Email (httpRequest)
  • Extract Received Headers (code)
  • Remove Extra Received Headers (limit)
  • Extract Original From IP (set)
  • Query IP Quality Score API (httpRequest)
  • Query IP API (httpRequest)
  • Authentication-Results Header? (if)
  • Extract Authentication-Results Header (code)
  • Received-SPF Header? (if)
  • DKIM-Signature Header? (if)
  • Set SPF Value (set)
  • Extract Received-SPF Header (code)
  • DKIM Signature Found (set)
  • DMARC Header? (if)
  • No DMARC Header (set)
  • Extract DMARC Header (code)
  • Set DMARC Value (set)
  • Original IP Found? (if)
  • No DKIM Signature Found (set)
  • Determine Auth Values (set)
  • No SPF Found (set)
  • Merge (merge)
  • Aggregate (aggregate)
  • No Operation, do nothing (noOp)
  • Format Webhook Output (set)
  • Format Individual Auth Outputs (set)
  • Format Combined Auth Output (set)
  • Respond to Webhook (respondToWebhook)
  • Webhook1 (webhook)
  • Set Headers (set)
  • Aggregate Received-SPF Headers (aggregate)
  • Set Headers Here (set)
  • Set Webhook Headers Here (set)
  • Sticky Note (stickyNote)
  • Sticky Note1 (stickyNote)
  • Sticky Note2 (stickyNote)
  • Sticky Note3 (stickyNote)
  • Sticky Note4 (stickyNote)
  • Sticky Note5 (stickyNote)

Import

Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).

Source and license

Source: https://github.com/Zie619/n8n-workflows/blob/main/Limit/0673_Limit_Code_Create_Webhook.md

Author: Zie619, n8n workflow collection. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.