How to download attachments from a specific subject in an IMAP/POP3 mail server and save them to a directory on the hard drive

I have installed npx n8n locally. Can I download the attachments in a specific subject from the IMAP/POP3 mail server and save them to a directory on the hard disk? For example, download the attachment with the subject containing the text “virus code” and save it to d:\test

1 Like

Yes, this scenario is possible with n8n.

Use the IMAP Email Node:

  • Use the IMAP Email node to connect to your email inbox.
  • Filter emails that have “virüs kodu” in the subject line (there are filter options in the node settings).
  • In the workflow, you can use an IF Node to check the subject (if it contains “virüs kodu”, proceed).

Yes you can,

u can take all the data from the imap trigger node, store in it .json or .HTML and then store to disk no problem with store ‘Read/Write Files from Disk’ node.

hope this helps

I use imap in n8n, but I can’t find a filter to filter the header. Can you teach me?

when u get an attachment with the imap, does it look like this, if so u can use router, or if node, to filter out whats not needed.

even in header if u wanted, so in imap u just enable to download attachment, and then filter once inside no attachment don’t process further etc.

Hope this helps.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.