nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.8k stars 1.39k forks source link

Nylas storing extra copy of sent message in Sent folder #2695

Open bengotow opened 8 years ago

bengotow commented 8 years ago

As reported in: https://nylas.zendesk.com/agent/tickets/5141

whadibrata commented 8 years ago

I have only realized this bug today after sending many duplicate emails over the last two days. Until the bug is completely resolved, I think the simple solution is to disable link tracking and open tracking.

yishus commented 8 years ago

+1

it's not showing on N1 that multiple emails are sent out. But it shows up when I am on gmail web app/mobile app.

smacking commented 8 years ago

+1

hmnd commented 8 years ago

+1

stolinski commented 8 years ago

+1

smacking commented 8 years ago

The main question is: are people really receiving our emails in duplicate? On "Sent Mail", that's what I see, but I am not sure if that's really happening...

grinich commented 8 years ago

My hunch here is that the sync engine is NOT actually sending two messages— it's sending a single message but then ALSO saving a second message to the sent folder.

This behavior is needed for many old-school IMAP mail servers which don't automatically create a message in the Sent folder when you actually send something. (Remember, traditionally IMAP and SMTP servers operate on different hosts.) To compensate for this, clients like Mail.app will have actual settings for whether to save mail on the server. image

The is no actual API for determining whether an SMTP server will automatically store a copy of the sent message in the user's mailbox Sent folder. I believe we have this hard-coded in our settings for the sync engine per-provider. e.g. We don't create a copy in the Sent folder for Gmail because we know it does that automatically.

Our current sending behavior does this:

  1. Send
  2. (Optionally) Save a copy to Sent folder

We need to change it to this:

  1. Send. Keep track of the Message-Id for what we sent
  2. Wait a few moments
  3. Check the Sent folder
  4. Only create a copy of the sent message if a message with the previous Message-Id does not exist in that folder.

This should eliminate the "double sending" issue that people are reporting.

If we are actually sending two messages, that is another issue that we really need to resolve as well.

jstejada commented 8 years ago

@grinich oh interesting, this was also reported here: https://github.com/nylas/N1/issues/2709

grinich commented 8 years ago

@jstejada yeah — I really feel that we shouldn't make it optional for saving an item to the Sent folder. Unchecking that box accidentally just confuses people. There should always be one message saved to the Sent folder... but never two.

jstejada commented 8 years ago

Yeah definitely, makes sense -- merging that issue into this one and updating the sync-engine issue

emorikawa commented 8 years ago

This is related to https://github.com/nylas/N1/issues/1457 and https://phab.nylas.com/T6958

bengotow commented 8 years ago

Reported by another user today via ZenDesk. Internal link: https://nylas.zendesk.com/agent/tickets/6172