Defects

NS: SMTP. OAuth2. Difficult to troubleshoot "Failed to connect to email server" errors



ID:    D28019
Published:    21 September 2023
Updated:    20 May 2024
 

Defect Id

DEF348870

Originally Reported Against

SBM 12.1

Also Affects

SBM 12.1 Hotfix 1
SBM 12.1 Hotfix 2
SBM 12.1 Hotfix 3
SBM 12.1 Hotfix 4
SBM 12.1 Hotfix 5

Resolved In

SBM 12.2
SBM 12.2 Hotfix 1

Description

When configuring SBM to talk to an SMTP server, there are often issues with setting up the mailbox and/or AppRegistration in O365.  When this happens it is hard to identify a reason why mail server throws AuthenticationFailedException.  

As an example, a snippet from NS.LOG when attempting to connect to SMTP server may look like this. Notice there is little information in the error message:

2023-09-15 18:30:25,982 ERROR [QuartzScheduler_Worker-34] [com.serena.core.email.MailSendManagerImpl:362] [::] -- Failed to connect to email server.
javax.mail.AuthenticationFailedException: failed to connect
at javax.mail.Service.connect(Service.java:403) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:246) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:195) ~[javax.mail-1.6.2.jar:1.6.2]
at com.serena.core.email.MailSendManagerImpl.sendEmails(MailSendManagerImpl.java:305) ~[common-util-12.1.jar:?]
at com.serena.sbm.ns.service.MailSenderImpl.lambda$0(MailSenderImpl.java:104) ~[notificationsrv-api-12.1.jar:?]
at java.util.HashMap.forEach(HashMap.java:1290) [?:1.8.0_342]
at com.serena.sbm.ns.service.MailSenderImpl.send(MailSenderImpl.java:95) [notificationsrv-api-12.1.jar:?]
at com.serena.sbm.ns.service.EmailMessageStrategy.apply(EmailMessageStrategy.java:414) [notificationsrv-api-12.1.jar:?]
at com.serena.sbm.ns.process.EmailMessageServiceImpl.processMessages(EmailMessageServiceImpl.java:112) [notificationsrv-api-12.1.jar:?]
at com.serena.sbm.ns.process.MessageServiceImpl.process(MessageServiceImpl.java:101) [notificationsrv-api-12.1.jar:?]


Resolution

We have added better logging to assist.

Find Answers

Type a question or describe what you are looking for below

My Recent Searches

Welcome kb sso

Additional Assistance

  • Submit a Case Online
  • FAQs