IMAP access to mail account fails


I have used an IMAP activity with the following parameters

  • MailFolder “Posteingang” / “Inbox”
  • Port 993
  • SecureConnection “StartTlsWhenAvailable”

to connect to an IMAP mail account. It tries for approximately 40 seconds and the returns the error code “The IMAP Server has unexpectedly disconnected” (Exception Type: ImapProtocolException).

When I use the same settings on the same PC with a thunderbird mail client it works fine and all mails could be read… and Telnet connection to the server / port is also ok.

Unfortunately my collegues from the mailing Team have no clue what is the cause.

Any help appreciated,

I am having same problem of “The IMAP Server has unexpectedly disconnected” (Exception Type: ImapProtocolException). …do you know how to configure it

1 Like

unfortunately I still have no idea how to solve the problem.
I guessed it could be a firewall issue but got no confirmation / solution…

Problem still exists…

Hello UiPath Team and other UiPath Experts!!!

It looks as problem existed already for a couple years.
Please somebody help us with this problem?

Thank you,

Hi @river1

Could you post more information?

  • Studio version (CE or EE)?
  • Mail activity package version?
  • particular situation with some screenshots and a full error message
  • have you tested it for more than 1 mailbox and with any potential antivirus whitelisted?

Hi Maciej,

Thank you very much for the prompt reply. That is very
important project and been working on this for long time.

I tried to run file in different variation in ports setup,
passwords, Gmail and tried with disabled Kaspersky Total Security.

Please see below list of screenshots.

Studio version - 18.4.1

Mail Activities – 1.3.0

Please see screenshots below:

Runtime error,

b. Error Log

Output Step Into error


Please let me know if need more information.

Please let me know if you have different solution to this problem.

Thank you,


Deleted: Attachment Error

Hi Maciej,

Sorry, I forgot screenshots of two Output detailed files. Please see attached.


Hi @river1 @Claudius @govind_bisht

I tested it for a bit and my finds are that this property should be set to Auto for this to work. It will not work with either “StartTlsWhenAvailable” nor “None”.

Let me know if it fixed it for you. I got the exact same error message when it was not set to Auto.


Hi Maciej,

I tested using “Auto”. Now I get different error message:

–Message: The remote certificate is invalid according to the validation procedure.

–Exception Type: System.Security.Authentication.AuthenticationException

I verified my IMAP and POP. I also confirmed that my Google account set on less secure.

I also tried another IMAP port 143 with different security options from “None” to “StartTlsWhenAvailable”. But it did not work.


Could you maybe see this thread for possible solution:

1 Like

Have you been able to resolve the problem. I am facing exactly the same issue.
Kind regards

Sorry, I was busy with different project and could not check your suggestion.
I am using Studio. I tried to manipulate SSL using Internet Property – Certificates Options but it did not work. However I am completely rookie.
It would be nice to have detailed SSL setup solution for the Studio.
Thank you,

Unfortunately this problem still not resolved.

Is there any solution for this?

I solved the problem by adding this email to Outlook.

I solved this by pausing antivirus running in the machine.


I have followed the mentioned solutions but the problem still exists… :roll_eyes:

1 Like

Update package of Uipath.Mail.Activities