protected function createSwiftMailer(Swift_Transport $transport): Swift_Mailer
    {
        if (isset($this->resolvedOptions['domain'])) {
            Swift_DependencyContainer::getInstance()
                ->register('mime.idgenerator.idright')
                ->asValue($this->resolvedOptions['domain']);
        }

        return new Swift_Mailer($transport);
    }