List of mail fetching issues and solutions

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: PKIX path building failed: unable to find valid certification path to requested target;
nested exception PKIX path building failed: unable to find valid certification path to requested target


[com.adventnet.servicedesk.notification.util.NotificationFactory]|[INFO]|[46]|: The contenttype has been set in the message|: javax.mail.MessagingException: Exception reading response;
nested exception is: java.lang.RuntimeException: Could not generate DH keypair|


Log traces for Mail Sending  issues

[com.adventnet.servicedesk.notification.action.SDNotifyAction]|[SEVERE]|[73]|: Exception while trying to send notification for Request ID : 26|com.adventnet.servicedesk.ServiceDeskException: Mail sending failed.
Caused by: javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is: PKIX path building failed: unable to find valid certification path to requested target


Root Cause

When the email type is set to POPS or IMAPS, the mail server of ServiceDesk Plus stops fetching emails. ServiceDesk Plus needs to be installed with a secure certificate so that the emails are fetched in a secure way.


Workaround/Solution :

Click here to find the instructions to install the mail server certificates into ServiceDesk server

Scenario 2 : Mail Fetching & Sending Issue due to Invalid no Relay connector.

Log Trace :

Caused by: javax.mail.SendFailedException: Invalid Addresses; 
nested exception is: 
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for

Root Cause :

1. The main reason we get the issue is that the outgoing mail server settings could not identify the sender.
2. There are some issues while authenticating the sender on the server and thus restricting them to send emails.
3. The receiver domain's recipient policy has imposed restrictions on sender's domain or the exchange database is corrupt.

Solution :

This issue revolves around the Exchange server which will not allow the ServiceDesk Plus application to fetch the emails. Hence, this is an issue related to the email exchange & not with ServiceDesk Plus. If we get a scenario where the customer is not aware of this issue, then in such cases, you need to relay off the Exchange server by allowing application servers. You have to implement some relay restrictions on the virtual server. The application event log stores the error list that occurs in the Exchange environment. You can view the event log. Ongoing through the error causing aspect we can then find its solution accordingly.

Scenario 3 : Mail Sending Issue due to E-Mail Access Denied 

Log Trace: 

Caused by: javax.mail.SendFailedException: Invalid Addresses;
nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1<unknown[]>: Client host rejected: Access denied 

Root Cause : 

This error comes when the sender address or host address is blocked on your server. Generally, this is done if spam has originated from this user.

Solution : 

This is an email exchange related issue. When ServiceDesk Plus uses the email address which might be configured in spam, then the application fails to send emails out of the application. Hence, the only possible solution to this issue is to remove the email address from the Exchange Client Spam filter and hence allowing the email address to send & receive emails. 


Scenario 4 : Email Fetching failure due to Authentication 

Log Trace :

[com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask]|[SEVERE]|[26]|: Exception when connecting to store.|javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
at com.sun.mail.imap.IMAPStore.protocolConnect(

 Caused by: javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(


Root Cause :

1. Username or password might be incorrect.
2. Password expired

Solution :
Provide the correct username or password in the incoming mail server settings of ServiceDesk Plus. If the password has expired, change the password related to the email address configured on the exchange and then configure the same in ServiceDesk Plus application.  
Tip: You can have the password in 'never expires' state in the Active Directory so that the issue due to password expiry does not repeat again.


Scenario 5: Email Fetching/Sending Due to Connection timeout 

Log Trace :

Exception when connecting to store.|javax.mail.MessagingException: Connect failed;
nested exception Read timed out
Caused by: Read timed out
at Method)


Root Cause :

  1. The issue mainly occurs when there is no proper connection being established between the ServiceDesk Plus server and the Mail Exchange Server.
  2. Intermittent Internet connection on the servers.
  3. Network problem in the customer's environment.



 Need to educate the customer on providing a connection between both the servers (ServiceDesk Plus & Mail Exchange). Doing a telnet from the application server to the exchange server port on which the mail server configuration is done. If the connection is established, the issue will be resolved on saving the mail server settings in ServiceDesk Plus.

If the issue still remains & gives us the same error trace, we can ask the customer to check the network as this issue deals with network connectivity between the 2 servers (ServiceDesk Plus & Mail Exchange).

Scenario 6: Email fetching/sending due to 'Unrecognized SSL message'

Log Trace: Unrecognized SSL message, plaintext connection?
at 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.

Root 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. 

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


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.., OU=Domain Control Validated, O=webmail.ex...

To assign a certificate

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

                      • Troubleshooting Oauth configuration for mail server settings

                        Oauth in ServiceDesk Plus / AssetExplorer for Mail SDP supports Oauth configuration for Office365 and GSuite mailboxes since 11106 build. Office365 mailboxes can be configured with Oauth authentication using EWS (since 11106) and IMAP / SMTP (since ...
                      • Mail Fetching: Inline Images Dropping Due to Invalid Extension

                        Issue: The inline image's file name from the email doesn't contain the extension. Example: filename = sys_attachment.dosys_id=5bb0751c8303b5dc96a238226daad371 As a result, the inline image gets stripped during the mail fetching process. The sender of ...
                      • 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 ...
                      • Mail Fetching issue due to Unrecognized SSL exception!

                        Error Trace: Unrecognized SSL message, plaintext connection? at Source) Exception from UI: FAILURE  :E- mail settings saved successfully. But error ...
                      • Fix: Failed to parse To/Cc address while fetching mails using Graph

                        Issue: If the To / Cc address contains the email address in the format "Test, SDP" <> (containing "," character in the email address itself), then parsing of such addresses using Microsoft Graph fails in SDP. If such address is a support ...