Save Attachment activity not adding extension in case of .eml and .msg file types

I have email with 2 attachments. one attachment of type .pdf and other one is .eml(outlook email message). I am using ‘Save Attachments’ activity to save to files to disk. If you look at downloaded files, .pdf is fine but in case .eml file, it is showing type is ‘File’ and not able to open. If I add .eml extention to file manually , I am able to open in outlook. The problem is when upload this file to some other CRM application, as extension not there, I am not able to open. Looks like ‘Save Attachments’ activity is having issue in case of .eml and .msg. Any body can help in this issue.
thanks in advance
Narasimha

Hi @Narasimha1

What is the version of the Mail activity package that you are using? Have you tried with the latest available version?

I am using the latest version of UiPath.Mail.Activities (v1.8.5). For your reference following is the file attached to mail. Its extension is .eml
Capture1

Following is the file downloaded to the folder by the ‘Save Attachments’ activity. Please see the type is ‘file’ instead of ‘.eml’
Capture2
Hope this will help. Thanks

It would seem like the latest available pack is this one:

Could you give it a try? :slight_smile:

I forgot to give one more input, before saving attachments with the ‘Save Attachments’ activity, I am using the ‘Get Mail’ activity from UiPath.MicrosoftOffice365.Activities (v1.4.0) to get email list. Today I tried with outlook activities and find this issue is not there. But even with UiPath.Mail.Activities (v1.9.3) I am having a problem with MicrosoftOffice365 Seems the problem with MicrosoftOffice365 activities, but not sure. Thank you for spending time and helping in resolving this.

Hi @Narasimha1,

It might be that the problem you are having is an issue known to us, but i am not really sure at this point. I will try to describe what the issue we have found is, and you can confirm it if the facts match your case.

It seems that when a email client sends a .msg attachment (this type of file is supported by Microsoft’s Windows based email clients and seems to be slowly phased out in favour of .eml, which is based on an open standard), Microsoft’s Graph api, which we are using in our Microsoft Office365 activity pack does not return a MimeType for that attachment. This means we don’t actually know what type of attachment it is, only that it’s a file with a name (the name lacks the extension).
Not only that, but the .msg file, which is binary, is converted to a .eml server side (the .eml is a text file).

You can double check what i am saying by confirming the following:

  1. Email yourself using a .msg attachment and then download the attachment using the outlook web client (Pay careful attention at the file when it arrives, it seems sometimes the .msg is converted to .eml server side - weird). You will notice the effects will be the same (it will have no extension but if you rename to .eml it will work).
  2. Email yourself using an attachment saved with a .eml extension and then use the MicrosoftOffice365 activities to read the email, and the Save Attachments activity to save them. You should have the file with the proper extension (.eml) and be able to open it right away.

If both these facts are true you are in this situation.

The easiest workaround if you are in this predicament is to simply rename the file to .eml once you download it.
The correct and long term solution is either to send the email you are trying to read as an .eml and not a .msg or wait for Microsoft to fix this server side issue.

Again, this might not be your scenario, but it seems like it is.

1 Like

Thank you for your detailed reply. My exact problem is if I have an email attachment as .eml or .msg file extension, the ‘Save Attachments’ activity is not downloading with proper extensions.
For example, if I have an email with an attachment with the file name as ‘TestAttach.eml’, when I use the ‘Save Attachment’ activity to download to disk, it is downloading without extension i.e it is downloading as ‘TestAttach’ with file type as ‘File’
The same problem exists with ‘.msg’ files also. But no problem for other file types.
Below is a screenshot for email attachment with extension .eml,
image
Below is the screenshot after performing ‘Save Attachment’ activity,
Capture2
Please look at file type.

I am using below package versions,
UiPath.Mail.Activities - v1.9.3
UiPath.MicrosoftOffice365.Activities - v1.4.0
Studio 2020.4.1 Enterprise License

Hope I am clear. Thank you for your time