{
  "id": "84KL1bsi9OvbAapn",
  "meta": {
    "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8"
  },
  "name": "Receive_and_analyze_emails_with_rules_in_Sublime_Security",
  "tags": [
    {
      "id": "GCHVocImoXoEVnzP",
      "name": "🛠️ In progress",
      "createdAt": "2023-10-31T02:17:21.618Z",
      "updatedAt": "2023-10-31T02:17:21.618Z"
    },
    {
      "id": "QPJKatvLSxxtrE8U",
      "name": "Secops",
      "createdAt": "2023-10-31T02:15:11.396Z",
      "updatedAt": "2023-10-31T02:15:11.396Z"
    }
  ],
  "nodes": [
    {
      "id": "b1ad1c9a-ba5d-46d6-9ce1-b3bb9346c766",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        720,
        1120
      ],
      "parameters": {
        "format": "resolved",
        "options": {}
      },
      "credentials": {
        "imap": {
          "id": "BDCrQbPFgl8k3ArL",
          "name": "Matti Outlook email"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e43b0257-0d83-4f7e-8824-3ca1d4cf6110",
      "name": "Move Binary Data",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        1240,
        740
      ],
      "parameters": {
        "options": {
          "encoding": "base64"
        },
        "sourceKey": "attachment_0",
        "setAllData": false
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "97359abc-7ca9-4599-9112-4416618d0c36",
      "name": "IF email has attachment",
      "type": "n8n-nodes-base.if",
      "position": [
        1020,
        900
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $binary.attachment_0 }}",
              "operation": "isNotEmpty"
            },
            {
              "value1": "={{ $binary.attachment_0.mimeType }}",
              "value2": "message/rfc822"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "046f87e0-8759-4952-85be-78bf36a70994",
      "name": "Split to matched and unmatched",
      "type": "n8n-nodes-base.code",
      "position": [
        1760,
        740
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field\n// called 'myNewField' to the JSON of each one\nmatched = []\nunmatched = []  \n\nfor (const item of $input.first().json.rule_results) {\n  if (item.matched) {\n    matched.push(item)\n  } else {\n    unmatched.push(item)    \n  }\n}\n\nreturn {\n  json: {\n    matched,\n    unmatched\n  }\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "f88b852d-f2a4-4d78-aaef-40050c0efef8",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        720,
        920
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ce7288d4-61ec-4222-a29e-8a72ed2ee32e",
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2260,
        740
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#test-matti-tomi"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "180",
          "name": "Awesom-O"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "70c76c01-50ef-47a4-b552-bc6fea5079ed",
      "name": "Format the message",
      "type": "n8n-nodes-base.set",
      "position": [
        2040,
        740
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "message",
              "value": "=No. of rules that matched {{ $json[\"matched\"].length }} / {{ $json[\"matched\"].length + $json[\"unmatched\"].length }}\n\nMatched rules:\n{{ $json[\"matched\"].pluck(\"rule\").pluck(\"name\").join('\\n') }}\n"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 2
    },
    {
      "id": "52af4700-0dc5-4f5f-8664-97d2aacdab76",
      "name": "Notify about missing attachment",
      "type": "n8n-nodes-base.slack",
      "position": [
        2260,
        920
      ],
      "parameters": {
        "text": "No attachment found in an email\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#test-matti-tomi"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "180",
          "name": "Awesom-O"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "19be16c9-3908-4a2d-87e4-f721c33dc124",
      "name": "Analyze email with Sublime Security",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1500,
        740
      ],
      "parameters": {
        "url": "https://api.platform.sublimesecurity.com/v0/messages/analyze",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"raw_message\": \"{{ $json.data }}\",\n  \"run_active_detection_rules\": true,\n  \"run_all_detection_rules\": false\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "content-type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "buIfmuHDZZQ2MyYz",
          "name": "Sublime Security bearer token"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a39d52d6-26e0-485e-8d32-984e26f71f9b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        298.6458865911087
      ],
      "parameters": {
        "width": 618.0312276650722,
        "height": 963.8594737915395,
        "content": "![imap](https://i.imgur.com/lVqCPYb.png)\n# Workflow Overview\nLeverage n8n's IMAP node to `seamlessly ingest emails as .eml attachments`, streamlining your security protocols and response strategies. \n\nThis setup is crucial for organizations utilizing platforms like Outlook, which offers a specialized security feature that designates specific inboxes for phishing attempts. \n\nWhen a phishing email is flagged through Outlook's interface, the system is designed to convert it into an .eml file and direct it to a dedicated phishing inbox. This process not only centralizes your phishing threat management but also ensures that each potential threat is queued for immediate and thorough analysis. \n\nBy integrating with n8n, you can automate the capture of these emails, transforming user-reported incidents into actionable data without manual intervention, enhancing your cybersecurity response and preserving your workflow's integrity.\n\n## Ingest emails as attachments as .eml file. \nSet your phishing email inbox here via your imap credentials. You can also replace this with any other node that retrieves emails as .eml attachments. "
      },
      "typeVersion": 1
    },
    {
      "id": "3cb757ce-2083-44de-8508-89039c6bca9d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1444,
        361
      ],
      "parameters": {
        "width": 503.7209302325584,
        "height": 710.138909846923,
        "content": "![Sublime Security](https://i.imgur.com/DfXJLIw.png)\n## Analyze Attachment and format output\nIf an attachment is detected, n8n facilitates its secure transfer to Sublime Security for detailed analysis. This automated process not only speeds up the threat detection mechanism but also formats the output for compatibility with other systems, such as Slack, ensuring a smooth and efficient workflow. \n\nThrough this automation, you're not just analyzing emails; you're fortifying your defense against cyber threats and enhancing operational efficiency with minimal user involvement."
      },
      "typeVersion": 1
    },
    {
      "id": "83756b95-a3a8-4145-9d10-fc7e3b2121f8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1980,
        354.9999999999999
      ],
      "parameters": {
        "width": 476.0465116279074,
        "height": 777.0757733319455,
        "content": "![Slack](https://i.imgur.com/iKyMV0N.png)\n## Prep output for Slack Report\nn8n completes the cycle of threat analysis and communication by preparing and delivering comprehensive reports directly to your Slack channels. \n\nThis ensures that all stakeholders are immediately informed about potential threats, fostering a culture of transparency and prompt action. \n\nIn instances where no attachment is found, n8n proactively dispatches a notification to Slack, signaling your team to investigate further. "
      },
      "typeVersion": 1
    },
    {
      "id": "a443e91b-6b0b-4fb8-b9d5-6f1d236da053",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        360.90897077923785
      ],
      "parameters": {
        "width": 541.1627906976748,
        "height": 715.8304363872012,
        "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n## Check for attachments and send to sublime if any found \nUpon receiving an email via the IMAP node, n8n executes a meticulous inspection to detect the presence of attachments. This is more than a mere check; it's an essential layer of your security posture to identify and handle potentially malicious content proactively. \n\nIf an attachment is found, the binary file is converted to JSON for further analysis. "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Move Binary Data": [
      {
        "json": {
          "to": {
            "html": "<span class=\"mp_address_group\"><a href=\"mailto:mattiasn8n@outlook.com\" class=\"mp_address_email\">mattiasn8n@outlook.com</a></span>",
            "text": "mattiasn8n@outlook.com",
            "value": [
              {
                "name": "",
                "address": "mattiasn8n@outlook.com"
              }
            ]
          },
          "data": "[encoded data, 74580 characters]",
          "date": "2023-09-06T13:31:27.000Z",
          "from": {
            "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Tomi Turtiainen</span> &lt;<a href=\"mailto:tomi@n8n.io\" class=\"mp_address_email\">tomi@n8n.io</a>&gt;</span>",
            "text": "Tomi Turtiainen <tomi@n8n.io>",
            "value": [
              {
                "name": "Tomi Turtiainen",
                "address": "tomi@n8n.io"
              }
            ]
          },
          "html": "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><div dir=\"ltr\"><br></div>\n",
          "text": "\n",
          "headers": {
            "to": "To: mattiasn8n@outlook.com",
            "date": "Date: Wed, 6 Sep 2023 16:31:27 +0300",
            "from": "From: Tomi Turtiainen <tomi@n8n.io>",
            "subject": "Subject: asdasd",
            "received": "Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-500bbe3ef0eso1173362e87.1\r\n        for <mattiasn8n@outlook.com>; Wed, 06 Sep 2023 06:31:39 -0700 (PDT)",
            "x-sid-pra": "X-SID-PRA: TOMI@N8N.IO",
            "message-id": "Message-ID: <CAN5dpcHNquvqeC1bC-+0JToUg2Kdzcm4=STS2cT64aC=5RqmoQ@mail.gmail.com>",
            "x-received": "X-Received: by 2002:a05:6512:550:b0:4f8:6253:540 with SMTP id\r\n h16-20020a056512055000b004f862530540mr1032219lfl.19.1694007098992; Wed, 06\r\n Sep 2023 06:31:38 -0700 (PDT)",
            "return-path": "Return-Path: tomi@n8n.io",
            "x-sender-ip": "X-Sender-IP: 209.85.167.51",
            "content-type": "Content-Type: multipart/mixed; boundary=\"0000000000006226f60604b0c30d\"",
            "mime-version": "MIME-Version: 1.0",
            "received-spf": "Received-SPF: Pass (protection.outlook.com: domain of n8n.io designates\r\n 209.85.167.51 as permitted sender) receiver=protection.outlook.com;\r\n client-ip=209.85.167.51; helo=mail-lf1-f51.google.com; pr=C",
            "x-sid-result": "X-SID-Result: PASS",
            "dkim-signature": "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n        d=n8n.io; s=google; t=1694007099; x=1694611899; darn=outlook.com;\r\n        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject\r\n         :date:message-id:reply-to;\r\n        bh=XX+u25qxwUiTQhDYEAKum6cFDiY8kAf9VQXtXT7IG4g=;\r\n        b=DtryoPGLz346xBmbPGAOuNpUz90LjDCRHhDSlQ+FacVezcvnbNtne30NyD5zV1+Nmz\r\n         xbQGR9Leg14yy8CyJ6BB5RdPnGCzyS0jx+xThP9vB/8r9Rfbg2y9R7HpfAHauxZq8WKw\r\n         QbnMn4JwvjFizKABeadgIgrk5zxs78ZHK0IboMyNttPc9YVyho+Q7koLdkdMFnB0bGjH\r\n         B2gud3+PixaUitsJhOGXx0TKpCG58CjFkpwf203YJhNN9k/kUejr8lhlu3K8tXlHnRdl\r\n         uIQg7BwYTLtg2ZLaPXz0VQLUlbnLNbwHHFhXUvJ1D0edRZKk8yGn315NxX9CJ8ta5oKx\r\n         tqww==",
            "x-message-info": "X-Message-Info:\r\n\tqZelhIiYnPlubV6F6xIgQ5/Mzwaakpnur7bBCplzbP7vmOUxLfcYxrmfap05e717ue9YRnsWC+tgOVq+uN9uCokFEfs/cntY6SPU1rIDMJ2XiRHcXDxWXN2/2HOxMn+YqecYvkeX6IHFuhzmOJBtdhGgfjpDztKpJUUmqN9RcyzI0U+NHd0xDlBzopl+9fN9CkxAIgBkriAe9ipdjAiOuw==",
            "x-gm-message-state": "X-Gm-Message-State: AOJu0YzkHX9+H/UKNyzFozodiJ17OU4KzydEaaglLky7picVcfrQnODG\r\n\tIoNVpwnJqtuVpDLl9i9cnYIZMFlT5AUv2OjrGh8I8twGmBWyHG5bixU=",
            "x-message-delivery": "X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MTtHRD0yO1NDTD0z",
            "x-google-smtp-source": "X-Google-Smtp-Source: AGHT+IHCPLcwqEBonKbCznfQtkP79eEZZH2uzDURqzvzU3BNgqCao9T/H/EfqSgjduesLZKMVH7RZ7jGLqOSzVCC0uU=",
            "x-microsoft-antispam": "X-Microsoft-Antispam: BCL:0;",
            "x-incomingheadercount": "X-IncomingHeaderCount: 13",
            "authentication-results": "Authentication-Results: spf=pass (sender IP is 209.85.167.51)\r\n smtp.mailfrom=n8n.io; dkim=pass (signature was verified)\r\n header.d=n8n.io;dmarc=pass action=none header.from=n8n.io;compauth=pass\r\n reason=100",
            "x-eopattributedmessage": "X-EOPAttributedMessage: 0",
            "x-ms-publictraffictype": "X-MS-PublicTrafficType: Email",
            "x-ms-userlastlogontime": "X-MS-UserLastLogonTime: 9/6/2023 1:30:02 PM",
            "x-google-dkim-signature": "X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n        d=1e100.net; s=20221208; t=1694007099; x=1694611899;\r\n        h=to:subject:message-id:date:from:mime-version:x-gm-message-state\r\n         :from:to:cc:subject:date:message-id:reply-to;\r\n        bh=XX+u25qxwUiTQhDYEAKum6cFDiY8kAf9VQXtXT7IG4g=;\r\n        b=gNJBR8hHMQgsPmy6aj/fUHgJA80VYzMkBa692pzhafJzxHcKSsoBG6Va8Z/vMmQHHf\r\n         b+79DaJg9AoYuSbhqk17fB1dF/moQh/AyAbEOeTy+ntAlYCJDNOwXP6WV419d0Y1Stds\r\n         Wvx+8Pd4LVhXGUcGRmk5hsnZ7AuPfYi8fbsU+Q/uVaLEp+SFAFgRVBvFpicxD/2AWpNF\r\n         gi3j2RHnBEppPcXFJTmrtTHHmSHwDHIWeRa4d0rfv3JYYGLHVXeJ6OwNgtjF/ogP4Q8A\r\n         avLGYbqt5rY5Z852upyxtVxkWY/H0gHKjfkGH4MQHtja8iFGJa970FZwE81sZ/GhilPF\r\n         lzog==",
            "x-ms-exchange-eopdirect": "X-MS-Exchange-EOPDirect: true",
            "x-incomingtopheadermarker": "X-IncomingTopHeaderMarker:\r\n OriginalChecksum:57147F1F6C31873D4EA40450C6B4FCC2A019EE54FDEDA03E8B891047BB320969;UpperCasedChecksum:5F3A1E264AFC755FB3BB49D7A2D706C38ED7B1548108A3EBE6A43EF3E238AE53;SizeAsReceived:2325;Count:13",
            "x-ms-traffictypediagnostic": "X-MS-TrafficTypeDiagnostic:\r\n DS2PEPF00003444:EE_|CWLP265MB2113:EE_|LO0P265MB6663:EE_",
            "x-eoptenantattributedmessage": "X-EOPTenantAttributedMessage: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa:0",
            "x-ms-exchange-crosstenant-id": "X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa",
            "x-ms-exchange-organization-pcl": "X-MS-Exchange-Organization-PCL: 2",
            "x-ms-exchange-organization-scl": "X-MS-Exchange-Organization-SCL: 1",
            "x-ms-exchange-crosstenant-authas": "X-MS-Exchange-CrossTenant-AuthAs: Anonymous",
            "x-microsoft-antispam-message-info": "X-Microsoft-Antispam-Message-Info:\r\n\t=?utf-8?B?TEZ5UU1vOTVYR3dLdWtadnVWZndKTVY2TkhQU3JGckNOblNqOWd0eVRWTkIw?=\r\n =?utf-8?B?eXo1MTkveFBqL3hKb2o4cHRFUFZiTkpLWnpYaCtBbnZkbGhHU1lRZlEzZnJx?=\r\n =?utf-8?B?RUM3YXQ4UXV0dUZBcTVucnpJb2JVbEFBeWxscVlDekVacmNSa25qaFlJVElu?=\r\n =?utf-8?B?WmlBYWFOb1NzQkwrZWo2K0hrRzhQMDN0dFQ3Ly9jdVR0ZDlUclJtbXl0K1VI?=\r\n =?utf-8?B?Uzh0UGZZRDdUSnphaThuV2FOVS84SE5Xa2Q4S05WWFhTN1ptOEVPTGxmd04r?=\r\n =?utf-8?B?dllXeG90TitNak1yWUVJY28wVXQzNFMwVmZRdVZkV1VnUStkTWY1VWVvV1Rr?=\r\n =?utf-8?B?RVNnR3lpRUFHQ1VZeVRnTGl1b0ZwVzlUUXhITHA0SUNsSUd6VHk5RTZZOWs4?=\r\n =?utf-8?B?NGlhNGZPUzAzYllWMHJPVVRtWnV4ZFBmRTVXSUpxdVZVWCtsdEJhRHhWZnN0?=\r\n =?utf-8?B?SDZZYnUvSHIwV25aRWFNbTVyMUxaNzN4ZHpac1lwTmVwdDhMWTFFMXpwMHlC?=\r\n =?utf-8?B?VmxBQ1JtMTNyRkFYWUJmcjlkcmE0NkVTWDJ6eENyUjhyalgwSGdLeTd5VnFM?=\r\n =?utf-8?B?cWJOZzBmbEo4NWl6NHUvMVl5NmY5MzFXNThCV3R0eXFvOTJ6U2N4NVVUMmF2?=\r\n =?utf-8?B?bTFHdVJsZDlyTXNNRmxIdVBYdUt2RmpYZlZLY2RrL2VwdWgybVhnQ09vSllS?=\r\n =?utf-8?B?WUxYNnlzbHN6SmVEaGRjMWwrT3lDSG05NU5NK3pBUlVTYWt3MFFXQXRpMlB1?=\r\n =?utf-8?B?YzMzYjVBclIvd2xmWDJEWkNkcnI1enNoWlkyTFdVaWtCTGt0a1ZRRktUZVRz?=\r\n =?utf-8?B?T2oxYnk4SHRNNlg5b0NMZEVkL0doRW9oZkx6anh5L3ZoSUpGN0xlNDJXcks4?=\r\n =?utf-8?B?Yjg3Y2FheTRBNlp6b2xlbzZERm5iK0VZQUNmeEhQRXZUTzFIUWtidFVEMzU3?=\r\n =?utf-8?B?OHNBL2RzMWk5K1VyL2xXMXd6cU5LU2o3b2RmZmh3R2pHUlBVcjluSnRUWkVL?=\r\n =?utf-8?B?cU9KTUwySUxrVHZ5QTRKeWI3MGxEMDQ5RlpyVkRwM3JQRGFHVkNDVmhtVFlI?=\r\n =?utf-8?B?a1ZzMStzUkRGeXQrS2JTUktQeUZ0QXkwaitHUDB5UGFmSEVHaFVKUEc4QjZQ?=\r\n =?utf-8?B?Z3BvcHpWeW0wK3R3VnQ0bFZXcFVKY2lETTRIMS84RFdOZjlYYldDVEFXNHlE?=\r\n =?utf-8?B?RitORzUzK2ZzNGN6UmtNMXVNY1dlRStkR1ZNcXFueVVPbm9oNUxBcG5HWlU4?=\r\n =?utf-8?B?b0dmcmpYamZPQXpRNnRBeHRHZkhPMTdsWkdmVWhjUHZYL0tQdER0dEluRWEy?=\r\n =?utf-8?B?M0ZBaVZnVnNWUmJHb1pZM2xkRGZjV1dTMEJ5NXNCamc2b09XYmdPMjF2VmM1?=\r\n =?utf-8?B?Rm9yNWJmNGwzZ1lSL1ZCYXhlS3dUN1JyYys3a0dCNklZYmxyb2lXTW1OZFNG?=\r\n =?utf-8?B?b2UzaGFsSU5BbFltSnlZSlh3NjFlOGp4alA0SFVzWHkvVm1DRXdWRTVzZ21Q?=\r\n =?utf-8?B?eEpmb1dFaDJsV1g1VjN0SlFtbzRJZjkrdUV0bjhidzhyY0YzWnRDdnZ1YkFP?=\r\n =?utf-8?B?YWcvUT09?=",
            "x-ms-exchange-organization-authas": "X-MS-Exchange-Organization-AuthAs: Anonymous",
            "x-ms-exchange-crosstenant-authsource": "X-MS-Exchange-CrossTenant-AuthSource:\r\n DS2PEPF00003444.namprd04.prod.outlook.com",
            "x-microsoft-antispam-mailbox-delivery": "X-Microsoft-Antispam-Mailbox-Delivery:\r\n\tucf:0;jmr:0;ex:0;auth:1;dest:I;ENG:(5062000305)(920221119095)(90000117)(920221120095)(90010023)(91010020)(91040095)(9050020)(9100341)(944500132)(2008001134)(2008120430)(4810010)(4910033)(9575002)(10195002)(9320005)(120001);",
            "x-ms-exchange-organization-authsource": "X-MS-Exchange-Organization-AuthSource:\r\n DS2PEPF00003444.namprd04.prod.outlook.com",
            "x-ms-exchange-processed-by-bccfoldering": "X-MS-Exchange-Processed-By-BccFoldering: 15.20.6745.026",
            "x-ms-exchange-transport-endtoendlatency": "X-MS-Exchange-Transport-EndToEndLatency: 00:00:02.5250613",
            "x-ms-office365-filtering-correlation-id": "X-MS-Office365-Filtering-Correlation-Id: 909e28ef-742f-4b3f-cac4-08dbaedd9a06",
            "x-ms-exchange-crosstenant-fromentityheader": "X-MS-Exchange-CrossTenant-FromEntityHeader: Internet",
            "x-ms-exchange-crosstenant-network-message-id": "X-MS-Exchange-CrossTenant-Network-Message-Id: 909e28ef-742f-4b3f-cac4-08dbaedd9a06",
            "x-ms-exchange-crosstenant-originalarrivaltime": "X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2023 13:31:39.8042\r\n (UTC)",
            "x-ms-exchange-organization-expirationinterval": "X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000",
            "x-ms-exchange-organization-network-message-id": "X-MS-Exchange-Organization-Network-Message-Id:\r\n 909e28ef-742f-4b3f-cac4-08dbaedd9a06",
            "x-ms-exchange-organization-expirationstarttime": "X-MS-Exchange-Organization-ExpirationStartTime: 06 Sep 2023 13:31:39.8198\r\n (UTC)",
            "x-ms-exchange-organization-messagedirectionality": "X-MS-Exchange-Organization-MessageDirectionality: Incoming",
            "x-ms-exchange-transport-crosstenantheadersstamped": "X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB2113",
            "x-ms-exchange-crosstenant-rms-persistedconsumerorg": "X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg:\r\n 00000000-0000-0000-0000-000000000000",
            "x-ms-exchange-organization-expirationintervalreason": "X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit",
            "x-ms-exchange-organization-expirationstarttimereason": "X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit"
          },
          "subject": "asdasd",
          "messageId": "<CAN5dpcHNquvqeC1bC-+0JToUg2Kdzcm4=STS2cT64aC=5RqmoQ@mail.gmail.com>",
          "textAsHtml": "<p></p>"
        },
        "binary": {},
        "pairedItem": {
          "item": 0
        }
      }
    ],
    "Analyze email with Sublime Security": [
      {
        "json": {
          "rule_results": [
            {
              "rule": {
                "id": "58544c97-5d1b-4269-8465-5325ccfc05cf",
                "name": "Matti + Tomi",
                "source": "sender.email.domain.root_domain == \"aliexpress.com\"",
                "severity": null
              },
              "error": null,
              "matched": true,
              "success": true,
              "execution_time": 3.8433e-05,
              "external_errors": null
            },
            {
              "rule": {
                "id": "75229a3d-ed82-47e0-a37b-ae1b562c08d5",
                "name": "Test rule",
                "source": "strings.ilike(subject.subject, \"*Sublime-Standard-Test-String*\")\nor regex.icontains(body.html.raw, \".*Sublime-Standard-Test-String.*\")\nor regex.icontains(body.plain.raw, \".*Sublime-Standard-Test-String.*\")",
                "severity": null
              },
              "error": null,
              "matched": false,
              "success": true,
              "execution_time": 0.002214803,
              "external_errors": null
            }
          ]
        },
        "pairedItem": {
          "item": 0
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "25aa0ca5-6e3c-44ed-98f9-37f62a78ed76",
  "connections": {
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Analyze email with Sublime Security",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format the message": {
      "main": [
        [
          {
            "node": "Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "IF email has attachment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF email has attachment": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify about missing attachment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split to matched and unmatched": {
      "main": [
        [
          {
            "node": "Format the message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze email with Sublime Security": {
      "main": [
        [
          {
            "node": "Split to matched and unmatched",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}