On Wed, Jun 09, 2021 at 11:48:45AM -0400, Wietse Venema wrote:
> > Jun 9 01:38:07 postfix/local[17012]: B713116056:
> > to=<[email protected]>, relay=local, delay=2.1, delays=1.3/0.01/0/0.83,
> > dsn=2.0.0, status=sent (delivered to mailbox)
>
> Postfix opens the mailbox file, does an lseek() to the end of the
> file, writes the message, flushes the output with fsync(), and
> closes the mailbox file before claiming successful delivery.
Potentially relevant:
$ postconf | grep '_lock ' =
mailbox_delivery_lock = flock, dotlock
virtual_mailbox_lock = fcntl, dotlock
Personally, I don't use "mbox" delivery, only maildir.
> As for why the original message is not in the mailbox, that could
> be a race condition in how you access the mailbox (are you rsyncing
> mailbox files?), or a race condition bug in the file system that
> causes lseek() to see the old file size from before the first message
> was delivered. Such race conditions would explain how the status
> notification can overwrite the first message.
>
> What kind file system is this?
Indeed, any lock-related overrides, and is it really mbox rather than
maildir, any why?
--
Viktor.