microsoft / microsoft/mfcmapi

Access violation when importing MSG

Open
#608 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
978
Forks
170
Avg merge
1d 3h
Merged PRs (30d)
5

Description

I am trying to import MSG file(s) into a folder of an Internet Folders store (an IMAP account). When I open the target folder and execute Folder > Import > From MSG... with Load message into current folder style, MFCMapi throws access violation at:

https://github.com/microsoft/mfcmapi/blob/2973607bfd344912a368f0148990d616c617f1a6/core/mapi/mapiFile.cpp#L128

with the following call stack:

PSTPRX32.DLL!CImapSyncManager::HrSyncFolder(struct _feid *,struct IMAPIProgress *,int,int,unsigned long *)
PSTPRX32.DLL!CIMAPFolderProxy::EmIIMAPFolder::OnFolderChanged(void)
PSTPRX32.DLL!CIMAPMessageProxy::OnFolderChanged(void)
PSTPRX32.DLL!CIMAPMessageProxy::EmIIMAPMessage::CheckPoint(unsigned long)
PSTPRX32.DLL!CIMAPMessageProxy::SaveChanges(unsigned long)
MFCMapi.exe!file::LoadFromMSG::__l14::<lambda_2>::operator()()
MFCMapi.exe!file::LoadFromMSG(const std::wstring & szMessageFile={...}, IMessage * lpMessage=0x000002788542cb08, HWND__ * hWnd=0x00000000000f0c20)
MFCMapi.exe!dialog::CFolderDlg::OnLoadFromMSG::__l18::<lambda_2>::operator()()

Interestingly the message does actually appear in the store and I can see it in the Outlook, however, restarting MFCMapi and logging into a session after each file is slightly inconvenient, as I have thousands files to import.

Anything I can do? I tried to pass various flags to SaveChanges but it did not help.

(I can drag & drop the MSG files into the folder using Outlook, however, they will have received dates of the import, not of the original files.)

MFCMAPI version 16.0.0.1044
Outlook Version: 16.0.16811.20004

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at core/mapi/mapiFile.cpp line 128 and trace file::LoadFromMSG through SaveChanges using the provided call stack. Reproduce the import into an IMAP folder with “Load message into current folder” and compare behavior with Outlook drag-and-drop. Done means importing multiple MSG files without an access violation or restarting MFCMAPI, while retaining the original message dates.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.