Mail Fetching issue due to Unrecognized SSL exception!

Mail Fetching issue due to Unrecognized SSL exception!


Error Trace:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)







Exception from UI:
FAILURE  :E- mail settings saved successfully. But error occurred while trying to check connection with mail server - Problem connecting to mailbox



.




Symtoms :

Telnet on Port 993 returns the message "BYE Connection is closed. 14 Connection to host lost"








Cause :

Mail server configured in Admin -> Mail server
Settings -> Incoming does not have a valid SSL certificate assigned to IMAP or POP services even though the mail server has got the SSL certificate installed, therefore when trying to communicate via IMAPS on port 993 it's unable to recognize the SSL certificate from it.










Solution :


1. Go to Exchange Console -> Server Configuration -> Click on the Mail server name -> Select a certificate from the list -> Assign a certificate to IMAP, POP and SMTP services. 

2. Restart the respective services from services.msc

3. Alternatively, the same steps can be performed via PowerShell window, 

To get list of Certificates installed
in
the server,


[PS] C:\Windows\system32>Get-ExchangeCertificate

Thumbprint Services Subject
---------- -------- -------
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy .P.... CN=exch2010fe1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx I..W.. CN=webmail.example.com, OU=Domain Control Validated, O=webmail.ex...


To assign a certificate
for
IMAP service. Copy the valid certificate's thumbprint from the above output and apply it in the below command.


[PS] C:\Windows\system32>Enable-ExchangeCertificate -ThumbPrint xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -Services IMAP -DoNotRequireSSL

                  New to ADSelfService Plus?

                    • Related Articles

                    • Mail sending failed_ Unrecognized SSL message, plaintext connection?

                      Log error trace: Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587;   nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? Solution: Error trace means ...
                    • List of mail fetching issues and solutions

                      Scenario 1 : Mail fetching issue due to Invalid or No PKIX certificate .   Log traces for Mail Fetching  issues Exception when connecting to store.|javax.mail.MessagingException: sun.security.validator.ValidatorException: PKIX path building failed: ...
                    • Fix JAR for Parse Error Exception Raised during Mail Fetching

                      Issue : Some mail are fetched and created as ticket without description due to message corruption temporarily. The issue is can be identified with the below trace. Fix : The issue is not recreated when the mail is skipped to next schedule and fetched ...
                    • Mail fetching - deleted flag issue

                      This message will be thrown, when you have provided a shared mailbox. The concept here is, SDP MSP reads the mail from the configured mailbox and adds it as a request. During the time, if some other application fetches the mail from the same mailbox ...
                    • Mail Fetching - Error while processing attachment and inline image.

                      Issue During the process of fetching emails, attachments are dropped as a result of the presence of directory traversal characters. Furthermore, an issue arises when processing inline images, this particular error related to inline images results in ...