Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Troubleshooting/Error resolution

Fixing external mail source issue with Office 365 email connection

Last updated on 28 February 2021

Admin
Connections to External Mail Sources (Integrated)

Overview

You might sometime get the following error while configuring external mail source in M-Files following user guide for Mail Sources. The example includes a scenario using Office 365 email.

"An existing connection was forcibly closed by the remote host"

Configuring Mail Sources in M-Files:
https://www.m-files.com/user-guide/latest/eng/Connections_to_external_sources_Mail_sources.html
 

Solution

This issue occurs mostly when the required port for email communication is not open in M-Files server or Firewall (OS level or network) is blocking the connection. Hence M-Files can't communicate properly with the email server (e.g. Office 365) and mail source fails.

First, you need to figure out which port is being used by mail source. You can see the port number in mail source configuration properties in M-Files admin, varies depending on your mail server type (provider's incoming server) and encryption level. For Office 365 IMAP mail type, used ports are 143(Non-SSL) and 993(SSL/TLS) for incoming mail (see MS documentation for details). When you are facing the above-mentioned issue after configuring mail source, first you need to figure out what's blocking the communication. 

Try using ping, tracert, checking the port and telnet to the mail server (screenshots). Also, check your if there are some rules in the root Firewall blocking port 993/143 for M-Files server. Try allowing incoming and outgoing communication for the port (e.g. 993) in Firewall. Also, check that your Office 365 outlook account has IMAP enabled. It might take a while after you enable the IMAP settings for your account to be effective.

In Windows command prompt run the following command to check if the port is listening: netstat -a -n


Figure 1: Ping Office 365 outlook server.

 
Figure 2: Tracing route to Office 365 outlook server using tracert.

 
Figure 3: Telnet to Office 365 outlook server.

POP and IMAP email settings for Outlook
https://support.office.com/en-us/article/pop-and-imap-email-settings-for-outlook-8361e398-8af4-4e97-b147-6c6c4ac95353


 

Still need help?

On this page