Get exchange mail messages: unable to read mails containing password protected attachment

Hi All,

I am using get exchange mail messages and i mails containing attachment of different format (Excel, word, zip and pdf).
my automation is running fine until now, where i am getting emails with attachment containing password. i am not intending to open the attachment but just want to save this in a folder. seems like this activity does not work when the mail has password protected attachment. I cannot give password as there are many mails.

I am getting error get exchange mail message: one or more error occurred. (the attachment cold not be opened). (the attachment could not be opened)

it seems like this activity opens the attachment hence this error. Is there any alternative way to handle this.

Thanks.

@veeresh.p Get Exchange Mail Messages may fail when it encounters password-protected attachments because it tries to access the attachment while loading the email. Even if you only want to save the file, the activity can still throw this error before processing continues.

You can try handling it this way:

  • retrieve the emails first
  • save attachments in a separate step
  • wrap attachment handling in Try Catch so one protected file does not stop the whole run

i have used try catch .. I need the password protected file to be saved. is there any other way to just save the file in a folder so the downstream application can pick the file.

wondering how come UiPath cannot download the files which are password protected.

@veeresh.p Can you try below steps:

  1. Get IMAP Mail List activity: Fetch emails. Set the filter to narrow down to the specific email containing the PDF
  2. Use the Save Attachments activity within a For Each loop to save the PDF file to a local folder. Filter the attachments by “*.pdf” to only save PDF files
  3. Install the UiPath.PDF.Activities package if not already installed
  4. Use the Manage PDF Password activity
  5. Input PDF: Path to the downloaded protected PDF.
  6. Old Password: Enter the required password to open the file.
  7. Output File: Specify a new path to save the unprotected version (e.g., folder\unprotected_file.pdf).

Please let me know if it works or not