ServiceNow inbound email (IMAP) cannot connect to Exchange Online but SMTP is fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
The ServiceNow Production instance (mycompany.service-now.com) cannot read the mailbox servicedesk@mycompany.com over IMAP. Outbound email (SMTP) from the same mailbox works.
Configuration (ServiceNow side):
Checks Inbound (failing) Outbound (working)
Email account BG_IMAP (sys_id xxxxxxxxxxxxx) BG_SMTP
Protocol IMAP SMTP
Server outlook.office365.com outlook.office365.com
Port / security 993 / SSL (implicit) 587 / STARTTLS
Authentication OAuth 2.0 (profile "BG SNOW Prod Mailbox default_profile") OAuth 2.0
Token status Valid, refresh token expires 05-02-2027 Valid, expires 05-02-2027
Test Connection Failed Successful
Error:
Couldn't connect to host, port: outlook.office365.com, 993; timeout 20000; Using socket factory class com.glide.certificates.DBKeyStoreSocketFactory
Debug log (2026-10-29, instance time):
09:58:19.975 IMAP: trying to connect to host "outlook.office365.com", port 993, isSSL true
09:58:20.007 Couldn't connect to host, port: outlook.office365.com, 993; timeout 20000
Analysis so far:
The connection fails after 32 ms, not after the 20-second timeout. That points to an active rejection or a TLS/handshake failure, not a silent packet drop.
Authentication is never reached. The OAuth token has been re-authorized [done] and the result is the same. This is not a token or password issue.
SMTP (587/STARTTLS) to the same host with the same type of OAuth setup works, so general connectivity between the instance and Exchange Online is fine. The problem is specific to IMAP on 993 (implicit SSL).
Account configuration verified: server, port 993, SSL, OAuth profile, mailbox user.
IMAP over port 143 / STARTTLS test: [failed]
