Question

Automation with Email Received(IMAP) returning a csv attachment as part of the body of the email.

  • 11 October 2021
  • 6 replies
  • 13 views

Badge +1

Like the title says I want to take the csv file and store it in one of my resource folders but nothing ever gets written because the CSV contents show up as the body not the attachment.


6 replies

Userlevel 1
Badge +6

Hi @kschultz​ ,

Were you able to configure the last parameter of the Email (IMAP) trigger to download attachments to the resource folder? I tested out with a csv file and the attachment was placed in the Data folder on my FME Server successfully. EmailAttachmentFolder CSV

Badge +1

Hi @kschultz​ ,

Were you able to configure the last parameter of the Email (IMAP) trigger to download attachments to the resource folder? I tested out with a csv file and the attachment was placed in the Data folder on my FME Server successfully. EmailAttachmentFolder CSV

2021-10-13 10_13_12-Automations - FME ServerSo I have that filled out and the folder I'm writing to is empty.

 

In the log file the body is displaying the CSV contents the attachments is empty.

Userlevel 1
Badge +6

Can you try forwarding the email with the csv attachment to see if FME picks up the attachment properly? This post has a similar issue where the attachments were found in the email body and their workaround was to update their workbench to look for email body.

Are you able to share the log file with the output keys email.body and email.attachement?

Userlevel 1
Badge +6

@kschultz​ Just a couple questions:

  • What version of FME Server are you using?
  • Does this only occur with csv file attachments? Any other formats?
  • What does the csv attachment look like in the email server?
Badge +1

@kschultz​ Just a couple questions:

  • What version of FME Server are you using?
  • Does this only occur with csv file attachments? Any other formats?
  • What does the csv attachment look like in the email server?

FME Server 2021.1.1

Build 21619 - win64

I sent some test emails from external and internal sources using different formats and they are all being read.

 

I checked the headers in outlook I'm not sure what exactly I was looking for through there but the one thing I noticed is on the emails the problem is occurring on is there is no attachment flag in the emails.

 

It seems to be happening with the generated emails I'm receiving from another company. I don't have any control over how they are being sent out.

 

So my next thing since I can't download the file/pass the file through to a workbench can I pass the body(which contains the csv) to actually generate a csv file in workbench to work with the data being received?

 

I'm not going to display the data I'm receiving but you can clearly see the headers are available in the body variable.

2021-10-14 09_53_52-Automations - FME ServerThe ending of the body always end with this

 

2021-10-14 09_55_53-Automations - FME Server 

 

Userlevel 1
Badge +6

FME Server 2021.1.1

Build 21619 - win64

I sent some test emails from external and internal sources using different formats and they are all being read.

 

I checked the headers in outlook I'm not sure what exactly I was looking for through there but the one thing I noticed is on the emails the problem is occurring on is there is no attachment flag in the emails.

 

It seems to be happening with the generated emails I'm receiving from another company. I don't have any control over how they are being sent out.

 

So my next thing since I can't download the file/pass the file through to a workbench can I pass the body(which contains the csv) to actually generate a csv file in workbench to work with the data being received?

 

I'm not going to display the data I'm receiving but you can clearly see the headers are available in the body variable.

2021-10-14 09_53_52-Automations - FME ServerThe ending of the body always end with this

 

2021-10-14 09_55_53-Automations - FME Server 

 

Right, I believe it may have something to do with the company's email set up in Rich Text Format rather than in Plain text.

 

You can try setting up a workspace with Creator > ParameterFetcher > CSV Writer.

  • Have the ParameterFetcher to fetch the email.body output key from IMAP and write out the body to a csv file.
  • Attach the workspace to run after the IMAP trigger.

This may require some configuration based on the email body and how the csv is attached.

Reply