mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 02:28:15 +03:00

Just to be cautious. This hasn't happened yet in practice that I'm aware of. But in theory, mox could crash after it has written the message file during delivery, but before the database transaction was committed. In that case, a message file for the "next message id" is already present. Any future delivery attempts will get assigned the same message id by the database, but writing the file will fail because there already is one, causing delivery to fail (until the file is moved away). When opening an account, we now check in the file system if newer files exist than we expect based on the last existing message in the database. If so, we adjust the message ID the database will assign next.