Stephen Warren <[EMAIL PROTECTED]> writes:

> I haven't read the Maildir spec in a while, but isn't Maildir
> defined such that the new->cur move must be one of (a) an atomic
> rename() operation or (b) a hard-link operation so the file appears
> in both new and cur, then an unlink from new?
>
> If one of the above is the case, then at no time should a message
> not exist in at least one of new/cur, and if we check new first,
> then cur, we should be guaranteed to find any message that's there.

I guess that's true, I suppose I was considering the case of an MUA
who doesn't follow the spec when renaming.  Though I also suppose
there's only so much we can/should do about that.  In the Maildir
find_message() method, I have it retry 5 times if upon first glance it
can't find the message.  Perhaps this is overkill, but as I said, this
should be a rare case, so I don't think it's a problem.  I've also
just reduced the sleep time between retries from 1s to 0.1s so it
should be faster.

The other case is when TMDA needs to extract a particular message's
contents from disk (fetch_message()).  It lists the contents of cur/
and new/ to find where it is and what it is named first.  If somehow
it's renamed in between that list/extract, an exception will be
raised.  Which is fine, since that will just cause the message to kick
back out (defer), and it should find it upon next delivery since
lightning doesn't strike twice.  So, we are covered here as well.  

_________________________________________________
tmda-workers mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to