Maildir++ vs. Dict Storage: Which Minimizes Duplicate Writes During Delivery Retries?
0 reputation · 22 May 2022, 08:41 UTC
In high‑concurrency environments, Dovecot’s deliver daemon retries failed deliveries with exponential back‑off, while the indexer may concurrently retry mailbox operations. Because the Maildir specification does not provide atomic file‑creation primitives, a retry can race with an indexer or another delivery, potentially producing duplicate message files. Dovecot offers two documented storage back‑ends for this scenario: the native Maildir++ layout and the optional dict‑based mailbox. Both claim to mitigate duplicate writes, but their guarantees differ.
The goal is to ensure that a retry does not create a second copy of the same message, regardless of the storage backend or timing of indexer retries. Constraints include the lack of atomicity in standard Maildir, the deliver daemon’s back‑off algorithm, and the indexer’s own retry loop. Uncertainty remains about which backend provides the strongest protection and what configuration is required.
1. Does the Maildir++ implementation provide any atomicity guarantees that prevent duplicate writes during a retry?
2. How does the dict storage backend handle concurrent delivery and indexing retries to avoid duplication?
3. Which configuration options should be set to coordinate delivery and indexer retries across both back‑ends?