Inheritance: ISmtpServerOptions
        /// <summary>
        /// Builds the options that have been set and returns the built instance.
        /// </summary>
        /// <returns>The server options that have been set.</returns>
        public ISmtpServerOptions Build()
        {
            var serverOptions = new SmtpServerOptions
            {
                Endpoints                 = new List <IEndpointDefinition>(),
                MaxRetryCount             = 5,
                MaxAuthenticationAttempts = 3,
                NetworkBufferSize         = 128,
                CommandWaitTimeout        = TimeSpan.FromMinutes(5)
            };

            _setters.ForEach(setter => setter(serverOptions));

            return(serverOptions);
        }
Exemple #2
0
        /// <summary>
        /// Builds the options that have been set and returns the built instance.
        /// </summary>
        /// <returns>The server options that have been set.</returns>
        public ISmtpServerOptions Build()
        {
            var serverOptions = new SmtpServerOptions
            {
                Endpoints                = new List <IEndpointDefinition>(),
                MessageStoreFactory      = DoNothingMessageStore.Instance,
                MailboxFilterFactory     = DoNothingMailboxFilter.Instance,
                UserAuthenticatorFactory = DoNothingUserAuthenticator.Instance,
                MaxRetryCount            = 5,
                SupportedSslProtocols    = SslProtocols.Tls,
                NetworkBufferSize        = 128,
                NetworkBufferReadTimeout = TimeSpan.FromMinutes(2),
                CommandWaitTimeout       = TimeSpan.FromMinutes(5),
                Logger = new NullLogger(),
            };

            _setters.ForEach(setter => setter(serverOptions));

            return(serverOptions);
        }