Email attachments automation fails with permission denied

  • 18 March 2024
  • 4 replies

Badge +1


I have an email attachment automation that downloads attachments to the shared resource folder, but when it is time to run the workspace I get a permission denied error on email.attachments path.

FME Flow 2023.2

IMAP email with client key

The automation runs successfully if there is a single attachment and configured to run email.attachment. The problem is email signatures and multiple attachments are present most of the time so I need to run email.attachements to get down to the xlsx I need to load.

Why do I get a permissions error on multi file, but not single file?



4 replies

Badge +7

Hi @skosty_fme, which part of the automation is reporting the error? Is it coming from the trigger or when trying to pass the email.attachements folder path to a downstream action? Are the attachments getting saved successfully in the Resources/Data/<subfolder> that you’ve specified in the trigger? 

email.attachements is going to return a folder path, so you’d need to specify the filename within it as well to any downstream action needing it. Or, if the downstream action is a workspace and you don’t know what the filename will be, you could list the contents of the folder (using something like the FME Flow Resource Connector) and then only process the file you need to import within your workspace.

Badge +1

Hi @mattmatsafe ,

Yes, the attachments successfully download to my specified folder, and after some trial and error I figured out a solution. Not sure if it’s the right best one though.

The automation now:

  • downloads the attachment
  • passes it to a Source folder and file pathname reader
  • Then to a filenamePartExtractor
  • Then attribute filter to get only the extensions I want to load
  • Then off to a FMEFlowJobSubmitter

Thanks for your response.



Badge +7

@skosty_fme, that will work too, instead of the FMEFlowJobSubmitter, I would pass the file path from workspace 1 back to the Automation using an AutomationWriter so it can be processed by workspace 2. 

We have an internal issue to add file extension filtering to the Email trigger, but it hasn’t been prioritized yet. The ID is FMEFLOW-22753 if you are interested.

Badge +1

@mattmatsafe , I have never used the AutomationWriter before so I’m going to check that out. Do you have any tricks to read Excel files dynamically? My issue is that the tab name is changing, but the schema is unchanged. The automations runs successfully but only loads data when the sheet is named as it was when the parameters were set. I tried feature readers, generic readers, adding excel resources and nothing seems to work.

Thanks again for your help.