umanamente / n8n-nodes-imap

This is an n8n community node that adds support for IMAP email servers.
MIT License
17 stars 3 forks source link

ERROR: Unable to move email, unknown error #2

Closed neverho0d closed 8 months ago

neverho0d commented 8 months ago

Hi,

thank you for the node, it's very weird n8n doesn't have it in its core. I'm trying to manage emails in my IMAP account and delete some emails with n8n, but Move operation fails (as well as Flag, btw) with this error:

NodeApiError: Unable to move email, unknown error
    at Object.executeImapAction (/home/node/.n8n/nodes/node_modules/n8n-nodes-imap/nodes/Imap/operations/email/functions/EmailMove.ts:53:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/home/node/.n8n/nodes/node_modules/n8n-nodes-imap/nodes/Imap/Imap.node.ts:75:24)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:698:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

Here is the incoming data:

{
"headers": {
"return-path": "Return-Path: <nagios@server5.localdomain>",
"delivered-to": "Delivered-To: user@example.com",
"received": "Received: by server5 (Postfix, from userid 991) id 169A77341C9E; Tue, 23 Jan 2024 15:14:29 -0500 (EST)",
"dkim-filter": "DKIM-Filter: OpenDKIM Filter v2.11.0 mx.all-wants.info 0E09E8229E8",
"x-spam-checker-version": "X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on amd.all-wants.info",
"x-spam-level": "X-Spam-Level: *",
"x-spam-status": "X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_05,DKIM_ADSP_NXDOMAIN, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.0",
"date": "Date: Tue, 23 Jan 2024 15:14:29 -0500",
"to": "To: user@example.com",
"subject": "Subject: ** PROBLEM Service Alert: server5/sdc is WARNING **",
"user-agent": "User-Agent: Heirloom mailx 12.5 7/5/10",
"mime-version": "MIME-Version: 1.0",
"content-type": "Content-Type: text/plain; charset=us-ascii",
"content-transfer-encoding": "Content-Transfer-Encoding: 7bit",
"message-id": "Message-Id: <20240123201429.169A77341C9E@server5>",
"from": "From: nagios@server5.localdomain"
},
"text": "***** Nagios ***** Notification Type: PROBLEM Service: sdc Host: server5 Address: 127.0.0.1 State: WARNING Date/Time: Tue Jan 23 15:14:29 EST 2024 Additional Info: WARNING: Sectors pending re-allocation ",
"textAsHtml": "<p>***** Nagios *****</p><p>Notification Type: PROBLEM</p><p>Service: sdc<br/>Host: server5<br/>Address: <a href="http://127.0.0.1">127.0.0.1</a><br/>State: WARNING</p><p>Date/Time: Tue Jan 23 15:14:29 EST 2024</p><p>Additional Info:</p><p>WARNING: Sectors pending re-allocation</p>",
"subject": "** PROBLEM Service Alert: server5/sdc is WARNING **",
"date": "2024-01-23T20:14:29.000Z",
"to": {
"value": [
{
"address": "user@example.com",
"name": ""
}
],
"html": "<span class="mp_address_group"><a href="mailto:user@example.com" class="mp_address_email">user@example.com</a></span>",
"text": "user@example.com"
},
"from": {
"value": [
{
"address": "nagios@server5.localdomain",
"name": ""
}
],
"html": "<span class="mp_address_group"><a href="mailto:nagios@server5.localdomain" class="mp_address_email">nagios@server5.localdomain</a></span>",
"text": "nagios@server5.localdomain"
},
"messageId": "<20240123201429.169A77341C9E@server5>",
"html": false
}

Authentication is okay. Maybe something wrong with message ID? In node settings I use {{ $json.messageId }}.

umanamente commented 8 months ago

@neverho0d Could you please attach screenshots with the operation settings panel, along with JSON of the previous attached node.

neverho0d commented 8 months ago

@umanamente I'm sorry, but I removed the workflow. I think we can close the issue as irrelevant. The cause is in the input data that doesn't contain message UIDs, so the node is just unable to identify messages and perform any operations on IMAP server. The source of the data is Gmail Trigger, so you can reproduce the issue, I think. The whole workflow didn't work as expected at all (it didn't react on coming messages), so I removed it and switched to old good plain Python code, sorry!