IMAP Inject & Move Message

It would be nice to have a extension of the IMAP nodes to

  • move a message between folders and mailboxes
  • create folders in a mailbox
  • create new messages in a mailbox and subfolder

The issue was developed here: IMAP Inject & Move Message? · Issue #47 · n8n-io/n8n · GitHub

Regards Sebastian

Not opposed to this, but this can also be done using sieve rules on the IMAP server. That’s at least the solution I choose and it works well.

I also think this feature request is a bit beyond the scope of N8N, as this is mostly functionality that belongs to the email server or client.

1 Like

Hey @vco1!

Thanks for suggesting sieve rules. THat’s something I personally have never used and will look into.

We are running an Exchange server so my intentions with such a functionality is for example:

  • use the EmailReadImap trigger
  • use n8n to convert the attachments and process them
  • move the message to dedicated folders depending on the processing
  • send some notification through SMTP maybe

We are looking into processing stuff like this in the future.

Regards Sebastian

Sieve won’t work with Exchange (I think), but most likely the same functionality can be accomplished with server side rules.

I have created workflows that do steps 1,2 and 4 of your example. For step 3 (the move) I choose an alternative route. Basically doing it upfront and not depending on the processing. Question is, is it really depending on the processing? I.e. is the move based on the result of a step in your WF?

I’m using a separate “n8n” mail account b.t.w. Which makes processing easier imho. Any mail that needs to be handled by N8N gets automatically copied (not forwarded!) to that account and it leaves the “original” mail for further processing, e.g. moving it to a special mailbox. Mail in the “n8n” mailbox gets deleted (expunged) periodically, based on age and read status (read = processed by n8n).

Hope this makes sense.

1 Like

Definitely +1 here.

I need to be able to move emails in my client’s mailboxes based off of n8n workflows. Mixing n8n with a custom back-end server for this makes the overall solution at least 10x more complex and would require custom code.

Having an IMAP node capable of doing this would be of great value to me, at least.

I created an n8n community node, n8n-nodes-imap, which is now available for use. Here’s a snapshot of what you can expect from this node:

Operations

Mailbox Operations:

  • Get List of Mailboxes: This function allows you to retrieve a list of all your mailboxes, complete with essential status information like message count.
  • Get Status of a Mailbox: Gain detailed insights into the status of any mailbox, including the total number of messages and other pertinent details.
  • Create a Mailbox: You can now set up new mailboxes directly within your workflow.
  • Rename a Mailbox: Adjust the names of your mailboxes as required.
  • Delete a Mailbox: To prevent accidental data loss, this feature is currently disabled, as I haven’t identified a significant use case in standard workflows.

Email Operations:

  • Get List of Emails in a Mailbox
  • Download Attachments from an Email
  • Move an Email to Another Mailbox

I encourage you to test this node and share your experiences or suggestions.

Github repo: GitHub - umanamente/n8n-nodes-imap