From: Matthias A. <mat...@gm...> - 2006-05-24 16:38:23
|
Sunil Shetye <sh...@bo...> writes: > I think, the current code which is assuming that mails have been > expunged only on a successful quit is ok. It is a straighforward code > which is not hard to understand. Setting UID_EXPUNGED before sending > QUIT is probably going to make the code harder to debug, especially in > the edge cases. Another case I can think of is: > > POP3> QUIT > POP3< -ERR Disk full > > What is probably required is to directly delete the mails which have > been deleted (UID_DELETED), but not yet expunged. That's what we're trying to achieve. OK, we might hold off EXPUNGE and look at the return code from the "QUIT" request. I don't have time right now, but I'll look into this later, to figure out which errors can happen and what to do with them. >> Can you elaborate how to handle this separately? > > I mean, your patch is doing three things: > > - Adding comments to the code, fixing other minor issues > - Adding the UID_PENDDELE flag > - Saving and restoring the DELETED flag in .fetchids > > The above issues are equally important. But they are separate issues > and should be addressed separately. I am saying this only to keep the > size of the patch under discussion small. Fine. I'll break them out later into a series of patches. I don't think they can be independent of each other though, but they will have to be applied in order. >> BTW, we need the "DELETED" flagging in .fetchids to make your >> "UID_UNSEEN" patch (re-fetch rather than mark seen) anyways. >> Else everything becomes "SEEN vs. UNSEEN" next time fetchmail is >> (re-)started anyways. > > Handling it in .fetchids requires more thought. Just adding the > DELETED word is not enough. Atleast, an expiration time will have to > be added to the DELETED flag. I don't think so, and if the end user's system has a goofed up system time, it won't help either. > What if a person runs fetchmail after a week or more? In this case, it > is probably unsafe to assume that it is the same old mail which should > be deleted directly. So we're essentially heading to a flag "assume fetchmail is the only one accessing said mailbox? yes/no". Not only in this context such a flag would be useful. I'd rather not contemplate the havoc this flag wreaks if set to "true" when that isn't true. That scares me away from putting something like this on my agenda^WTODO. > Another potential problem: what if the user is running the second > instance of fetchmail with 'keep'? I think, your patch will still > delete the mail directly (not checked). I think it would. -- Matthias Andree |