the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
1.02k stars 122 forks source link

Message was sent but not saved to sent items folder #1432

Closed gnilebein closed 8 months ago

gnilebein commented 8 months ago

Describe the bug When I send e-mails, they are not stored in the "Sent" folder. I think there is a bug which is related to this change: https://github.com/the-djmaze/snappymail/issues/1404

If you define a "Sent" folder in the identity, they will also be saved there. However, if you have selected "Standard" there, they will not be saved!

I have verified this in two different Nexcloud installations.

To Reproduce Steps to reproduce the behavior:

  1. Create new Mail
  2. Send it
  3. Check Sent-Folder
  4. Mail not visible there

Expected behavior Mails should be placed in Sent folder.

Please complete the following information:

mmallejac commented 8 months ago

Having the same one here , also on 2 Nextcloud installation (both Nextcloud 28.0.2)

Done some testing with another webmail and Thunderbird : messages sent has been saved into sent items folder as expected.

We also use the MailboxDetect plugin (latest is 2.6) so that also may interfere here.

Please advise !

codiflow commented 8 months ago

Can confirm what @gnilebein mentioned and I don't use a Nextcloud installation. I have the same issue here which is fatal because the sent mails seem to be gone forever 🙈

Unfortunately I have to roll back as this version does not seem to be production ready with such a bug 😥

codiflow commented 8 months ago

A little workaround until a fix is available would be to check the box "Place replies in the folder of the message being replied to" and move it manually to the Sent folder after being sent. But new messages without a reply are still being moved into the void.

gnilebein commented 8 months ago

A little workaround until a fix is available would be to check the box "Place replies in the folder of the message being replied to" and move it manually to the Sent folder after being sent. But new messages without a reply are still being moved into the void.

I think a better workaround is, to set the folder in your identity. This covers all scenarios. 2024-02-14 13_46_41

xpresas commented 8 months ago

Same problem. Current workaround by @gnilebein works.

stan2k commented 8 months ago

Same here. The workaround works only in Nextcloud. Without Nextcloud is useless. All the folders are set, available and visible. It is possible to manually copy a message to Sent. But outgoing messages are not being saved. No errors, no warnings, Snappy just does not attempt to.

KuasarCloud commented 8 months ago

hi...is there any way to recover those sent emails, for us it's critical. I can set this parameter globally, I have more than 100 emails to configure identity

the-djmaze commented 8 months ago

I will fix this in a few hours. Stay tuned!

KuasarCloud commented 8 months ago

@stan2k did you were able to copy them to sent?

stan2k commented 8 months ago

@KuasarCloud I just tried to drag random message form Inbox to Sent. Just to test, whether Sent folder is writable.

KuasarCloud commented 8 months ago

got it @stan2k, I guess the not saved emails by snappymail are lost forever, right?

the-djmaze commented 8 months ago

I guess the not saved emails by snappymail are lost forever, right?

Correct, for your mailbox. Recipient does have them though.

As for the bug

Sorry, i didn't notice why it failed.

  1. The property sentFolder is a KnockoutJS observable.
  2. Observables are functions.
  3. I added toJSON to the observables so that JavaScript can easily use the value inside JSON.

So what actually happened is:

var sentFolder = identity.sentFolder;
if (sentFolder) {
    // Yes we have it defined, but oops it is the function not the value.
    sentFolder.toJSON(); // oops it is empty
}

While it should be

var sentFolder = identity.sentFolder(); // now we get the value
if (sentFolder) {
    // Yes we have the right value!
}

@gnilebein workaround works because then sentFolder.toJSON() returns the set non-empty value.

codiflow commented 8 months ago

Thanks for being completely transparent and clarifying what led to the bug 🎉

And also a big thanks for fixing this so fast! Big Thanks! 🙏

KuasarCloud commented 8 months ago

@the-djmaze thanks for your help and explaining what happened. When do you expect to have uploaded to download it from Nextcloud.

the-djmaze commented 8 months ago

When do you expect to have uploaded to download it from Nextcloud.

It is submitted to Nextcloud, it could take minutes up till 1 day (i think) but that is a Nextcloud website thing. So i deleted the snappymail-2.34.0-nextcloud.tar.gz and snappymail-2.34.1-nextcloud.tar.gz from my server to prevent people downloading the bugged versions.

KuasarCloud commented 8 months ago

Working well in Nextcloud