methodtMaildir.ReplaceMailboxes
procedure ReplaceMailboxes(aList: TStrings);
THE WHOLE LIST, IN ONE LOCKED STEP.
Clear-then-re-add is not equivalent: the lock is per operation, so a reader between the two sees an EMPTY mailbox list and an address that exists resolves to nothing. On the SMTP side that reaches RCPT TO, where RequireKnownMailbox turns it into a permanent 550 and the sending MTA bounces mail for a valid recipient. Swapping the list under one acquisition means a reader sees the complete old set or the complete new one - and it also closes the window in which an address present in both the account list and the override list resolved to the wrong directory.
aList is 'address=directory' lines; every directory is validated before anything is swapped, so a bad entry changes nothing.