Question

How do I copy email attachments from one their landing folder to another folder using the email attachments folder parameter passed by the imap email watcher in automations?

  • 15 September 2021
  • 1 reply
  • 6 views

Badge +1

I want to route data attached to an email from within an automation that is triggered by receiving an IMAP email. I’m willing and think I would find it preferable to simply dump the email watcher’s event JSON into a file in a directory and then use another automation to watch that directory for new email event JSON files and process from there. However, the FileCopy writer fails copying from the path parsed from the event JSON (FME Server has permissions to the folder.)

 

Here’s the workflow:

  1. Take as input the email watcher’s event JSON
  2. Parse the event JSON for the email attachment folder
  3. Copy the files in the email attachment folder to another folder.
    1. Eventually I will route attachments to different folders based on from address and subject, but I can’t get the copy to work right now.

 

The copy fails, I think, because the FileCopy writer can’t understand the FME Server shared resource macro parameter $(FME_SHAREDRESOURCE_DATA) in the path for the email attachment folder.

 

I’ve attached a workspace with email event JSON source data and its log file to show the error. 

 

If FileCopy doesn’t work, then what will?  Or, how to I get it to work?

 

I broke down and tried to read the file with a FeatureReader just to write it with a FeatureWriter, but I ran into the same problem with the FME Server parameter.


1 reply

Badge +2

Haven't tried this... but I wonder if this could work using a couple of FMEServerResrouceConnectors?

 

When you connect to a resource using this transformer the path starts with FME_SHAREDRESOURCE_DATA/filesy so it might help you get started on this. Possible you'll need to use 2 FMEServerResourceConnectors... 1 to list and 1 to upload to the new directory.

Reply