public static void SetupSSLPorts(hMailServer.Application application, SslVersions sslVersions = null) { SSLCertificate sslCeritifcate = SetupSSLCertificate(application); var settings = application.Settings; var ports = settings.TCPIPPorts; ports.SetDefault(); AddPort(ports, 25000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14300, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14301, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14302, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14303, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTIMAP); settings.SslVersion30Enabled = sslVersions == null || sslVersions.Ssl30; settings.TlsVersion10Enabled = sslVersions == null || sslVersions.Tls10; settings.TlsVersion11Enabled = sslVersions == null || sslVersions.Tls11; settings.TlsVersion12Enabled = sslVersions == null || sslVersions.Tls12; application.Stop(); application.Start(); }
public static void SetupSSLPorts(hMailServer.Application application) { SSLCertificate sslCeritifcate = SetupSSLCertificate(application); var ports = application.Settings.TCPIPPorts; AddPort(ports, 25000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14300, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14301, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14302, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTIMAP); AddPort(ports, 25003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTSMTP); AddPort(ports, 11003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTPOP3); AddPort(ports, 14303, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTIMAP); application.Stop(); application.Start(); }
public static void SetupSSLPorts(hMailServer.Application application, eConnectionSecurity security) { SSLCertificate sslCeritifcate = SetupSSLCertificate(application); TCPIPPort port = application.Settings.TCPIPPorts.Add(); port.Address = "0.0.0.0"; port.PortNumber = 250; port.ConnectionSecurity = security; port.SSLCertificateID = sslCeritifcate.ID; port.Protocol = eSessionType.eSTSMTP; port.Save(); port = application.Settings.TCPIPPorts.Add(); port.Address = "0.0.0.0"; port.PortNumber = 11000; port.ConnectionSecurity = security; port.SSLCertificateID = sslCeritifcate.ID; port.Protocol = eSessionType.eSTPOP3; port.Save(); port = application.Settings.TCPIPPorts.Add(); port.Address = "0.0.0.0"; port.PortNumber = 14300; port.ConnectionSecurity = security; port.SSLCertificateID = sslCeritifcate.ID; port.Protocol = eSessionType.eSTIMAP; port.Save(); application.Stop(); application.Start(); }