Closed aheissenberger closed 3 years ago
So what you are saying is that if there is no trash folder in IMAP, then the app will hang because the channel is left open? I can't believe I have never picked this up, although every IMAP I've used has a trash folder so I wouldn't have detected this I think.
Wow, good catch, thanks for contributing! If you're a Go novice then you're doing pretty well :) I'll release a new version soon.
So what you are saying is that if there is no trash folder in IMAP, then the app will hang because the channel is left open?
No - it always detected the right trash folder on Gmail and then later when it tried to select a mailbox the app stuck. Based on my rudimentary knowhow of go it has to do with the channels not being consumed and closed.
I tried a lot of things like upgrading dependencies, running in a linux container instead of running directly on MacOS. When I tested the code from the go-imap repo and it worked I started to remove all code before the Select()
and after replacing the code for trash detection with a static value everything worked.
I have debugged so many applications in the last 40 years that after setting up a proper debugging setup I usually find the problem regardless of the programming language :-)
when mailbox list was not consumed in
lib/mailboxes.go
functionDetectTrash
by leaving the loop with a return, the main app was hanging when trying to request the mailbox in main.go:127 cReader.Select()Was really hard to find ;-) for a total Golang novice like me. Thanks for the great app! Andreas