本文整理汇总了C#中hMailServer类的典型用法代码示例。如果您正苦于以下问题:C# hMailServer类的具体用法?C# hMailServer怎么用?C# hMailServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
hMailServer类属于命名空间,在下文中一共展示了hMailServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupSSLPorts
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();
}
示例2: AuthenticateUser
public static bool AuthenticateUser(hMailServer.Application application)
{
// First try to authenticate using an empty password.
if (AuthenticateUser(application, ""))
return true;
// Try to authenticate using password on command line...
string [] args = Environment.GetCommandLineArgs();
foreach (string password in args)
{
if (AuthenticateUser(application, password))
return true;
}
while (true)
{
formEnterPassword passwordDlg = new formEnterPassword();
if (passwordDlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return false;
string password = passwordDlg.Password;
if (AuthenticateUser(application, password))
return true;
MessageBox.Show("Invalid user name or password.", "hMailServer");
}
}
示例3: formMain
public formMain(hMailServer.Application application)
{
InitializeComponent();
_application = application;
_databaseType = null;
}
示例4: SaveProperties
public void SaveProperties(hMailServer.WhiteListAddress address)
{
address.LowerIPAddress = textLowerIP.Text;
address.UpperIPAddress = textUpperIP.Text;
address.Description = textDescription.Text;
address.EmailAddress = textEmailAddress.Text;
}
示例5: LoadProperties
public void LoadProperties(hMailServer.WhiteListAddress address)
{
textLowerIP.Text = address.LowerIPAddress;
textUpperIP.Text = address.UpperIPAddress;
textDescription.Text = address.Description;
textEmailAddress.Text = address.EmailAddress;
}
示例6: SetupSSLPorts
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();
}
示例7: SetupSSLPorts
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();
}
示例8: ucAccounts
public ucAccounts(hMailServer.Domain domain)
{
InitializeComponent();
representedDomain = domain;
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
}
示例9: formAccountFolders
public formAccountFolders(hMailServer.IMAPFolders imapFolders, bool publicFolders)
{
InitializeComponent();
ucIMAPFolders1.LoadProperties(imapFolders, publicFolders);
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
Strings.Localize(this.buttonClose);
this.Text = Strings.Localize(this.Text);
ucIMAPFolders1.Localize();
}
示例10: ucDomain
public ucDomain(hMailServer.Domain domain)
{
InitializeComponent();
_domain = domain;
EnableDisableTabs();
DirtyChecker.SubscribeToChange(this, OnContentChanged);
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
EnableDisable();
}
示例11: GetAdministrationLevelName
public static string GetAdministrationLevelName(hMailServer.eAdminLevel level)
{
switch (level)
{
case eAdminLevel.hAdminLevelNormal:
return Strings.Localize("User");
case eAdminLevel.hAdminLevelDomainAdmin:
return Strings.Localize("Domain");
case eAdminLevel.hAdminLevelServerAdmin:
return Strings.Localize("Server");
}
throw new Exception("Unknown administration level");
}
示例12: formRuleAction
public formRuleAction(hMailServer.Rule rule, hMailServer.RuleAction ruleAction)
{
InitializeComponent();
_ruleAction = ruleAction;
_isAccountLevelRule = rule.AccountID > 0;
FillCombo();
LoadProperties();
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
Strings.Localize(this);
}
示例13: formRuleCriteria
public formRuleCriteria(hMailServer.RuleCriteria ruleCriteria)
{
InitializeComponent();
_ruleCriteria = ruleCriteria;
FillCombos();
LoadProperties();
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
Strings.Localize(this);
_utilities = APICreator.Application.Utilities;
}
示例14: formMain
public formMain(hMailServer.Application app, string serverHost)
{
InitializeComponent();
application = app;
_serverHost = serverHost;
currentlySelectedNode = null;
_language = "English";
LoadWindowSettings();
_language = Strings.LoadLanguage(_language);
Strings.Localize(this);
}
示例15: formFolderPermissions
public formFolderPermissions(hMailServer.IMAPFolder folder)
{
InitializeComponent();
EnableDisable();
_folder = folder;
ListPermissions();
new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
labelPermissionsFor.Text = "";
Strings.Localize(this);
}