Overview
When trying to import documents from an email source, the following error may occur.
An e-mail message was not imported from the external source "Source Name (outlook.office365.com)", because its structure was damaged. File operation error. Access is denied. ExternalFileMonitor.cpp, 3553, An e-mail message was not imported from the external source "Source Name (outlook.office365.com)", because its structure was damaged. (0x8004089C) ExternalFileMonitor.cpp, 3553, File operation error. (0x80043812) EasyMailWrapper.cpp, 1222, File operation error. (0x80043812) CoMessageParser822.cpp, 127, File operation error. (0x80043812) CoMessageParser822.cpp, 127, Access is denied. (0x80070005) (M-Files <version> <timestamp>)
The key line in the error message is
CoMessageParser822.cpp, 127, Access is denied. (0x80070005)
Solution
This is because M-Files Sever Auxiliary Service does not have access to create temp files at the File Data location. Changing the Location of the Vault File Data for Microsoft SQL Server
M-Files Server downloads the emails from the external source while the M-Files Server Aux service is responsible for parsing those emails by creating temporary files.
In the environment where the above error occurred, the File Data location is placed in a network drive and the M-Files Server service was running under a specific gMSA account but the M-Files Server Aux service was not.
M-Files Server Aux service throws the above Access Denied error.
The resolution if this occurs is to set the M-Files Server Aux service to run on the gMSA account that has access to the filedata location just like was set for the M-Files Server service.
