Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlook: Duplication of Sent Mail #2

Open
CodeMouse92 opened this issue Feb 16, 2021 · 8 comments
Open

Outlook: Duplication of Sent Mail #2

CodeMouse92 opened this issue Feb 16, 2021 · 8 comments

Comments

@CodeMouse92
Copy link
Contributor

Objective

Sent mails are duplicating in Microsoft-based email accounts, one per recipient, plus one created by Mailspring.

Testing Notes

This needs to be tested with Outlook accounts. There are plenty of reporters who can verify the fix (as can I).

Tips

The code responsible for moving mail to sent is in Mailspring-Sync/MailSync/TaskProcessor.cpp:1442-1536. I’m going to dig into a bit, and see if I can figure out what’s going wrong, as it is supposed to prevent duplication of sent messages.

References

https://community.getmailspring.com/t/duplication-of-sent-mail/275

@CodeMouse92 CodeMouse92 self-assigned this Feb 16, 2021
@Foundry376 Foundry376 deleted a comment from foundry376-bot Feb 16, 2021
@CodeMouse92
Copy link
Contributor Author

86421 [2021-02-16 14:31:20.295] [foreground] [info] -- No messages found. Sleeping 1 to wait for sent folder to settle...
86421 [2021-02-16 14:31:21.401] [foreground] [info] -- No messages found. Sleeping 1 to wait for sent folder to settle...
86421 [2021-02-16 14:31:22.508] [foreground] [info] -- No messages found. Sleeping 2 to wait for sent folder to settle...
86421 [2021-02-16 14:31:24.660] [foreground] [info] -- No messages matching the message-id were found in the Sent folder.
86421 [2021-02-16 14:31:24.660] [foreground] [info] -- Placing a new message with `self` body in the sent folder.
86421 [2021-02-16 14:31:24.765] [foreground] [info] -- Syncing sent message (UID 1355) to the local mail store

With Outlook-based accounts, findUIDsOfRecentHeaderMessageID() is failing.

        while (tries < 4 && uids->count() == 0) {
            if (delay[tries]) {
                logger->info("-- No messages found. Sleeping {} to wait for sent folder to settle...", delay[tries]);
				std::this_thread::sleep_for(std::chrono::seconds(delay[tries]));
            }
            tries ++;
            session->findUIDsOfRecentHeaderMessageID(sentPath, AS_MCSTR(draft.headerMessageId()), uids);
        }
    
        if (multisend && (uids->count() > 0)) {
            // ...
        } else if (!multisend && (uids->count() == 1)) {
            // ...
        } else {
            logger->info("-- No messages matching the message-id were found in the Sent folder.", uids->count());
        }

Still digging...

@CodeMouse92 CodeMouse92 transferred this issue from Foundry376/Mailspring Feb 16, 2021
@CodeMouse92 CodeMouse92 reopened this Feb 16, 2021
@CodeMouse92
Copy link
Contributor Author

Based on the logs, it was looking for UID 1355. However, according to later logs, UID 1356 was the correct UID for the message?

86421 [2021-02-16 14:50:30.745] [background] [info] syncFolderChangesViaCondstore - Sent: modseq 1426 to 1426, uidnext 1356 to 1356

@bengotow One possibility is that there's an off-by-one error with Outlook sent mail UIDs specifically. However, as I cannot yet build Mailsync on my Ubuntu machine (due to Mailcore2), I have no way to test. I think I'll have to pitch this your way now.

@CodeMouse92 CodeMouse92 removed their assignment Feb 16, 2021
@pmpakos
Copy link

pmpakos commented Jun 20, 2022

Hello. This problem seems to still exist. Is there any plan to fix it any time soon? Thank you

@DDZ-DO
Copy link

DDZ-DO commented Sep 5, 2023

Bump. Bug still exists. I use 3 outlook.com accounts with mailspring and is horrible that each mail is doubled.

@fusionice
Copy link

Also bumping, issue exists with 4 Outlook/Exchange accounts I have on latest version, Windows 10.

@prajjwal27
Copy link

Issue still persists on the latest version, Windows 11. Bumping.

@Dark-Witcher
Copy link

Wanted to flag that the issue still exists in the latest versions, both for Linux and Windows (I have in on an Arch Linux install and on Windows 11).

Can anyone just confirm that the recipients aren't getting multiple emails as a result.

@CodeMouse92
Copy link
Contributor Author

CodeMouse92 commented Nov 10, 2024

I haven't been part of the Mailspring project for some time, but I will say, I found the reason for this. Outlook already saves all sent messages server-side, so the client needs to not do the same. On Thunderbird (what I use now), I have to turn off "copy sent mail to Sent".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants