Package Information
Downloads: 891 weekly / 891 monthly
Latest Version: 0.2.0
Author: Maxime Olivier
Documentation
n8n-nodes-imap-advanced
Advanced, generic IMAP community nodes for n8n (Mailcow, Dovecot, Gmail IMAP, Outlook IMAP, etc.).
This package is focused on practical email automation patterns that are hard to build with the default n8n email nodes alone:
- message threading from headers (
References,In-Reply-To) - robust flag/tag updates (including custom IMAP keywords)
- optional attachment download as n8n binary data
- trigger with
auto | idle | pollbehavior
Included nodes
1) IMAP Advanced
Resource-based action node with these operations:
- Message
getsearchupdateFlagsmovecopydelete(adds\Deleted)undelete(removes\Deleted)expunge
- Thread
getByMessage
- Mailbox
liststatus
2) IMAP Advanced Trigger
New message trigger with:
- modes:
auto,idle,poll - output formats:
headersSnippet,full,raw - attachment modes:
none,metadataOnly,binary - optional post-processing: mark seen, add flags, move message
Credentials
This package reuses n8n built-in IMAP credentials:
- credential type:
imap - no custom IMAP credential is required
Installation
Community package in n8n
Install as a regular npm package where n8n runs:
npm install n8n-nodes-imap-advanced
or from a local tarball:
npm install /path/to/n8n-nodes-imap-advanced-0.1.0.tgz
Then restart n8n.
Quick workflow example (thread + attachments)
- IMAP Advanced Trigger (
mode=auto,mailbox=INBOX) - IMAP Advanced (
resource=thread,operation=getByMessage) - loop over thread messages
- IMAP Advanced (
resource=message,operation=get,attachmentsMode=binary) - process content / attachments
- IMAP Advanced (
resource=message,operation=updateFlagsormove)
Threading behavior
Thread:getByMessage strategy:
- parse
References - fallback to
In-Reply-To - optional subject fallback (
Subject Fallback = true)
Notes:
- IMAP has no universal thread API like Gmail API.
- Header-based threading is best effort and may vary across servers/mailboxes.
Attachments behavior
For Message:get and Trigger output:
none: no attachment metadata/contentmetadataOnly: metadata only (filename, mime, size)binary: adds n8n binary fields (attachment_0,attachment_1, ... by default)
Attachment filtering options:
- max size (MB)
- allowed MIME list (CSV)
- filename regex
Flags / tags
IMAP “tags” are flags/keywords:
- system flags:
\Seen,\Answered,\Flagged,\Deleted,\Draft - custom keywords: e.g.
$n8n_processed,ai-replied
Use Message:updateFlags with:
addremovereplace
Move behavior
Message:move:
- uses IMAP
MOVEcapability when server supports it - otherwise falls back to
COPY + \Deleted + expungeequivalent flow
Development
npm install
npm run build
Current limitations
expungeis mailbox-level in current implementation.- Threading is single-mailbox oriented.
- IDLE mode includes practical polling safety to remain robust across server behaviors.
License
MIT

