Use config override in MailCollectionTrait
I just had an unpleasant experience with MailCollectionTrait. The gotcha turned out to be that we had a config override for mailsystem.settings.sender=php_mail in our settings.php. Not much DTT can do about that. This caused our mail to bypass the test mail collector.
I notice that MailCollectionTrait edits the site's config and then restores in tearDown. I think a better approach would be a config override at the settings or module level. See https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-override-system.
/cc @Sam152