IMAP attachments to Google Drive corrupt files

Hello,
I’m dealing with mail attachments issues.

Describe the problem/error/question

I can’t preview attachments from my workflow UI, by clicking on the View button.
Once I’ve uploaded the file to Google Drive, I can’t preview it either.
If I try to download the file on macOS, it can’t be opened either (mentioned as corrupted by the Preview application).

However, when I download the file directly from the e-mail (in Thunderbird), it can be opened.

I’ve also noticed that the file sizes differ:

  • 1 file downloaded from email is 522kb but 940kb in the workflow,
  • another is 304kb but 553kb in the workflow.

I’ve already checked and followed the solutions proposed in these threads, but the problem persists :

What is the error message (if any)?

No error in the workflow itself.

Please share your workflow

Information on your n8n setup

  • n8n version: 1.39.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04 LTS

Any help is welcome :slight_smile:
Thanks

hello @ThoDe

what file extension are you using? Is it the same as when you are downloading it via Thunderbird?

As far as I know, for example, Outlook on Windows saves messages in the .eml format, which is not compatible with MacOS (Outlook client on Mac downloads attachments as .msg files)

In the 2 files examples I mentionned, the first one is a .pdf and seem to be a type pdf in Google Drive and the second on is a .png and seem to be a type image in Google Drive.

Maybe the code node is messing with the files. Try without it

Hello again!

I tried without the Code node and changed the “data” to “attachment_0” (without the quotes) in the Google Drive node but the issue persist.

I believed it might be related to the IMAP node itself as I can’t preview any file I’m trying to manipulate from the any of the workflow nodes. It show up like this when trying to preview the 2 examples mentioned in my first message:

Not sure it can give a clue or not but the mail concerned is hosted on a Cpanel webhost and when downloading the files directly from the email, everything can be opened properly.

Thanks for your help @barn4k !

Ah this is a new issue that we alerted to last week, we are tracking it internally as node-1344

1 Like

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