Describe the problem/error/question
I’m trying to use node ‘Email Trigger (IMAP)"‘. Connection is successful, but when I’m trying to execute it, it always reports the following error:
Problem in node ‘Email Trigger (IMAP)’
Search option argument must be a Date object or a parseable date string
After some investigations with the help of AI, I found that the issue is that the node always adds
[“SINCE”,“Invalid DateTime”]
to the searchCriteria. Even when manually setting the option “Custom Email Rule” to [“UNSEEN”,[“SINCE”,“01-Aug-2025”]] it still appends the wrong SINCE with “Invalid DateTime”, so that there is one correct and one faulty SINCE entry which still makes the node fail. ![]()
Then I did the following test which made the node work for a short time:
I manually logged into my n8n container with command “docker exec -u root -it n8n /bin/sh”, changed folder with command
$ cd /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/dist/nodes/EmailReadImap/v2/
edited a file via
$ vi EmailReadImapV2.node.js
and commented out the following line in the else statement so that it looks like this (to find it quickly search for the 2nd “push” in the code):
// searchCriteria.push([‘SINCE’, activatedAt.toFormat(‘dd-LLL-yyyy’)]);
Then I restarted the container
$ docker compose down ; docker compose up -d”.
When executing the “Email Trigger (IMAP)” node again, it worked perfectly!!!
Unfortunately, the container seems to reset to the original image after a while so that this workaround is only a very temporary solution. => I need the original container image to be fixed so that I can update my container.
What is the error message (if any)?
Error Message: see above
Extract from n8n debug log (I guess most interesting is the first line):
2025-08-16T21:06:16.487Z | debug | Querying for new messages on node “EmailReadImap” {“searchCriteria”:[“UNSEEN”,[“SINCE”,“Invalid DateTime”]],“file”:“EmailReadImapV2.node.js”,“function”:“onMail”}
2025-08-16T21:06:16.490Z | error | Email Read Imap node encountered an error fetching new emails {“error”:{“name”:“Error”,“message”:“Search option argument must be a Date object or a parseable date string”,“stack”:“Error: Search option argument must be a Date object or a parseable date string\n at buildSearchQuery (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/imap@0.8.19/node_modules/imap/lib/Connection.js:1932:21)\n at Connection.search (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/imap@0.8.19/node_modules/imap/lib/Connection.js:577:15)\n at Connection.search (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/imap@0.8.19/node_modules/imap/lib/Connection.js:566:8)\n at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+imap@file+packages+@n8n+imap/node_modules/@n8n/imap/src/imap-simple.ts:73:14\n at new Promise ()\n at ImapSimple.search (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+imap@file+packages+@n8n+imap/node_modules/@n8n/imap/src/imap-simple.ts:72:16)\n at TriggerContext.getNewEmails (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/EmailReadImap/v2/utils.ts:114:34)\n at Connection.onMail (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts:399:27)\n at Connection.emit (node:events:530:35)\n at Connection._resUntagged (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/imap@0.8.19/node_modules/imap/lib/Connection.js:1287:14)”},“file”:“EmailReadImapV2.node.js”,“function”:“onMail”}
2025-08-16T21:06:16.490Z | error | Search option argument must be a Date object or a parseable date string {“file”:“error-reporter.js”,“function”:“defaultReport”}
2025-08-16T21:06:16.490Z | debug | Running node “Email Trigger (IMAP)” finished with error {“node”:“Email Trigger (IMAP)”,“workflowId”:“Ti0M4kzXULU6AwRW”,“file”:“logger-proxy.js”,“function”:“exports.debug”}
Please share your workflow
Share the output returned by the last node
No output because of error; see above.
Information on your n8n setup
- n8n version: 1.106.3 (installed from image “n8nio/n8n:latest” on 2025-Aug-16)
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Linux (from TrueNAS)




