Closed filly82 closed 1 year ago
That's interesting. Can you share the used IMAP server?
sure, whatever you need. it is "Dovecot", here are the first lines from the logging output
flutter: A: connecting to server xxx.xxxxx.xx:993 - secure: true, timeout: 0:00:10.000000
flutter: S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.
flutter: C: a0 LOGIN "xxxx@xxxx.xx" "(password scrambled)"
flutter: S: a0 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in
flutter: C: a1 ID NIL
flutter: S: * ID ("name" "Dovecot")
flutter: S: a1 OK ID completed (0.001 + 0.000 secs).
flutter: C: a2 ENABLE QRESYNC
flutter: S: * ENABLED QRESYNC
flutter: S: a2 OK Enabled (0.001 + 0.000 secs).
Thanks, with Dovecot we can rule out any strange-behaving mail server. Have you selected a different mailbox while issuing the above commands?
now that you mention it, i have already assumed that it has something to do with the folder because it is not in INBOX but next to it. just forgot to test it, now i did and it works when it is within INBOX
Hopefully this can be fixed, because i only need to delete mails in that one special folder called 'Notes'
does not work here:
flutter: C: a4 SELECT "Notes"
works here
flutter: C: a4 SELECT "INBOX.FTagged.Wohnung"
Thanks. Can you rule out that you have selected a different folder while issuing these commands? Despite it's name, a UID is only a mailbox-specific ID, so the corresponding folder needs to be selected. The "only" benefit of a UID is that the UID stays the same, even after messages before have been deleted - in contrast to sequence IDs, which do change in that case.
If you can rule that out, what is the server response when selecting the Notes mailbox?
there you said it.
I did not explicitly select the folder/mailbox because I specified mailbox here
client.fetchMessages(mailbox: mailbox);
and the doc says
Optionally specify the mailbox in case none has been selected before or if another mailbox/folder should be queried.
but now that I did, it works. THANK YOU
await client.selectMailboxByPath(folder); // <-- this did the trick
await client.deleteMessage(messageEntry.key, expunge: false);
still don't know why it worked when I just replaced folder 'Notes' with 'INBOX.FTagged.Wohnung'
Thanks, this seems very much to be a bug in the API, because fetchMessages
should then select the corresponding mailbox. I will check this and report back within the next days.
Glad that you found a workaround!
Hi again, I did not find a problem with mailbox selection when fetching messages. The used mailbox should have been selected correctly after issuing the fetchMessages
call. However, I simplified the code and released v2.1.4, which also adds some more fixes and improvements. Can you test your deletion again with that version?
If you still run into the problem, I guess I need to learn more details about your code, specifically: what happens between fetching the messages and then requesting to delete a non-inbox message?
sorry for the inconvenience. I was not able to reproduce the problem with minimal code. everything worked as expected. so the problem have to be on my side even although I am not seeing it on first sight. I guess I will also have to simplify my code in order to understand what I did wrong. again sorry and thanks for the help.
I am not able to delete messages with the high level API
await client.deleteMessage(message);
but nothing happens. with logging enabled this is the output i receive:
when trying with expunge: true
await client.deleteMessage(message, expunge: true);
i get at least an exception, but it's just null
it seems that in both cases that the message with the UID 426 is not found, right? but why? looking a bit in the log output i can see that the message with the UID 426 is there
does anyone have any idea?