don't delete any mail from server until successfully accepted by a destination
Idlemail also employs the concept of RetryAgents. If a mail was downloaded from the source, it is gone. When the sending to some destination for such a mail fails, it is permanently lost. [...] RetryAgent that only stores messages in RAM. If Idlemail is shut down while this RetryAgent has mails in queue, the mails will most definitely be lost.
Does idlemail support deleting emails if and only if the mail was successfully queue by the MTA (destination ) ? That would be making the memory RetryAgent safe (the mail would be downloaded again if idlemail is restarted). I believe fetchmail supports automatically deleting messages after successful delivery only.
It doesn't at the moment; although I don't remember why I implemented it the way that I did. I have to take a deeper dive into the IMAP RFC and see whether that's possible reliably, especially with regards to: What information do I need to uniquely identify the mail in the source, so I can reliably delete it later on?
I think one of the problems was, that as soon as you enter the IDLE mode in an active IMAP connection, you can't use the connection for commands (like delete) anymore, so you would have to create a new connection - and some providers don't like that.
What information do I need to uniquely identify the mail in the source, so I can reliably delete it later on?
I don't know how fetchmail do it. There seems to be an experimental IMAP UID support, but they somehow already manage to do it without UID.
as soon as you enter the IDLE mode in an active IMAP connection, you can't use the connection for commands (like delete) anymore [...] some providers don't like that.
I believe most providers allow more than one IMAP connection. The alternative on a single connection might be to exit idle mode (DONE) while fetching/delivering/expunging and then come back to idle ?
Fetchmail's design is very different. Last time I looked, they only support one idle connection per process making their design much easier. In idlemail, there is a lot more back and forth. This would probably require a thorough redesign.
The alternative on a single connection might be to exit idle mode (DONE)
Oh, didn't know about this one, that sounds interesting. I do remember that the crate/library situation for IMAP was a little complicated in Rust land though - so this is probably not supported yet.
Looking into this is on my list. Unfortunately, it will take quite some time still until I can look into this.