Steffen Nurpmeso:
>   Jun  9 01:38:06 postfix/smtpd[17007]: B713116056: 
> client=unknown[45.137.22.84]
>   Jun  9 01:38:06 postfix/cleanup[17011]: B713116056: 
> message-id=<20210608163805.e242f6fe5d7ac...@sdaoden.eu>
>   Jun  9 01:38:06 postfix/qmgr[2581]: B713116056: from=<stef...@sdaoden.eu>, 
> size=2828, nrcpt=1 (queue active)
>   Jun  9 01:38:06 postfix/smtpd[17007]: disconnect from unknown[45.137.22.84] 
> ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
>   Jun  9 01:38:07 postfix/local[17012]: B713116056: to=<stef...@sdaoden.eu>, 
> relay=local, delay=2.1, delays=1.3/0.01/0/0.83, dsn=2.0.0, status=sent 
> (delivered to mailbox)

Postfix delivers an email message with message-id
<20210608163805.e242f6fe5d7ac...@sdaoden.eu> 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.

Then Postfix sends a delivery status notification.

>   Jun  9 01:38:07 postfix/cleanup[17011]: A5B3516059: 
> message-id=<20210608233807.a5b3516...@sdaoden.eu>
>   Jun  9 01:38:07 postfix/qmgr[2581]: A5B3516059: from=<>, size=2213, nrcpt=1 
> (queue active)
>   Jun  9 01:38:07 postfix/bounce[17013]: B713116056: sender delivery status 
> notification: A5B3516059
>   Jun  9 01:38:07 postfix/qmgr[2581]: B713116056: removed
>   Jun  9 01:38:07 postfix/local[17012]: A5B3516059: to=<stef...@sdaoden.eu>, 
> relay=local, delay=0.03, delays=0.01/0/0/0.02, dsn=2.0.0, status=sent 
> (delivered to mailbox)
>   Jun  9 01:38:07 postfix/qmgr[2581]: A5B3516059: removed

As you figured out the sender has requested NOTIFY=SUCCESS. You can
disable that with instructions in
http://www.postfix.org/DSN_README.html#scope

Again, 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.

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?

        Wietse

Reply via email to