Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't delete any mail from server until successfully accepted by a destination #7

Open
vassilit opened this issue Jan 10, 2023 · 3 comments

Comments

@vassilit
Copy link

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.

@seijikun
Copy link
Owner

seijikun commented Jan 14, 2023

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.

@vassilit
Copy link
Author

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 ?

@seijikun
Copy link
Owner

seijikun commented Apr 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants