nmailserver-commits Mailing List for NMail (Page 9)
Brought to you by:
dframpton-oss,
tmyroadctfig
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(13) |
Jun
(14) |
Jul
(8) |
Aug
|
Sep
|
Oct
(8) |
Nov
(22) |
Dec
(9) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(21) |
Feb
(31) |
Mar
(24) |
Apr
(8) |
May
(23) |
Jun
(40) |
Jul
(14) |
Aug
(5) |
Sep
(7) |
Oct
(10) |
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tmy...@us...> - 2006-11-11 13:00:26
|
Revision: 87
http://svn.sourceforge.net/nmailserver/?rev=87&view=rev
Author: tmyroadctfig
Date: 2006-11-11 05:00:13 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Tagged version 1.0.
Added Paths:
-----------
NMail/tags/v1.0/
Copied: NMail/tags/v1.0 (from rev 86, NMail/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-11 12:48:16
|
Revision: 86
http://svn.sourceforge.net/nmailserver/?rev=86&view=rev
Author: tmyroadctfig
Date: 2006-11-11 04:47:50 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Updated version of Mono.Security.dll and fixed defect with NTLM authentication.
Modified Paths:
--------------
NMail/trunk/NMail.ImapService/State/ConnectedState.cs
NMail/trunk/References/Mono.Security.dll
Modified: NMail/trunk/NMail.ImapService/State/ConnectedState.cs
===================================================================
--- NMail/trunk/NMail.ImapService/State/ConnectedState.cs 2006-11-11 11:25:29 UTC (rev 85)
+++ NMail/trunk/NMail.ImapService/State/ConnectedState.cs 2006-11-11 12:47:50 UTC (rev 86)
@@ -133,10 +133,8 @@
string type1MsgStr = Session.Connection.ReadLine();
Type1Message type1Msg = new Type1Message(Convert.FromBase64String(type1MsgStr));
- // TODO: check this step. Check flags are sensible.
// Send challenge
Type2Message type2Msg = new Type2Message();
- type2Msg.Flags = type1Msg.Flags;
QueueResponse(new ContinuationResponse(Convert.ToBase64String(type2Msg.GetBytes())));
// Get the client's response
Modified: NMail/trunk/References/Mono.Security.dll
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-11 11:25:37
|
Revision: 85
http://svn.sourceforge.net/nmailserver/?rev=85&view=rev
Author: tmyroadctfig
Date: 2006-11-11 03:25:29 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Fixed defect in createuser.
Modified Paths:
--------------
NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
Modified: NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
===================================================================
--- NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-11-11 10:58:49 UTC (rev 84)
+++ NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-11-11 11:25:29 UTC (rev 85)
@@ -485,7 +485,11 @@
IF NOT EXISTS (SELECT * FROM Folder f WHERE f.Name LIKE Name and f.NamespaceId = NamespaceId) AND
NOT EXISTS (SELECT * FROM Folder f WHERE f.Name LIKE InboxName and f.NamespaceId = NamespaceId) THEN
- INSERT INTO User (Username, QuotaHardLimit, QuotaWarnLimit) VALUES (Name, QuotaHardLimit, QuotaWarnLimit);
+ INSERT INTO User
+ (Username, QuotaHardLimit, QuotaWarnLimit, Disabled, PasswordExpiry)
+ VALUES
+ (Name, QuotaHardLimit, QuotaWarnLimit, FALSE, NOW() + INTERVAL 90 DAY);
+
SELECT LAST_INSERT_ID() INTO UserId;
/* Create the user's base folder. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-11 10:58:54
|
Revision: 84
http://svn.sourceforge.net/nmailserver/?rev=84&view=rev
Author: tmyroadctfig
Date: 2006-11-11 02:58:49 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Fixed missing installer file.
Modified Paths:
--------------
NMail/trunk/Installer/NMail-Installer.wxs
Modified: NMail/trunk/Installer/NMail-Installer.wxs
===================================================================
--- NMail/trunk/Installer/NMail-Installer.wxs 2006-11-11 10:49:28 UTC (rev 83)
+++ NMail/trunk/Installer/NMail-Installer.wxs 2006-11-11 10:58:49 UTC (rev 84)
@@ -114,9 +114,6 @@
<Component Id="component8" DiskId="1" Guid="A57703A5-14A6-4a50-8677-793088C9D110">
<File Id="file8" Name="PRECOM_1.CON" LongName="PrecompiledApp.config" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\PrecompiledApp.config" />
</Component>
- <Component Id="component9" DiskId="1" Guid="0A419E0E-4A82-4d97-AB36-AFBB1829F9EC">
- <File Id="file9" Name="STYLES_1.CSS" LongName="StyleSheet.css" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\StyleSheet.css" />
- </Component>
<Component Id="component10" DiskId="1" Guid="901C7F89-7965-4f37-A42A-47F9EB1607FB">
<File Id="file10" Name="USERDE_1.ASP" LongName="UserDetails.aspx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\UserDetails.aspx" />
</Component>
@@ -463,7 +460,6 @@
<ComponentRef Id="component6"/>
<ComponentRef Id="component7"/>
<ComponentRef Id="component8"/>
- <ComponentRef Id="component9"/>
<ComponentRef Id="component10"/>
<ComponentRef Id="component11"/>
<ComponentRef Id="component12"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-11 10:55:49
|
Revision: 83
http://svn.sourceforge.net/nmailserver/?rev=83&view=rev
Author: tmyroadctfig
Date: 2006-11-11 02:49:28 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Merged in changes from development branch.
Modified Paths:
--------------
NMail/trunk/Installer/NMail-Installer.wxs
NMail/trunk/Installer/NMail-installer.build
NMail/trunk/MonoPrivileges/MonoPrivileges.csproj
NMail/trunk/NDns/NDns.csproj
NMail/trunk/NMail/Authentication/BasicAuthToken.cs
NMail/trunk/NMail/Authentication/IAuthenticationProvider.cs
NMail/trunk/NMail/Authentication/IAuthenticationToken.cs
NMail/trunk/NMail/Authentication/NullAuthentication.cs
NMail/trunk/NMail/Configuration/IPEndPointsCollection.cs
NMail/trunk/NMail/Configuration/NMailConfiguration.cs
NMail/trunk/NMail/Configuration/ObjectConfigurationElement.cs
NMail/trunk/NMail/DataTypes/ACLs/StoreFolderAcl.cs
NMail/trunk/NMail/DataTypes/Domain.cs
NMail/trunk/NMail/DataTypes/Envelope.cs
NMail/trunk/NMail/DataTypes/LocalStore/MailDomain.cs
NMail/trunk/NMail/IO/TcpTextConnection.cs
NMail/trunk/NMail/NMail.build
NMail/trunk/NMail/NMail.csproj
NMail/trunk/NMail.Administration.Console/Command/AddUserCommand.cs
NMail/trunk/NMail.Administration.Console/Command/AddUserToMailDomainCommand.cs
NMail/trunk/NMail.Administration.Console/Command/DeleteUserCommand.cs
NMail/trunk/NMail.Administration.Console/Command/ListFoldersCommand.cs
NMail/trunk/NMail.Administration.Console/Command/ListUserAddressesCommand.cs
NMail/trunk/NMail.Administration.Console/Command/ListUsersCommand.cs
NMail/trunk/NMail.Administration.Console/Command/RemoveUserFromMailDomainCommand.cs
NMail/trunk/NMail.Administration.Console/Context/LocalStoreContext.cs
NMail/trunk/NMail.Administration.Console/Context/TopLevelContext.cs
NMail/trunk/NMail.Administration.Console/NMail.Administration.Console.csproj
NMail/trunk/NMail.Administration.Web/App_Code/FolderDataSource.cs
NMail/trunk/NMail.Administration.Web/App_Code/MailDomainDataSource.cs
NMail/trunk/NMail.Administration.Web/App_Code/UserDataSource.cs
NMail/trunk/NMail.Administration.Web/CreateFolder.aspx
NMail/trunk/NMail.Administration.Web/CreateFolder.aspx.cs
NMail/trunk/NMail.Administration.Web/CreateMailDomain.aspx
NMail/trunk/NMail.Administration.Web/CreateMailDomain.aspx.cs
NMail/trunk/NMail.Administration.Web/CreateUser.aspx
NMail/trunk/NMail.Administration.Web/CreateUser.aspx.cs
NMail/trunk/NMail.Administration.Web/FolderDetails.aspx
NMail/trunk/NMail.Administration.Web/FolderDetails.aspx.cs
NMail/trunk/NMail.Administration.Web/Global.asax
NMail/trunk/NMail.Administration.Web/Login.aspx
NMail/trunk/NMail.Administration.Web/Login.aspx.cs
NMail/trunk/NMail.Administration.Web/MailDomainDetails.aspx
NMail/trunk/NMail.Administration.Web/MailDomainDetails.aspx.cs
NMail/trunk/NMail.Administration.Web/MasterPage.master
NMail/trunk/NMail.Administration.Web/SetPasswordPanel.ascx
NMail/trunk/NMail.Administration.Web/SpoolDetails.aspx
NMail/trunk/NMail.Administration.Web/SpoolDetails.aspx.cs
NMail/trunk/NMail.Administration.Web/TaskList.ascx
NMail/trunk/NMail.Administration.Web/TaskList.ascx.cs
NMail/trunk/NMail.Administration.Web/UserDetails.aspx
NMail/trunk/NMail.Administration.Web/UserDetails.aspx.cs
NMail/trunk/NMail.Administration.Web/ViewFolders.aspx
NMail/trunk/NMail.Administration.Web/ViewMailDomains.aspx
NMail/trunk/NMail.Administration.Web/ViewUsers.aspx
NMail/trunk/NMail.Administration.Web/Web.sitemap
NMail/trunk/NMail.Administration.Web/web.config
NMail/trunk/NMail.DnsClient/Configuration/DnsClientConfiguration.cs
NMail/trunk/NMail.DnsClient/NMail.DnsClient.csproj
NMail/trunk/NMail.ImapService/Command/AppendCommand.cs
NMail/trunk/NMail.ImapService/Command/AuthenticateCommand.cs
NMail/trunk/NMail.ImapService/Command/StoreCommand.cs
NMail/trunk/NMail.ImapService/Configuration/ImapServiceConfiguration.cs
NMail/trunk/NMail.ImapService/ImapSession.cs
NMail/trunk/NMail.ImapService/NMail.ImapService.csproj
NMail/trunk/NMail.ImapService/Response/LSubResponse.cs
NMail/trunk/NMail.ImapService/Response/ListResponse.cs
NMail/trunk/NMail.ImapService/State/AbstractState.cs
NMail/trunk/NMail.ImapService/State/AuthenticatedState.cs
NMail/trunk/NMail.ImapService/State/ConnectedState.cs
NMail/trunk/NMail.ImapService/State/ExamineState.cs
NMail/trunk/NMail.ImapService/State/SelectedState.cs
NMail/trunk/NMail.LocalStore/DeliveryActions/ClamAvScanner.cs
NMail/trunk/NMail.LocalStore/DeliveryActions/Copy.cs
NMail/trunk/NMail.LocalStore/DeliveryActions/ManageWhiteList.cs
NMail/trunk/NMail.LocalStore/DeliveryActions/Move.cs
NMail/trunk/NMail.LocalStore/LocalStore.cs
NMail/trunk/NMail.LocalStore/NMail.LocalStore.csproj
NMail/trunk/NMail.LocalStore/Validators/AddressDate.cs
NMail/trunk/NMail.LocalStore/Validators/AddressKeyword.cs
NMail/trunk/NMail.LocalStore/Validators/AddressSender.cs
NMail/trunk/NMail.LocalStore/Validators/OnWhiteList.cs
NMail/trunk/NMail.LocalStore/Validators/OrdbBlackList.cs
NMail/trunk/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs
NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
NMail/trunk/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
NMail/trunk/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
NMail/trunk/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs
NMail/trunk/NMail.MessageRouter/NMail.MessageRouter.csproj
NMail/trunk/NMail.PostInstall/NMail.PostInstall.csproj
NMail/trunk/NMail.PostInstall/PostInstallForm.Designer.cs
NMail/trunk/NMail.PostInstall/PostInstallForm.cs
NMail/trunk/NMail.PostInstall/Program.cs
NMail/trunk/NMail.Sendmail/NMail.Sendmail.csproj
NMail/trunk/NMail.Server/NMail.Server.csproj
NMail/trunk/NMail.Server/NMailServer.cs
NMail/trunk/NMail.Server/RemoteAdministration.cs
NMail/trunk/NMail.Server.Console/NMail.Server.Console.csproj
NMail/trunk/NMail.Server.Console/NMail.config
NMail/trunk/NMail.Server.Service/NMail.Server.Service.csproj
NMail/trunk/NMail.Server.Service/NMailService.cs
NMail/trunk/NMail.SmtpClient/Configuration/SmtpClientConfiguration.cs
NMail/trunk/NMail.SmtpClient/NMail.SmtpClient.csproj
NMail/trunk/NMail.SmtpService/Command/DataCommand.cs
NMail/trunk/NMail.SmtpService/Command/ResetCommand.cs
NMail/trunk/NMail.SmtpService/Configuration/SmtpServiceConfiguration.cs
NMail/trunk/NMail.SmtpService/NMail.SmtpService.csproj
NMail/trunk/NMail.SmtpService/SmtpService.cs
NMail/trunk/NMail.SmtpService/SmtpServiceConnection.cs
NMail/trunk/NMail.SpoolData.MySql/Configuration/MySqlSpoolDataConfiguration.cs
NMail/trunk/NMail.SpoolData.MySql/MySqlSpoolData.cs
NMail/trunk/NMail.SpoolData.MySql/MySqlSpoolData.sql
NMail/trunk/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj
NMail/trunk/NMail.SpoolFilter/Configuration/SpoolFilterConfiguration.cs
NMail/trunk/NMail.SpoolFilter/NMail.SpoolFilter.csproj
NMail/trunk/NMail.SpoolFilter/NoActionFilter.cs
NMail/trunk/NMail.SpoolFilter/SpoolFilter.cs
NMail/trunk/NMail.SpoolFilter.RegexAddressRewriter/NMail.SpoolFilter.RegexAddressRewriter.csproj
NMail/trunk/NMail.SpoolFilter.RegexAddressRewriter/RegexAddressRewriter.cs
NMail/trunk/NMail.SpoolService/Configuration/SpoolServiceConfiguration.cs
NMail/trunk/NMail.SpoolService/NMail.SpoolService.csproj
NMail/trunk/NMail.SpoolService/SpoolService.cs
NMail/trunk/NMail.UnitTests/NMail.UnitTests.csproj
NMail/trunk/NMail.build
NMail/trunk/NMail.sln
Added Paths:
-----------
NMail/trunk/NMail/Authentication/ILockOutPolicy.cs
NMail/trunk/NMail/Authentication/SaslPlainAuthMsg.cs
NMail/trunk/NMail/Configuration/NMailConfigFile.cs
NMail/trunk/NMail/DataTypes/AbstractMessageRouter.cs
NMail/trunk/NMail/DataTypes/IDnsClient.cs
NMail/trunk/NMail/DataTypes/IService.cs
NMail/trunk/NMail/DataTypes/ISmtpClient.cs
NMail/trunk/NMail/DataTypes/LocalStore/ILocalStore.cs
NMail/trunk/NMail/DataTypes/LocalStore/ILocalStoreData.cs
NMail/trunk/NMail/DataTypes/LocalStore/ILocalStoreDeliveryAction.cs
NMail/trunk/NMail/DataTypes/LocalStore/ILocalStoreRecipientValidator.cs
NMail/trunk/NMail/DataTypes/LocalStore/ILocalStoreUserMap.cs
NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreDelivery.cs
NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreGroup.cs
NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreUser.cs
NMail/trunk/NMail/DataTypes/LocalStore/StoreFolder.cs
NMail/trunk/NMail/DataTypes/LocalStore/StoreMessageFlags.cs
NMail/trunk/NMail/DataTypes/Spool/
NMail/trunk/NMail/DataTypes/Spool/ISpoolData.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolFilter.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolFilterService.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolService.cs
NMail/trunk/NMail/DataTypes/Spool/SpoolEnvelope.cs
NMail/trunk/NMail/DataTypes/Spool/SpoolRecipient.cs
NMail/trunk/NMail/Helper/IPEndpointHelper.cs
NMail/trunk/NMail/IO/TcpUserPasswordPair.cs
NMail/trunk/NMail.Administration.Web/App_Code/SpooledMessageDataSource.cs
NMail/trunk/NMail.Administration.Web/App_Code/Task.cs
NMail/trunk/NMail.Administration.Web/App_Themes/
NMail/trunk/NMail.Administration.Web/App_Themes/Default/
NMail/trunk/NMail.Administration.Web/App_Themes/Default/Default.skin
NMail/trunk/NMail.Administration.Web/App_Themes/Default/StyleSheet.css
NMail/trunk/NMail.Administration.Web/Bin/NMail.LocalStoreData.MySql.dll.refresh
NMail/trunk/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs
NMail/trunk/NMail.LocalStoreData.MySql/MySqlHelper.cs
NMail/trunk/NMail.LocalStoreData.MySql/MySqlUserMap.cs
NMail/trunk/NMail.OutlookPlugin/
NMail/trunk/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj
NMail/trunk/NMail.OutlookPlugin/Properties/
NMail/trunk/NMail.OutlookPlugin/Properties/AssemblyInfo.cs
NMail/trunk/NMail.PostInstall/NMail.PostInstall.build
NMail/trunk/NMail.Server/RemoteAdminAuthorisation.cs
NMail/trunk/NMail.SetupWizard/
NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs
NMail/trunk/NMail.SetupWizard/BaseForm.cs
NMail/trunk/NMail.SetupWizard/BaseForm.resx
NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs
NMail/trunk/NMail.SetupWizard/BasePanel.cs
NMail/trunk/NMail.SetupWizard/BasePanel.resx
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.resx
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.cs
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.resx
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.cs
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.resx
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.cs
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.resx
NMail/trunk/NMail.SetupWizard/MySqlHelper.cs
NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.build
NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/trunk/NMail.SetupWizard/PasswordDialog.Designer.cs
NMail/trunk/NMail.SetupWizard/PasswordDialog.cs
NMail/trunk/NMail.SetupWizard/PasswordDialog.resx
NMail/trunk/NMail.SetupWizard/Program.cs
NMail/trunk/NMail.SetupWizard/Properties/
NMail/trunk/NMail.SetupWizard/Properties/AssemblyInfo.cs
NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs
NMail/trunk/NMail.SetupWizard/Properties/Resources.resx
NMail/trunk/NMail.SetupWizard/Properties/Settings.Designer.cs
NMail/trunk/NMail.SetupWizard/Properties/Settings.settings
NMail/trunk/NMail.SetupWizard/Resources/
NMail/trunk/NMail.SetupWizard/Resources/error.png
NMail/trunk/NMail.SetupWizard/Resources/ok.png
NMail/trunk/NMail.SetupWizard/Resources/pending.png
NMail/trunk/NMail.SetupWizard/Resources/warning.png
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.cs
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.resx
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.resx
NMail/trunk/NMail.SetupWizard/Task.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.Designer.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.resx
Removed Paths:
-------------
NMail/trunk/NDns/NDns.xml
NMail/trunk/NMail/AbstractMessageRouter.cs
NMail/trunk/NMail/DataTypes/LocalStoreDelivery.cs
NMail/trunk/NMail/DataTypes/LocalStoreGroup.cs
NMail/trunk/NMail/DataTypes/LocalStoreUser.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolData.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolFilter.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolFilterService.cs
NMail/trunk/NMail/DataTypes/Spool/ISpoolService.cs
NMail/trunk/NMail/DataTypes/Spool/SpoolEnvelope.cs
NMail/trunk/NMail/DataTypes/Spool/SpoolRecipient.cs
NMail/trunk/NMail/DataTypes/StoreFolder.cs
NMail/trunk/NMail/DataTypes/StoreMessageFlags.cs
NMail/trunk/NMail/IDnsClient.cs
NMail/trunk/NMail/ILocalStore.cs
NMail/trunk/NMail/ILocalStoreData.cs
NMail/trunk/NMail/ILocalStoreDeliveryAction.cs
NMail/trunk/NMail/ILocalStoreRecipientValidator.cs
NMail/trunk/NMail/ILocalStoreUserMap.cs
NMail/trunk/NMail/IO/TcpChannel.cs
NMail/trunk/NMail/IO/TcpClientChannel.cs
NMail/trunk/NMail/IO/TcpClientTransportSink.cs
NMail/trunk/NMail/IO/TcpClientTransportSinkProvider.cs
NMail/trunk/NMail/IO/TcpServerChannel.cs
NMail/trunk/NMail/IO/TcpServerTransportSink.cs
NMail/trunk/NMail/IService.cs
NMail/trunk/NMail/ISmtpClient.cs
NMail/trunk/NMail/ISpoolData.cs
NMail/trunk/NMail/ISpoolFilter.cs
NMail/trunk/NMail/ISpoolFilterService.cs
NMail/trunk/NMail/ISpoolService.cs
NMail/trunk/NMail/Interfaces/
NMail/trunk/NMail.Administration.Web/App_Themes/Default/
NMail/trunk/NMail.Administration.Web/App_Themes/Default/Default.skin
NMail/trunk/NMail.Administration.Web/App_Themes/Default/StyleSheet.css
NMail/trunk/NMail.Administration.Web/Images/Tango/Thumbs.db
NMail/trunk/NMail.Administration.Web/StyleSheet.css
NMail/trunk/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj
NMail/trunk/NMail.OutlookPlugin/Properties/
NMail/trunk/NMail.OutlookPlugin/Properties/AssemblyInfo.cs
NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs
NMail/trunk/NMail.SetupWizard/BaseForm.cs
NMail/trunk/NMail.SetupWizard/BaseForm.resx
NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs
NMail/trunk/NMail.SetupWizard/BasePanel.cs
NMail/trunk/NMail.SetupWizard/BasePanel.resx
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.resx
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.cs
NMail/trunk/NMail.SetupWizard/DnsConfigPanel.resx
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.cs
NMail/trunk/NMail.SetupWizard/FinalConfigPanel.resx
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.cs
NMail/trunk/NMail.SetupWizard/LocalStoreConfigPanel.resx
NMail/trunk/NMail.SetupWizard/MySqlHelper.cs
NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.build
NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/trunk/NMail.SetupWizard/PasswordDialog.Designer.cs
NMail/trunk/NMail.SetupWizard/PasswordDialog.cs
NMail/trunk/NMail.SetupWizard/PasswordDialog.resx
NMail/trunk/NMail.SetupWizard/Program.cs
NMail/trunk/NMail.SetupWizard/Properties/
NMail/trunk/NMail.SetupWizard/Properties/AssemblyInfo.cs
NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs
NMail/trunk/NMail.SetupWizard/Properties/Resources.resx
NMail/trunk/NMail.SetupWizard/Properties/Settings.Designer.cs
NMail/trunk/NMail.SetupWizard/Properties/Settings.settings
NMail/trunk/NMail.SetupWizard/Resources/
NMail/trunk/NMail.SetupWizard/Resources/error.png
NMail/trunk/NMail.SetupWizard/Resources/ok.png
NMail/trunk/NMail.SetupWizard/Resources/pending.png
NMail/trunk/NMail.SetupWizard/Resources/warning.png
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.cs
NMail/trunk/NMail.SetupWizard/ServiceConfigPanel.resx
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.Designer.cs
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
NMail/trunk/NMail.SetupWizard/SmtpSubSysConfigPanel.resx
NMail/trunk/NMail.SetupWizard/Task.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.Designer.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.cs
NMail/trunk/NMail.SetupWizard/WelcomePanel.resx
Modified: NMail/trunk/Installer/NMail-Installer.wxs
===================================================================
--- NMail/trunk/Installer/NMail-Installer.wxs 2006-11-11 09:38:54 UTC (rev 82)
+++ NMail/trunk/Installer/NMail-Installer.wxs 2006-11-11 10:49:28 UTC (rev 83)
@@ -19,6 +19,7 @@
<UpgradeVersion />
</Upgrade> -->
+
<!--
==
== Conditions
@@ -57,12 +58,12 @@
</File>
</Component>
- <Component Id="C_NMail.Administration.Console.exe" Guid="79E07802-0DD8-456c-ACD4-B82E5A351BBA">
+ <!--<Component Id="C_NMail.Administration.Console.exe" Guid="79E07802-0DD8-456c-ACD4-B82E5A351BBA">
<File Id="NMail.Administration.Console.exe" Name="NMailSh.exe" LongName="NMailAdminShell.exe" DiskId="1" Source="obj\NMail.Administration.Console.exe" Vital="yes">
<Shortcut Id="startmenuNMailSh" Directory="ProgramMenuDir" Name="NMailSh" LongName="NMail Admin Console 1.0" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="desktopNMailSh" Directory="DesktopFolder" Name="NMailSh" LongName="NMail Admin Console 1.0" WorkingDirectory="INSTALLDIR" />
</File>
- </Component>
+ </Component>-->
<Component Id="C_NMail.Server.Service.exe" Guid="7845A1AD-FF5E-4da9-A70C-924849ADD460">
<File Id="NMail.Server.Service.exe" Name="NMailSrv.exe" LongName="NMail.Server.Service.exe" DiskId="1" Source="obj\NMail.Server.Service.exe" Vital="yes" />
@@ -72,7 +73,13 @@
<!-- Account="NetworkService" -->
</Component>
+ <Component Id="C_NMail.SetupWizard.exe" Guid="EFAD461E-6D96-4b5b-B56C-77D39DF6B233">
+ <File Id="NMail.SetupWizard.exe" Name="SetupWiz.exe" LongName="NMail.SetupWizard.exe" DiskId="1" Source="obj\NMail.SetupWizard.exe" Vital="yes">
+ <Shortcut Id="startmenuNMailSetup" Directory="ProgramMenuDir" Name="SetupWiz" LongName="NMail Setup Wizard" WorkingDirectory="INSTALLDIR" />
+ </File>
+ </Component>
+
<!--
==
== Webpage
@@ -128,24 +135,37 @@
<Component Id="component15" DiskId="1" Guid="3E8F5756-8B2B-44dc-BCAB-CDBA16EF695E">
<File Id="file15" Name="WEB_1.SIT" LongName="Web.sitemap" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\Web.sitemap" />
</Component>
+ <Component Id="component39" DiskId="1" Guid="567BD98A-B437-4d06-A236-4710D647D0BE">
+ <File Id="file39" Name="tasklist.asc" LongName="TaskList.ascx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\TaskList.ascx" />
+ </Component>
+ <Component Id="component40" DiskId="1" Guid="157B362A-5104-42b1-B073-2A9259933AE8">
+ <File Id="file90" Name="setpass.asc" LongName="SetPasswordPanel.ascx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\SetPasswordPanel.ascx" />
+ </Component>
+ <Component Id="component41" DiskId="1" Guid="7943BF3C-869B-4465-A517-F6CFDB63545F">
+ <File Id="file91" Name="spool.asp" LongName="SpoolDetails.aspx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\SpoolDetails.aspx" />
+ </Component>
<Directory Id="directory1" Name="bin">
<Component Id="component16" DiskId="1" Guid="F1DDFAF8-BB62-45d2-BEAA-CCF24A85B6AE">
- <File Id="file40" Name="APP_CO_1.COM" LongName="App_Code.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Code.compiled" />
- <File Id="file41" Name="App_Code.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Code.dll" />
- <File Id="file42" Name="APP_GL_1.COM" LongName="App_global.asax.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_global.asax.compiled" />
- <File Id="file43" Name="APP_GL_1.DLL" LongName="App_global.asax.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_global.asax.dll" />
- <File Id="file44" Name="APAF9A_1.DLL" LongName="App_Web_createfolder.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_createfolder.aspx.cdcab7d2.dll" />
- <File Id="file45" Name="APP_WE_4.DLL" LongName="App_Web_createmaildomain.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_createmaildomain.aspx.cdcab7d2.dll" />
- <File Id="file46" Name="AP65FC_1.DLL" LongName="App_Web_createuser.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_createuser.aspx.cdcab7d2.dll" />
- <File Id="file47" Name="APD8FB_1.DLL" LongName="App_Web_folderdetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_folderdetails.aspx.cdcab7d2.dll" />
- <File Id="file48" Name="APP_WE_3.DLL" LongName="App_Web_login.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_login.aspx.cdcab7d2.dll" />
- <File Id="file49" Name="APEDBC_1.DLL" LongName="App_Web_maildomaindetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_maildomaindetails.aspx.cdcab7d2.dll" />
- <File Id="file50" Name="AP71CE_1.DLL" LongName="App_Web_userdetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_userdetails.aspx.cdcab7d2.dll" />
- <File Id="file51" Name="APP_WE_2.DLL" LongName="App_Web_viewfolders.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_viewfolders.aspx.cdcab7d2.dll" />
- <File Id="file52" Name="APP_WE_1.DLL" LongName="App_Web_viewmaildomains.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\App_Web_viewmaildomains.aspx.cdcab7d2.dll" />
- <File Id="file53" Name="log4net.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\log4net.dll" />
- <File Id="file54" Name="NMail.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\NMail.dll" />
- <File Id="file55" Name="NMAILS_1.DLL" LongName="NMail.Server.dll" Checksum="yes" Compressed="yes" Vital="yes" src="C:\Documents and Settings\Luke\Desktop\NMail-trunk\branches\luke-dev\Installer\obj\NMail.Administration.Web.Compiled\bin\NMail.Server.dll" />
+ <File Id="file40" Name="APP_CO_1.COM" LongName="App_Code.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Code.compiled" />
+ <File Id="file41" Name="App_Code.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Code.dll" />
+ <File Id="file42" Name="APP_GL_1.COM" LongName="App_global.asax.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_global.asax.compiled" />
+ <File Id="file43" Name="APP_GL_1.DLL" LongName="App_global.asax.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_global.asax.dll" />
+ <File Id="file44" Name="APAF9A_1.DLL" LongName="App_Web_createfolder.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_createfolder.aspx.cdcab7d2.dll" />
+ <File Id="file45" Name="APP_WE_4.DLL" LongName="App_Web_createmaildomain.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_createmaildomain.aspx.cdcab7d2.dll" />
+ <File Id="file46" Name="AP65FC_1.DLL" LongName="App_Web_createuser.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_createuser.aspx.cdcab7d2.dll" />
+ <File Id="file47" Name="APD8FB_1.DLL" LongName="App_Web_folderdetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_folderdetails.aspx.cdcab7d2.dll" />
+ <File Id="file48" Name="APP_WE_3.DLL" LongName="App_Web_login.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_login.aspx.cdcab7d2.dll" />
+ <File Id="file49" Name="APEDBC_1.DLL" LongName="App_Web_maildomaindetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_maildomaindetails.aspx.cdcab7d2.dll" />
+ <File Id="file50" Name="AP71CE_1.DLL" LongName="App_Web_userdetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_userdetails.aspx.cdcab7d2.dll" />
+ <File Id="file51" Name="APP_WE_2.DLL" LongName="App_Web_viewfolders.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_viewfolders.aspx.cdcab7d2.dll" />
+ <File Id="file52" Name="APP_WE_1.DLL" LongName="App_Web_viewmaildomains.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_viewmaildomains.aspx.cdcab7d2.dll" />
+ <File Id="file53" Name="log4net.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\log4net.dll" />
+ <File Id="file54" Name="NMail.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.dll" />
+ <File Id="file55" Name="NMAILS_1.DLL" LongName="NMail.Server.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.Server.dll" />
+ <File Id="file56" Name="APP_WE_4.DLL" LongName="App_Web_tasklist.ascx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_tasklist.ascx.cdcab7d2.dll" />
+ <File Id="file57" Name="APP_WE_5.DLL" LongName="App_Web_setpasswordpanel.ascx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_setpasswordpanel.ascx.cdcab7d2.dll" />
+ <File Id="file58" Name="APP_WE_6.DLL" LongName="App_Web_spooldetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_spooldetails.aspx.cdcab7d2.dll" />
+ <File Id="file59" Name="NMAILL_1.DLL" LongName="NMail.LocalStoreData.MySql.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.LocalStoreData.MySql.dll" />
</Component>
</Directory>
<Directory Id="directory2" Name="Images">
@@ -191,13 +211,28 @@
</Component>
</Directory>
</Directory>
+
+ <Directory Id="D_App_Themes" Name="AppTheme" LongName="App_Themes">
+ <Directory Id="D_Default" Name="Default">
+ <Component Id="component37" DiskId="1" Guid="FD0DED72-FFA7-4f3d-8640-1592535663B9">
+ <File Id="file37" Name="def.skn" LongName="Default.skin" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\App_Themes\Default\Default.skin" />
+ </Component>
+ <Component Id="component38" DiskId="1" Guid="153879DA-AAF8-4a49-8DDD-4D3EFAC7C71C">
+ <File Id="file38" Name="s.css" LongName="StyleSheet.css" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\App_Themes\Default\StyleSheet.css" />
+ </Component>
+ </Directory>
+ </Directory>
</Directory>
-
- <Component Id="C_VirtualWebDir" Guid="45A1A00F-7CAB-462f-A361-18566149FEBF">
+
+ <!-- <Component Id="C_VirtualWebDir" Guid="45A1A00F-7CAB-462f-A361-18566149FEBF">
<WebVirtualDir Id="WebVirtualDir" Alias="NMailAdmin" Directory="D_NMail.Administration.Web" WebSite="DefaultWebSite">
<WebApplication Id="WebApplication" Name="NMailAdmin" />
</WebVirtualDir>
- </Component>
+
+ <WebSite Id="DefaultWebSite" Description="Default Web Site" >
+ <WebAddress Id="AllUnassigned" Port="443" Secure="yes"/>
+ </WebSite>
+ </Component> -->
<!--
==
@@ -215,6 +250,8 @@
<Component Id="C_NMail.dll" Guid="0A709B39-711B-46a0-911A-05D12E66BBDD">
<File Id="NMail.dll" Name="NMail.dll" LongName="NMail.dll" DiskId="1" Source="obj\NMail.dll" Vital="yes" />
+ <Registry Id='R_NMail' Root='HKLM' Key='Software\NMail\NMail Server 1.0' Name='InstallDirectory' Action='write' Type='string' Value='[INSTALLDIR]' />
+ <RemoveFile Id='NMail.log' On='uninstall' Name='NMail.log' LongName='NMail.log' />
</Component>
<Component Id="C_NMail.DnsClient.dll" Guid="527A7514-6746-4ead-9E0C-60986478FB6A">
@@ -336,12 +373,31 @@
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
+
</Directory>
- <WebSite Id="DefaultWebSite" Description="Default Web Site">
- <WebAddress Id="AllUnassigned" Port="443" Secure="yes"/>
- </WebSite>
+
+ <!--
+ ==
+ == Custom actions and related
+ ==
+ -->
+
+ <Binary Id="B_NMail.PostInstall.exe" SourceFile="obj\NMail.PostInstall.exe" />
+ <CustomAction Id="CA_PostInstall" BinaryKey="B_NMail.PostInstall.exe" ExeCommand="" />
+ <CustomAction Id="CA_FinalUninstall" BinaryKey="B_NMail.PostInstall.exe" ExeCommand="/u" />
+
+ <InstallExecuteSequence>
+ <Custom Action="CA_PostInstall" After="InstallFinalize">$C_NMail.dll>2</Custom>
+ </InstallExecuteSequence>
+
+ <!--
+ ==
+ == Feature tree
+ ==
+ -->
+
<Feature Id="F_Base" Absent="disallow" Title="NMail" Level="1"
ConfigurableDirectory="INSTALLDIR" Display="expand"
Description="The components required in a NMail installation.">
@@ -358,8 +414,9 @@
<!-- NMail Server EXEs -->
<ComponentRef Id="C_NMail.Server.Console.exe" />
- <ComponentRef Id="C_NMail.Administration.Console.exe" />
+ <!--<ComponentRef Id="C_NMail.Administration.Console.exe" />-->
<ComponentRef Id="C_NMail.Server.Service.exe" />
+ <ComponentRef Id="C_NMail.SetupWizard.exe" />
<!-- NMail Server DLLs -->
<ComponentRef Id="C_MonoPrivileges.dll" />
@@ -391,7 +448,10 @@
<Feature Id="F_AdminWebsite" Display="expand" Title="Administration Website" Level="1"
Description="NMail's ASP.net administration website.">
- <ComponentRef Id="C_VirtualWebDir"/>
+ <!-- <Feature Id="F_SetupIIS" Display="expand" Title="Setup IIS Virtual Directory" Level="1"
+ Description="Setups IIS to have a virtual directory for NMail's administration website. Requires IIS.">
+ <ComponentRef Id="C_VirtualWebDir"/>
+ </Feature> -->
<!-- Admin website files -->
<ComponentRef Id="component0"/>
@@ -424,6 +484,11 @@
<ComponentRef Id="component34"/>
<ComponentRef Id="component35"/>
<ComponentRef Id="component36"/>
+ <ComponentRef Id="component37"/>
+ <ComponentRef Id="component38"/>
+ <ComponentRef Id="component39"/>
+ <ComponentRef Id="component40"/>
+ <ComponentRef Id="component41"/>
</Feature>
<Feature Id="F_DeveloperDoc" Display="expand" Title="Developer Documentation" Level="3"
Modified: NMail/trunk/Installer/NMail-installer.build
===================================================================
--- NMail/trunk/Installer/NMail-installer.build 2006-11-11 09:38:54 UTC (rev 82)
+++ NMail/trunk/Installer/NMail-installer.build 2006-11-11 10:49:28 UTC (rev 83)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<project name="nant" default="package">
<!-- default configuration -->
- <property name="project.config" value="Debug" />
+ <property name="project.config" value="Release" />
<property name="current.build.defines" value="" />
<target name="Debug" description="Packages up a 'debug' build into an installer">
@@ -72,6 +72,7 @@
<!-- Compile the installer package -->
<exec program="candle" verbose="true">
+ <arg value="-nologo" />
<arg value="-out" />
<arg>
<path>
@@ -84,6 +85,7 @@
<!-- Link the installer package -->
<exec program="light">
<!-- TODO: add a date and revision number into the installer name -->
+ <arg value="-nologo" />
<arg value="-out" />
<arg><path><pathelement file="${output.dir}/NMail-${project.config}-${build.date}.msi" /></path></arg>
Modified: NMail/trunk/MonoPrivileges/MonoPrivileges.csproj
===================================================================
--- NMail/trunk/MonoPrivileges/MonoPrivileges.csproj 2006-11-11 09:38:54 UTC (rev 82)
+++ NMail/trunk/MonoPrivileges/MonoPrivileges.csproj 2006-11-11 10:49:28 UTC (rev 83)
@@ -28,7 +28,7 @@
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\References\NMail\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
@@ -51,7 +51,7 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\References\NMail\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Modified: NMail/trunk/NDns/NDns.csproj
===================================================================
--- NMail/trunk/NDns/NDns.csproj 2006-11-11 09:38:54 UTC (rev 82)
+++ NMail/trunk/NDns/NDns.csproj 2006-11-11 10:49:28 UTC (rev 83)
@@ -28,7 +28,7 @@
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\References\NMail\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
@@ -50,7 +50,7 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\References\NMail\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Deleted: NMail/trunk/NDns/NDns.xml
===================================================================
--- NMail/trunk/NDns/NDns.xml 2006-11-11 09:38:54 UTC (rev 82)
+++ NMail/trunk/NDns/NDns.xml 2006-11-11 10:49:28 UTC (rev 83)
@@ -1,921 +0,0 @@
-<?xml version="1.0"?>
-<doc>
- <assembly>
- <name>NDns</name>
- </assembly>
- <members>
- <member name="T:NDns.Message.Header">
- <summary>
- Represents the header component of a DNS message.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.id">
- <summary>
- A 16 bit Id number to identify this message.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.response">
- <summary>
- Was this message a query or a response?
- </summary>
- </member>
- <member name="F:NDns.Message.Header.opcode">
- <summary>
- A four bit field that specifies query type in the message.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.authoritative">
- <summary>
- Is the answer authoritative?
- </summary>
- </member>
- <member name="F:NDns.Message.Header.truncated">
- <summary>
- Was the message truncated due to size constraints?
- </summary>
- </member>
- <member name="F:NDns.Message.Header.recursionDesired">
- <summary>
- Is recursion desired?
- </summary>
- </member>
- <member name="F:NDns.Message.Header.recursionAvailable">
- <summary>
- Is recursion available?
- </summary>
- </member>
- <member name="F:NDns.Message.Header.rcode">
- <summary>
- The response code for this message.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.questionEntries">
- <summary>
- An unsigned 16 bit integer specifying the number of entries in the
- question section.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.answerEntries">
- <summary>
- An unsigned 16 bit integer specifying the number of resource
- records in the answer section.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.nameServerEntries">
- <summary>
- An unsigned 16 bit integer specifying the number of name server
- resource records in the authority records section.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.additionalEntries">
- <summary>
- An unsigned 16 bit integer specifying the number of resource records in
- the additional records section.
- </summary>
- </member>
- <member name="F:NDns.Message.Header.lastId">
- <summary>
- The last Id number assigned to a DNS message.
- </summary>
- </member>
- <member name="M:NDns.Message.Header.#ctor">
- <summary>
- Creates a new DNS message header with a unique Id number.
- </summary>
- </member>
- <member name="M:NDns.Message.Header.#ctor(System.Byte[],System.UInt16,System.UInt16@)">
- <summary>
- Creates a new DNS message header using the given data. This data is
- typically the response from a DNS server.
- </summary>
- <param name="data">The data to create the message header from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- </member>
- <member name="M:NDns.Message.Header.GetId">
- <summary>
- Gets the next available Id number.
- </summary>
- <returns>The Id number.</returns>
- </member>
- <member name="M:NDns.Message.Header.ToByteArray">
- <summary>
- Converts the header to a byte array ready to send in a DNS message.
- </summary>
- <returns>The header as a byte array.</returns>
- </member>
- <member name="M:NDns.Message.Header.CreateOpCode(System.Byte)">
- <summary>
- Creates the opcode that corresponds to the given byte.
- </summary>
- <param name="opcode">The data to create the opcode from.</param>
- <returns>The opcode.</returns>
- </member>
- <member name="M:NDns.Message.Header.CreateResponseCode(System.Byte)">
- <summary>
- Creates the response code that corresponds to the given byte.
- </summary>
- <param name="rcode">The data to create the response code from.</param>
- <returns>The response code.</returns>
- </member>
- <member name="P:NDns.Message.Header.Id">
- <summary>
- Gets the Id number for this header (and thus message).
- </summary>
- </member>
- <member name="T:NDns.Message.AnswerSection">
- <summary>
- A answer section entry in a DNS message.
- </summary>
- </member>
- <member name="F:NDns.Message.AnswerSection.answerName">
- <summary>
- The string name in this answer.
- </summary>
- </member>
- <member name="F:NDns.Message.AnswerSection.answerType">
- <summary>
- The type of record.
- </summary>
- </member>
- <member name="F:NDns.Message.AnswerSection.answerClass">
- <summary>
- The query class.
- </summary>
- </member>
- <member name="F:NDns.Message.AnswerSection.answerTTL">
- <summary>
- The time to live for the answer.
- </summary>
- </member>
- <member name="F:NDns.Message.AnswerSection.answerRecord">
- <summary>
- The record data associated with this record.
- </summary>
- </member>
- <member name="M:NDns.Message.AnswerSection.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
- <summary>
- Creates a answer section from the given byte data.
- </summary>
- <param name="data">The data to create the answer section from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
- </member>
- <member name="P:NDns.Message.AnswerSection.Record">
- <summary>
- The answer record associated with this answer entry.
- </summary>
- </member>
- <member name="T:NDns.Message.Records.CNameRecord">
- <summary>
- A DNS Canonical NAME record.
- </summary>
- </member>
- <member name="T:NDns.Message.Records.Record">
- <summary>
- A DNS record.
- </summary>
- </member>
- <member name="F:NDns.Message.Records.Record.type">
- <summary>
- The type of this record.
- </summary>
- </member>
- <member name="F:NDns.Message.Records.Record.recordTTL">
- <summary>
- The time to live for this record (in seconds).
- </summary>
- </member>
- <member name="F:NDns.Message.Records.Record.creationTime">
- <summary>
- The time this record was created.
- </summary>
- </member>
- <member name="M:NDns.Message.Records.Record.#ctor">
- <summary>
- Creates a new DNS record.
- </summary>
- </member>
- <member name="P:NDns.Message.Records.Record.Type">
- <summary>
- Returns the type for this record.
- </summary>
- </member>
- <member name="P:NDns.Message.Records.Record.Data">
- <summary>
- The data associated with this record as a user readable string.
- </summary>
- </member>
- <member name="P:NDns.Message.Records.Record.TTL">
- <summary>
- Gets and sets the time to live for this record (in seconds).
- </summary>
- </member>
- <member name="F:NDns.Message.Records.CNameRecord.cName">
- <summary>
- The canonical name for this record.
- </summary>
- </member>
- <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.String)">
- <summary>
- Creates a CName record from the given domain.
- </summary>
- <param name="cName">The string of the canonical name.</param>
- </member>
- <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
- <summary>
- Creates a CName record from the given byte data.
- </summary>
- <param name="data">The data to create the CName record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
- </member>
- <member name="P:NDns.Message.Records.CNameRecord.CName">
- <summary>
- Returns the canonical name for this record.
- </summary>
- </member>
- <member name="P:NDns.Message.Records.CNameRecord.Data">
- <summary>
- The data associated with this record as a user readable string.
- </summary>
- </member>
- <member name="T:NDns.QueryFactory">
- <summary>
- A factory class for creating DNS query and response messages.
- </summary>
- </member>
- <member name="M:NDns.QueryFactory.CreateQuery(System.String,NDns.Message.QType)">
- <summary>
- Creates a new DNS query to look up the record for the query string and type.
- </summary>
- <param name="queryString">The query string to pack.</param>
- <param name="queryType">The type of the query.</param>
- <returns>The DNS message.</returns>
- </member>
- <member name="T:NDns.Message.Records.PTRRecord">
- <summary>
- A DNS PTR record.
- </summary>
- </member>
- <member name="F:NDns.Message.Records.PTRRecord.name">
- <summary>
- The name for this record.
- </summary>
- </member>
- <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.String)">
- <summary>
- Creates a PTR record from the given domain.
- </summary>
- <param name="name">The string of the name.</param>
- </member>
- <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
- <summary>
- Creates a PTR record from the given byte data.
- </summary>
- <param name="data">The data to create the CName record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
- </member>
- <member name="P:NDns.Message.Records.PTRRecord.Name">
- <summary>
- Returns the name for this record.
- </summary>
- </member>
- <member name="P:NDns.Message.Records.PTRRecord.Data">
- <summary>
- The data associated with this record as a user readable string.
- </summary>
- </member>
- <member name="T:NDns.DnsCache">
- <summary>
- Provides a cache for DNS information.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.DnsPort">
- <summary>
- The port to query remote dns servers on.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.log">
- <summary>
- Logging support for this class.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.mxServers">
- <summary>
- A hash table of arrays of MX records indexed by string name
- (e.g. an array of MX records for "anu.edu.au").
- </summary>
- </member>
- <member name="F:NDns.DnsCache.mxQueue">
- <summary>
- A list of MX records ordered according to last use.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.domains">
- <summary>
- A hash table of string records indexed by IP address
- </summary>
- </member>
- <member name="F:NDns.DnsCache.domainQueue">
- <summary>
- A list of string records ordered according to last use.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.addresses">
- <summary>
- A hash table of ip address record arrays indexed by string name
- (e.g. an array of A records for "www.anu.edu.au").
- </summary>
- </member>
- <member name="F:NDns.DnsCache.addressQueue">
- <summary>
- A list of address records ordered according to last use.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.MXCacheSize">
- <summary>
- The maximum number of MX record arrays to store.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.DomainCacheSize">
- <summary>
- The maximum number of string names to store.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.AddressCacheSize">
- <summary>
- The maximum number of A record arrays to store.
- </summary>
- </member>
- <member name="F:NDns.DnsCache.config">
- <summary>
- The configuration for this DNS cache.
- </summary>
- </member>
- <member name="M:NDns.DnsCache.#ctor(NDns.Configuration.NDnsConfiguration)">
- <summary>
- Creates a new instance of the DNS this.
- </summary>
- </member>
- <member name="M:NDns.DnsCache.DomainMatchesAddress(System.Net.IPAddress,System.String)">
- <summary>
- Checks if the given string and address match.
- </summary>
- <param name="address">The address to check.</param>
- <param name="domain">The string to check.</param>
- <returns>True if the string corresponds to the address.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetHostName(System.Net.EndPoint)">
- <summary>
- Gets a hostname for the specified end point.
- </summary>
- <param name="endPoint">The end point to lookup</param>
- <returns>The hostname.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetHostName(System.Net.IPAddress)">
- <summary>
- Gets a hostname for the specified address.
- </summary>
- <param name="address">The address to lookup</param>
- <returns>The hostname.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetHostNames(System.Net.IPAddress)">
- <summary>
- Gets a hostnames for the specified address.
- </summary>
- <param name="address">The address to lookup</param>
- <returns>The address.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetIPAddress(System.String)">
- <summary>
- Gets the first IP address associated with the given domain name.
- </summary>
- <param name="domainName">The domain name to resolve.</param>
- <returns>The IP address.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetIPAddresses(System.String)">
- <summary>
- Looks up IP addresses for the given string name.
- </summary>
- <param name="domainName">The string name to lookup the addresses for.</param>
- <returns>The IP addresses for the string name.</returns>
- </member>
- <member name="M:NDns.DnsCache.LookupRecords(System.String,NDns.Message.QType)">
- <summary>
- Looks up DNS records using the specified query string and query type.
- </summary>
- <param name="queryString">The query to send.</param>
- <param name="queryType">The query type.</param>
- <returns>The array of records from the DNS server.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetPTRRecords(System.Net.IPAddress)">
- <summary>
- Gets the PTR records for the specified IP address caching the results.
- This method also respects TTL for the records.
- </summary>
- <param name="address">The address to lookup</param>
- <returns>The PTR records.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetARecords(System.String)">
- <summary>
- Gets address records for the specified hostname caching the results.
- This method also respects TTL for the records.
- </summary>
- <param name="domainName">The hostname to lookup</param>
- <returns>The address records.</returns>
- </member>
- <member name="M:NDns.DnsCache.GetMXRecords(System.String)">
- <summary>
- Looks up MX records for the given string name caching the results.
- This method also respects TTL for the records.
- </summary>
- <param name="domainName">The string to get the MX records for.</param>
- <returns>The MX records</returns>
- </member>
- <member name="M:NDns.DnsCache.LookupMXRecords(System.String)">
- <summary>
- Looks up MX records from the DNS server handling empty answer
- sections but not caching records.
- </summary>
- <param name="domainName">The string to look up the MX records for.</param>
- <returns>The MX records for the given domain.</returns>
- </member>
- <member name="M:NDns.DnsCache.LookupPTRRecords(System.Net.IPAddress)">
- <summary>
- Looks up PTR records from the DNS server but does not cache records.
- </summary>
- <param name="address">The string to look up the PTR records for.</param>
- <returns>The PTR records for the given domain.</returns>
- </member>
- <member name="M:NDns.DnsCache.LookupARecords(System.String)">
- <summary>
- Looks up address records from the DNS server but does not cache records.
- </summary>
- <param name="domainName">The string name to lookup the addresses for.</param>
- <returns>The addresses records for the given domain.</returns>
- </member>
- <member name="M:NDns.DnsCache.ConvertToIPAddresses(NDns.Message.Records.ARecord[])">
- <summary>
- Converts an array of address records into an array of IP addresses.
- </summary>
- <param name="records">The records to convert.</param>
- <returns>The IP addresses.</returns>
- </member>
- <member name="M:NDns.DnsCache.ConvertToHostnames(NDns.Message.Records.PTRRecord[])">
- <summary>
- Converts an array of PTR records into an array of hostnames.
- </summary>
- <param name="records">The records to convert.</param>
- <returns>The hostnames.</returns>
- </member>
- <member name="M:NDns.DnsCache.PerformQuery(NDns.Message.DNSMessage)">
- <summary>
- Queries a DNS server using the given DNS query.
- </summary>
- <param name="queryMessage">The query to send to the server.</param>
- <returns>The response from the server.</returns>
- </member>
- <member name="T:NDns.Message.ResponseCode">
- <summary>
- The response code is a 4 bit field is set as part of responses.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.NoError">
- <summary>
- No error condition.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.FormatError">
- <summary>
- The name server was unable to interpret the query.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.ServerFailure">
- <summary>
- The name server was unable to process this query due to a problem
- with the name server.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.NameError">
- <summary>
- Meaningful only for responses from an authoritative name server,
- this code signifies that the string name referenced in the query
- does not exist.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.NotImplemented">
- <summary>
- The name server does not support the requested kind of query.
- </summary>
- </member>
- <member name="F:NDns.Message.ResponseCode.Refused">
- <summary>
- The name server refuses to perform the specified operation for
- policy reasons.
- </summary>
- </member>
- <member name="T:NDns.Message.Records.MXRecord">
- <summary>
- A DNS Mail eXchanger record.
- </summary>
- </member>
- <member name="F:NDns.Message.Records.MXRecord.preference">
- <summary>
- The preference associated with this MX record.
- </summary>
- </member>
- <member name="F:NDns.Message.Records.MXRecord.mxName">
- <summary>
- The name of the MX server.
- </summary>
- </member>
- <member name="M...
[truncated message content] |
|
From: <tmy...@us...> - 2006-11-11 09:39:08
|
Revision: 82
http://svn.sourceforge.net/nmailserver/?rev=82&view=rev
Author: tmyroadctfig
Date: 2006-11-11 01:38:54 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Work on TCP remoting security.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.Administration.Web/Global.asax
NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs
NMail/branches/luke-dev/NMail.Server/NMail.Server.csproj
NMail/branches/luke-dev/NMail.Server/RemoteAdministration.cs
Modified: NMail/branches/luke-dev/NMail.Administration.Web/Global.asax
===================================================================
--- NMail/branches/luke-dev/NMail.Administration.Web/Global.asax 2006-11-11 09:37:34 UTC (rev 81)
+++ NMail/branches/luke-dev/NMail.Administration.Web/Global.asax 2006-11-11 09:38:54 UTC (rev 82)
@@ -4,6 +4,9 @@
void Application_Start(object sender, EventArgs e)
{
+ Hashtable properties = new Hashtable();
+ properties.Add("secure", true);
+ System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel(properties, null), false);
}
void Application_End(object sender, EventArgs e)
Modified: NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs 2006-11-11 09:37:34 UTC (rev 81)
+++ NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs 2006-11-11 09:38:54 UTC (rev 82)
@@ -5,6 +5,7 @@
using System.Net.Security;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting.Lifetime;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
@@ -28,7 +29,7 @@
protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
{
System.Web.UI.WebControls.Login login = (System.Web.UI.WebControls.Login)this.LoginView.FindControl("Login");
-
+
RemoteAdministration ra = (RemoteAdministration)Activator.GetObject(typeof(RemoteAdministration), "tcp://localhost:7877/RemoteAdministration.rem");
IAuthenticationToken authToken = ra.NMailServer.AuthenticationProvider.Authenticate(login.UserName, login.Password);
Modified: NMail/branches/luke-dev/NMail.Server/NMail.Server.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.Server/NMail.Server.csproj 2006-11-11 09:37:34 UTC (rev 81)
+++ NMail/branches/luke-dev/NMail.Server/NMail.Server.csproj 2006-11-11 09:38:54 UTC (rev 82)
@@ -108,6 +108,7 @@
<Compile Include="NMailServer.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="RemoteAdminAuthorisation.cs" />
<Compile Include="RemoteAdministration.cs">
<SubType>Code</SubType>
</Compile>
Modified: NMail/branches/luke-dev/NMail.Server/RemoteAdministration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Server/RemoteAdministration.cs 2006-11-11 09:37:34 UTC (rev 81)
+++ NMail/branches/luke-dev/NMail.Server/RemoteAdministration.cs 2006-11-11 09:38:54 UTC (rev 82)
@@ -49,7 +49,7 @@
}
}
- private static TcpChannel channel;
+ private static TcpServerChannel channel;
public static void ShutdownChannel() {
if (channel != null) {
@@ -70,7 +70,8 @@
// Setup the remoting channel
IDictionary props = new Hashtable();
props["port"] = "7877";
- channel = new TcpChannel(props, null, provider);
+ props["secure"] = true;
+ channel = new TcpServerChannel(props, provider, new RemoteAdminAuthorisation());
ChannelServices.RegisterChannel(channel, false);
// Register our remote administration interface
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-11 09:37:48
|
Revision: 81
http://svn.sourceforge.net/nmailserver/?rev=81&view=rev
Author: tmyroadctfig
Date: 2006-11-11 01:37:34 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
Removed TCP channel.
Modified Paths:
--------------
NMail/branches/luke-dev/Installer/NMail-Installer.wxs
NMail/branches/luke-dev/NMail/NMail.csproj
NMail/branches/luke-dev/NMail.Administration.Console/Context/TopLevelContext.cs
Removed Paths:
-------------
NMail/branches/luke-dev/NMail/IO/TcpChannel.cs
NMail/branches/luke-dev/NMail/IO/TcpClientChannel.cs
NMail/branches/luke-dev/NMail/IO/TcpClientTransportSink.cs
NMail/branches/luke-dev/NMail/IO/TcpClientTransportSinkProvider.cs
NMail/branches/luke-dev/NMail/IO/TcpServerChannel.cs
NMail/branches/luke-dev/NMail/IO/TcpServerTransportSink.cs
Modified: NMail/branches/luke-dev/Installer/NMail-Installer.wxs
===================================================================
--- NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-11 09:37:34 UTC (rev 81)
@@ -58,12 +58,12 @@
</File>
</Component>
- <Component Id="C_NMail.Administration.Console.exe" Guid="79E07802-0DD8-456c-ACD4-B82E5A351BBA">
+ <!--<Component Id="C_NMail.Administration.Console.exe" Guid="79E07802-0DD8-456c-ACD4-B82E5A351BBA">
<File Id="NMail.Administration.Console.exe" Name="NMailSh.exe" LongName="NMailAdminShell.exe" DiskId="1" Source="obj\NMail.Administration.Console.exe" Vital="yes">
<Shortcut Id="startmenuNMailSh" Directory="ProgramMenuDir" Name="NMailSh" LongName="NMail Admin Console 1.0" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="desktopNMailSh" Directory="DesktopFolder" Name="NMailSh" LongName="NMail Admin Console 1.0" WorkingDirectory="INSTALLDIR" />
</File>
- </Component>
+ </Component>-->
<Component Id="C_NMail.Server.Service.exe" Guid="7845A1AD-FF5E-4da9-A70C-924849ADD460">
<File Id="NMail.Server.Service.exe" Name="NMailSrv.exe" LongName="NMail.Server.Service.exe" DiskId="1" Source="obj\NMail.Server.Service.exe" Vital="yes" />
@@ -414,7 +414,7 @@
<!-- NMail Server EXEs -->
<ComponentRef Id="C_NMail.Server.Console.exe" />
- <ComponentRef Id="C_NMail.Administration.Console.exe" />
+ <!--<ComponentRef Id="C_NMail.Administration.Console.exe" />-->
<ComponentRef Id="C_NMail.Server.Service.exe" />
<ComponentRef Id="C_NMail.SetupWizard.exe" />
Deleted: NMail/branches/luke-dev/NMail/IO/TcpChannel.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpChannel.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpChannel.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,373 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Net.Security;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-
-namespace NMail.IO {
- /// <summary>
- /// Provides a TCP transport channel with encryption and authentication.
- /// </summary>
- public class TcpChannel : IChannelSender, IChannelReceiver {
-
- private TcpClientChannel clientChannel;
-
- private TcpServerChannel serverChannel;
-
- public TcpChannel(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider) {
- // Parse common properties
- bool useTls = true;
- if (properties.Contains("useTls")) {
- useTls = (bool) properties["useTls"];
- }
-
- // Create the client sink provider if needed
- if (clientSinkProvider == null) {
- clientSinkProvider = new BinaryClientFormatterSinkProvider();
- }
-
- // Parse the client properties
- RemoteCertificateValidationCallback certValidationCallback = (RemoteCertificateValidationCallback) properties["certificateValidation"];
- GetAuthDetailsDelegate getAuthDetailsCallback = (GetAuthDetailsDelegate) properties["authDetailCallback"];
- ChannelAuthComplete authCompleteCallback = (ChannelAuthComplete) properties["authCompleteCallback"];
-
- this.clientChannel = new TcpClientChannel(clientSinkProvider,
- getAuthDetailsCallback,
- certValidationCallback,
- authCompleteCallback,
- useTls);
-
- if (properties["isServer"] != null && ((string) properties["isServer"]) == "yes") {
- // Create the server sink provider if needed
- if (serverSinkProvider == null) {
- serverSinkProvider = new BinaryServerFormatterSinkProvider();
- }
-
- // Parse the server properties
- int port = Int32.Parse((string) properties["port"]);
- X509Certificate2 certificate = (X509Certificate2) properties["certificate"];
- IAuthenticationProvider authProvider = (IAuthenticationProvider) properties["authProvider"];
-
- this.serverChannel = new TcpServerChannel(port,
- certificate,
- authProvider,
- serverSinkProvider,
- useTls);
- }
- }
-
- #region IChannel Members
- /// <summary>
- /// The name of this channel.
- /// </summary>
- public string ChannelName {
- get {
- return TcpChannel.Name;
- }
- }
-
- /// <summary>
- /// The priority of this channel.
- /// </summary>
- public int ChannelPriority {
- get {
- return TcpChannel.Priority;
- }
- }
-
- /// <summary>
- /// Returns the object URI as an out parameter, and the URI of the current
- /// channel as the return value.
- /// </summary>
- /// <param name="url">The URL of the object.</param>
- /// <param name="objectURI">
- /// When this method returns, contains the object URI. This parameter is
- /// passed uninitialized.
- /// </param>
- /// <returns>
- /// The URI of the current channel, or null if the URI does not belong to
- /// this channel.
- /// </returns>
- public string Parse(string url, out string objectURI) {
- return TcpChannel.ParseUrl(url, out objectURI);
- }
- #endregion
-
- #region IChannelSender Members
- /// <summary>
- /// Returns a channel message sink that delivers messages to the specified URL
- /// or channel data object.
- /// </summary>
- /// <param name="url">
- /// The URL to which the new sink will deliver messages. Can be null.
- /// </param>
- /// <param name="remoteChannelData">
- /// The channel data object of the remote host to which the new sink will
- /// deliver messages. Can be null.
- /// </param>
- /// <param name="objectURI">
- /// When this method returns, contains a URI of the new channel message sink
- /// that delivers messages to the specified URL or channel data object. This
- /// parameter is passed uninitialized.
- /// </param>
- /// <returns>
- /// A channel message sink that delivers messages to the specified URL or
- /// channel data object, or null if the channel cannot connect to the given
- /// endpoint.
- /// </returns>
- public IMessageSink CreateMessageSink(string url, object remoteChannelData, out string objectURI) {
- return this.clientChannel.CreateMessageSink(url, remoteChannelData, out objectURI);
- }
- #endregion
-
- #region IChannelReceiver Members
- /// <summary>
- /// Gets the channel-specific data.
- /// </summary>
- public object ChannelData {
- get {
- if (this.serverChannel != null) {
- return this.serverChannel.ChannelData;
- }
-
- return null;
- }
- }
-
- /// <summary>
- /// Returns an array of all the URLs for a URI.
- /// </summary>
- /// <param name="objectURI">The URI for which URLs are required.</param>
- /// <returns>The array of URLs.</returns>
- public string[] GetUrlsForUri(string objectURI) {
- if (this.serverChannel != null) {
- return this.serverChannel.GetUrlsForUri(objectURI);
- }
-
- return null;
- }
-
- /// <summary>
- /// Instructs the current channel to start listening for requests.
- /// </summary>
- /// <param name="data">Optional initialization information.</param>
- public void StartListening(object data) {
- if (this.serverChannel != null) {
- this.serverChannel.StartListening(data);
- }
- }
-
- /// <summary>
- /// Instructs the current channel to stop listening for requests.
- /// </summary>
- /// <param name="data">Optional state information for the channel.</param>
- public void StopListening(object data) {
- if (this.serverChannel != null) {
- this.serverChannel.StopListening(data);
- }
- }
- #endregion
-
- /// <summary>
- /// Checks if the given URL is valid.
- /// </summary>
- /// <param name="url">The url to check.</param>
- /// <returns>True if valid.</returns>
- public static bool ValidUrl(string url) {
- Host host;
- int port;
- string objectUri;
-
- return ParseUrl(url, out host, out port, out objectUri);
- }
-
- /// <summary>
- /// Returns the object URI as an out parameter, and the URI of the current
- /// channel as the return value.
- /// </summary>
- /// <param name="url">The URL of the object.</param>
- /// <param name="objectURI">
- /// When this method returns, contains the object URI. This parameter is
- /// passed uninitialized.
- /// </param>
- /// <returns>
- /// The URI of the current channel, or null if the URI does not belong to
- /// this channel.
- /// </returns>
- public static string ParseUrl(string url, out string objectURI) {
- Host host;
- int port;
-
- if (TcpChannel.ParseUrl(url, out host, out port, out objectURI)) {
- return UrlPrefix + host.ToString() + ":" + port;
- }
-
- return null;
- }
-
- /// <summary>
- /// Parses the given url and extracts the parts.
- /// </summary>
- /// <param name="url">The URL to parse.</param>
- /// <param name="host">The host in the URL or null if the URL is invalid.</param>
- /// <param name="port">The port in the URL or -1 if the URL is invalid.</param>
- /// <param name="objectURI">The object URI in the URL or null if the URL is invalid.</param>
- /// <returns>True if the URL is valid.</returns>
- public static bool ParseUrl(string url, out Host host, out int port, out string objectURI) {
-
- if (url == null || !url.StartsWith(UrlPrefix) || url.IndexOf(':') == -1 || url.IndexOf('/') == -1) {
- // Invalid URL
- host = null;
- port = -1;
- objectURI = null;
- return false;
- }
-
- url = url.Trim();
-
- // Remove the "nmtcp://"
- url = url.Remove(0, UrlPrefix.Length);
-
- int cIndex = url.IndexOf(':');
- int sIndex = url.IndexOf('/');
- if (sIndex == -1) {
- sIndex = url.Length;
- }
- host = new Host(url.Substring(0, cIndex));
- port = Int32.Parse(url.Substring(cIndex + 1, sIndex - cIndex - 1));
- objectURI = url.Substring(sIndex);
-
- return true;
- }
-
- /// <summary>
- /// The prefix for all NMail remoting channel urls.
- /// </summary>
- public const string UrlPrefix = "nmtcp://";
-
- /// <summary>
- /// The name that this channel uses.
- /// </summary>
- public const string Name = "NMail-TCP";
-
- /// <summary>
- /// The priority that this channel uses.
- /// </summary>
- public const int Priority = 1;
- }
-
- #region TcpMessage
- /// <summary>
- /// A remoting message that is sent across the TCP channel.
- /// </summary>
- [Serializable]
- internal class TcpMessage {
- /// <summary>
- /// Creates a new message with the given headers and data.
- /// </summary>
- /// <param name="headers">The request or response headers.</param>
- /// <param name="data">The message data.</param>
- internal TcpMessage(ITransportHeaders headers, byte[] data) {
- this.headers = headers;
- this.data = data;
- }
-
- private ITransportHeaders headers;
-
- /// <summary>
- /// The request or response headers.
- /// </summary>
- internal ITransportHeaders Headers {
- get {
- return this.headers;
- }
- set {
- this.headers = value;
- }
- }
-
- private byte[] data;
-
- /// <summary>
- /// The message data.
- /// </summary>
- internal byte[] Data {
- get {
- return this.data;
- }
- set {
- this.data = value;
- }
- }
-
- /// <summary>
- /// Sends a message over the given connection.
- /// </summary>
- /// <param name="connection">The connection to send the message with.</param>
- /// <param name="data">The data to send.</param>
- /// <param name="headers">The headers.</param>
- public static void SendMessage(TcpTextConnection connection, Stream data, ITransportHeaders headers) {
- MemoryStream ms = new MemoryStream();
- byte[] buffer = new byte[1024];
-
- int bytesRead = data.Read(buffer, 0, buffer.Length);
-
- while (bytesRead > 0) {
- ms.Write(buffer, 0, bytesRead);
- bytesRead = data.Read(buffer, 0, buffer.Length);
- }
-
- TcpMessage message = new TcpMessage(headers, ms.GetBuffer());
- connection.Write(message);
- }
- }
- #endregion
-
- [Serializable]
- public class TcpUserPasswordPair {
- public TcpUserPasswordPair(string username, string password) {
- this.username = username;
- this.password = password;
- }
-
- private string username;
-
- public string Username {
- get {
- return this.username;
- }
- }
-
- private string password;
-
- public string Password {
- get {
- return this.password;
- }
- }
- }
-}
\ No newline at end of file
Deleted: NMail/branches/luke-dev/NMail/IO/TcpClientChannel.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpClientChannel.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpClientChannel.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,154 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Text;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-
-namespace NMail.IO {
- /// <summary>
- /// Provides a TCP client transport channel with authentication and encryption.
- /// </summary>
- public class TcpClientChannel : IChannelSender {
- /// <summary>
- /// The provider to use.
- /// </summary>
- private IClientChannelSinkProvider clientSinkProvider;
-
- /// <summary>
- /// The tranport sink provider.
- /// </summary>
- private TcpClientTransportSinkProvider transportSinkProvider;
-
- /// <summary>
- /// Creates a new client channel with the given provider.
- /// </summary>
- /// <param name="clientSinkProvider">The provider to use.</param>
- /// <param name="certValidationCallback">The certificate to use to validate the remote server's certificate.</param>
- public TcpClientChannel(IClientChannelSinkProvider clientSinkProvider, GetAuthDetailsDelegate getAuthDetailsCallback, RemoteCertificateValidationCallback certValidationCallback, ChannelAuthComplete authCompleteCallback, bool useTls) {
- this.clientSinkProvider = clientSinkProvider;
-
- this.transportSinkProvider = new TcpClientTransportSinkProvider(getAuthDetailsCallback, certValidationCallback, authCompleteCallback, useTls);
-
- if (this.clientSinkProvider == null) {
- this.clientSinkProvider = new BinaryClientFormatterSinkProvider();
- }
- }
-
- #region IChannelSender Members
- /// <summary>
- /// Returns a channel message sink that delivers messages to the specified URL
- /// or channel data object.
- /// </summary>
- /// <param name="url">
- /// The URL to which the new sink will deliver messages. Can be null.
- /// </param>
- /// <param name="remoteChannelData">
- /// The channel data object of the remote host to which the new sink will
- /// deliver messages. Can be null.
- /// </param>
- /// <param name="objectURI">
- /// When this method returns, contains a URI of the new channel message sink
- /// that delivers messages to the specified URL or channel data object. This
- /// parameter is passed uninitialized.
- /// </param>
- /// <returns>
- /// A channel message sink that delivers messages to the specified URL or
- /// channel data object, or null if the channel cannot connect to the given
- /// endpoint.
- /// </returns>
- public IMessageSink CreateMessageSink(string url, object remoteChannelData, out string objectURI) {
- if (url == null && remoteChannelData != null && remoteChannelData is IChannelDataStore) {
- IChannelDataStore ds = (IChannelDataStore) remoteChannelData;
- url = ds.ChannelUris[0];
- }
-
- if (TcpChannel.ValidUrl(url)) {
- // Parse the object URI
- TcpChannel.ParseUrl(url, out objectURI);
-
- // Find the last provider
- IClientChannelSinkProvider provider = this.clientSinkProvider;
- while (provider.Next != null) {
- provider = provider.Next;
- }
-
- // Add our transport to the end of the chain
- provider.Next = this.transportSinkProvider;
-
- return (IMessageSink) this.clientSinkProvider.CreateSink(this, url, remoteChannelData);
-
- } else {
- // The URL is not for our channel.
- objectURI = null;
- return null;
- }
- }
- #endregion
-
- #region IChannel Members
- /// <summary>
- /// The name of this channel.
- /// </summary>
- public string ChannelName {
- get {
- return TcpChannel.Name;
- }
- }
-
- /// <summary>
- /// The priority of this channel.
- /// </summary>
- public int ChannelPriority {
- get {
- return TcpChannel.Priority;
- }
- }
-
- /// <summary>
- /// Returns the object URI as an out parameter, and the URI of the current
- /// channel as the return value.
- /// </summary>
- /// <param name="url">The URL of the object.</param>
- /// <param name="objectURI">
- /// When this method returns, contains the object URI. This parameter is
- /// passed uninitialized.
- /// </param>
- /// <returns>
- /// The URI of the current channel, or null if the URI does not belong to
- /// this channel.
- /// </returns>
- public string Parse(string url, out string objectURI) {
- return TcpChannel.ParseUrl(url, out objectURI);
- }
- #endregion
- }
-
- public delegate TcpUserPasswordPair GetAuthDetailsDelegate(object sender);
-
- public delegate void ChannelAuthComplete(IAuthenticationToken authToken);
-}
Deleted: NMail/branches/luke-dev/NMail/IO/TcpClientTransportSink.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpClientTransportSink.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpClientTransportSink.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,320 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Text;
-using System.Threading;
-
-using log4net;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-using NMail.Helper;
-
-namespace NMail.IO {
- /// <summary>
- /// A client transport sink for the NMail TCP channel.
- /// </summary>
- public class TcpClientTransportSink : IClientChannelSink {
- /// <summary>
- /// Logging support for this class.
- /// </summary>
- protected static readonly ILog log = LogManager.GetLogger(typeof(TcpClientTransportSink));
-
- /// <summary>
- /// The host to connect to.
- /// </summary>
- private Host host;
-
- /// <summary>
- /// The port to connect on.
- /// </summary>
- private int port;
-
- /// <summary>
- /// The callback to use to validate the remote certificate.
- /// </summary>
- RemoteCertificateValidationCallback certValidationCallback;
-
- GetAuthDetailsDelegate getAuthDetailsCallback;
-
- ChannelAuthComplete authCompleteCallback;
-
- private bool useTls;
-
- /// <summary>
- /// Creates a new sink with the given url.
- /// </summary>
- /// <param name="url">The URL to connect to.</param>
- /// <param name="remoteChannelData">Channel data optionally containing the URL.</param>
- /// <param name="certValidationCallback">The callback to use to validate the remote certificate.</param>
- public TcpClientTransportSink(string url, object remoteChannelData, GetAuthDetailsDelegate getAuthDetailsCallback, RemoteCertificateValidationCallback certValidationCallback, ChannelAuthComplete authCompleteCallback, bool useTls) {
- this.getAuthDetailsCallback = getAuthDetailsCallback;
- this.certValidationCallback = certValidationCallback;
- this.authCompleteCallback = authCompleteCallback;
- this.useTls = useTls;
-
- if (TcpChannel.ValidUrl(url)) {
- string objectURI;
- TcpChannel.ParseUrl(url, out this.host, out this.port, out objectURI);
-
- } else if (remoteChannelData != null && remoteChannelData is ChannelDataStore) {
- ChannelDataStore channelDataStore = (ChannelDataStore) remoteChannelData;
- string objectURI;
- TcpChannel.ParseUrl(channelDataStore.ChannelUris[0], out this.host, out this.port, out objectURI);
-
- } else {
- throw new ArgumentException("No valid URLs found");
- }
-
- // Create a thread to handle the TCP comms
- ThreadHelper th = new ThreadHelper(new WaitCallback(processConnection), null);
- Thread processThread = new Thread(new ThreadStart(th.CallDelegate));
- processThread.Start();
- }
-
- #region IClientChannelSink Members
- /// <summary>
- /// Requests asynchronous processing of a method call on the current sink.
- /// </summary>
- /// <param name="sinkStack">A stack of channel sinks that called this sink.</param>
- /// <param name="msg">The message to process.</param>
- /// <param name="requestHeaders">The headers to add to the outgoing message heading to the server.</param>
- /// <param name="requestStream">The stream headed to the transport sink.</param>
- public void AsyncProcessRequest(IClientChannelSinkStack sinkStack, IMessage msg, ITransportHeaders requestHeaders, Stream requestStream) {
- ensureConnected();
-
- string messageId = new Guid().ToString();
-
- requestHeaders[CommonTransportKeys.RequestUri] = msg.Properties["__Uri"];
- requestHeaders["__Id"] = messageId;
-
- // Add our sink stack
- this.pendingAsyncRequests.Add(messageId, sinkStack);
-
- // Send over the request stream
- TcpMessage.SendMessage(this.connection, requestStream, requestHeaders);
- }
-
- /// <summary>
- /// Requests asynchronous processing of a response to a method call on the current sink.
- /// </summary>
- /// <param name="sinkStack">A stack of sinks that called this sink.</param>
- /// <param name="state">Information generated on the request side that is associated with this sink.</param>
- /// <param name="headers">The headers retrieved from the server response stream.</param>
- /// <param name="stream">The stream coming back from the transport sink.</param>
- public void AsyncProcessResponse(IClientResponseChannelSinkStack sinkStack, object state, ITransportHeaders headers, Stream stream) {
- // Not needed in a transport sink.
- throw new NotSupportedException();
- }
-
- /// <summary>
- /// Returns the Stream onto which the provided message is to be serialized.
- /// </summary>
- /// <param name="msg">The IMethodCallMessage containing details about the method call.</param>
- /// <param name="headers">The headers to add to the outgoing message heading to the server.</param>
- /// <returns>The Stream onto which the provided message is to be serialized.</returns>
- public Stream GetRequestStream(IMessage msg, ITransportHeaders headers) {
- // Can't directly access the stream.
- return null;
- }
-
- /// <summary>
- /// Gets the next client channel sink in the client sink chain.
- /// </summary>
- public IClientChannelSink NextChannelSink {
- get {
- // No more sinks
- return null;
- }
- }
-
- /// <summary>
- /// Requests message processing from the current sink.
- /// </summary>
- /// <param name="msg">The message to process.</param>
- /// <param name="requestHeaders">The headers to add to the outgoing message heading to the server.</param>
- /// <param name="requestStream">The stream headed to the transport sink.</param>
- /// <param name="responseHeaders">When this method returns, contains a ITransportHeaders interface that holds the headers that the server returned. This parameter is passed uninitialized.</param>
- /// <param name="responseStream">When this method returns, contains a Stream coming back from the transport sink. This parameter is passed uninitialized.</param>
- public void ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, out ITransportHeaders responseHeaders, out Stream responseStream) {
- ensureConnected();
-
- string messageId = new Guid().ToString();
-
- requestHeaders[CommonTransportKeys.RequestUri] = msg.Properties["__Uri"];
- requestHeaders["__Id"] = messageId;
-
- // Register an event to wait on
- ManualResetEvent responseArrived = new ManualResetEvent(false);
- this.pendingRequests.Add(messageId, responseArrived);
-
- // Send over the request stream
- TcpMessage.SendMessage(this.connection, requestStream, requestHeaders);
-
- // Wait for the response
- responseArrived.WaitOne();
-
- // Get the repsonse
- TcpMessage response = this.receivedResponses[messageId];
- this.receivedResponses.Remove(messageId);
-
- responseHeaders = response.Headers;
- responseStream = new MemoryStream(response.Data);
- }
- #endregion
-
- #region IChannelSinkBase Members
-
- public IDictionary Properties {
- get {
- return null;
- }
- }
- #endregion
-
- IAuthenticationToken authToken;
-
- public IAuthenticationToken AuthToken {
- get {
- return this.authToken;
- }
- }
-
- public bool Connected {
- get {
- return this.connection.Connected;
- }
- }
-
- /// <summary>
- /// The connection used to communicate with the server.
- /// </summary>
- protected TcpTextConnection connection = new TcpTextConnection(log);
-
- /// <summary>
- /// Ensures that this sink has a connection to the remote server and TLS
- /// encryption is in place.
- /// </summary>
- private void ensureConnected() {
- lock (this) {
- // Open a connection to the remote server if needed
- if (!connection.Connected) {
- connection.Open(this.host, this.port);
-
- string response = connection.ReadLine();
- if (response.Trim().ToLower() == "nmail remoting channel") {
- this.connection.WriteLine("OK");
-
- if (this.useTls)
- {
- // Go encrypted...
- if (this.certValidationCallback == null)
- {
- this.connection.StartTlsAsClient(this.host.ToString());
- }
- else
- {
- this.connection.StartTlsAsClient(this.host.ToString(), this.certValidationCallback);
- }
-
- if (!this.connection.Encrypted)
- {
- throw new InvalidOperationException("Failed to establish a secure connection to the server.");
- }
- }
-
- while (this.connection.Connected && this.authToken == null) {
- // Get the auth details
- TcpUserPasswordPair authDetails = this.getAuthDetailsCallback(this);
-
- // Send them to the server
- this.connection.Write(authDetails);
- this.authToken = (IAuthenticationToken) this.connection.Read();
- }
-
- if (this.authToken == null) {
- throw new InvalidOperationException("Failed to authenticated to the server.");
- }
-
- // Notify the caller that the auth token has arrived
- this.authCompleteCallback(authToken);
- }
- }
- }
- }
-
- /// <summary>
- /// A map of message Ids to sink stacks for pending async requests.
- /// </summary>
- private Dictionary<string, IClientChannelSinkStack> pendingAsyncRequests = new Dictionary<string, IClientChannelSinkStack>();
-
- /// <summary>
- /// A map of message Ids to events for pending sync requests.
- /// </summary>
- private Dictionary<string, ManualResetEvent> pendingRequests = new Dictionary<string,ManualResetEvent>();
-
- /// <summary>
- /// A map of message Ids to received responses for sync requests.
- /// </summary>
- private Dictionary<string, TcpMessage> receivedResponses = new Dictionary<string, TcpMessage>();
-
- /// <summary>
- /// Reads responses from the TCP connection.
- /// </summary>
- /// <param name="unused">Unused.</param>
- private void processConnection(object unused) {
- ensureConnected();
-
- while (this.connection.Connected) {
- // Read the next message
- TcpMessage response = (TcpMessage) this.connection.Read();
-
- string messageId = (string) response.Headers["__Id"];
-
- // Check if this is an async response
- if (this.pendingAsyncRequests.ContainsKey(messageId)) {
- // Pass the message to the appropriate sink stack
- IClientChannelSinkStack sinkStack = this.pendingAsyncRequests[messageId];
- this.pendingAsyncRequests.Remove(messageId);
- MemoryStream responseStream = new MemoryStream(response.Data);
- sinkStack.AsyncProcessResponse(response.Headers, responseStream);
-
- } else if (this.pendingRequests.ContainsKey(messageId)) {
- // Add the repsonse
- this.receivedResponses.Add(messageId, response);
-
- // Notify the waiting thread
- ManualResetEvent responseArrived = this.pendingRequests[messageId];
- this.pendingRequests.Remove(messageId);
- responseArrived.Set();
-
- } else {
- throw new InvalidOperationException("No request matches the given message Id.");
- }
- }
- }
- }
-}
Deleted: NMail/branches/luke-dev/NMail/IO/TcpClientTransportSinkProvider.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpClientTransportSinkProvider.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpClientTransportSinkProvider.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,119 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Text;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-
-namespace NMail.IO {
- /// <summary>
- /// A client transport sink provider for the NMail TCP channel.
- /// </summary>
- public class TcpClientTransportSinkProvider : IClientChannelSinkProvider {
-
- /// <summary>
- /// The callback to use to validate the remote server's certificate.
- /// </summary>
- private RemoteCertificateValidationCallback certValidationCallback;
-
- private GetAuthDetailsDelegate getAuthDetailsCallback;
-
- private ChannelAuthComplete authCompleteCallback;
-
- private bool useTls;
-
- /// <summary>
- /// Creates a new provider with the given certificate validation callback.
- /// </summary>
- /// <param name="certValidationCallback">The callback to use to validation teh remote server's certificate null for the default.</param>
- public TcpClientTransportSinkProvider(GetAuthDetailsDelegate getAuthDetailsCallback, RemoteCertificateValidationCallback certValidationCallback, ChannelAuthComplete authCompleteCallback, bool useTls) {
- this.getAuthDetailsCallback = getAuthDetailsCallback;
- this.certValidationCallback = certValidationCallback;
- this.authCompleteCallback = authCompleteCallback;
- this.useTls = useTls;
- }
-
- #region IClientChannelSinkProvider Members
- /// <summary>
- /// Creates a sink chain.
- /// </summary>
- /// <param name="channel">
- /// Channel for which the current sink chain is being constructed.
- /// </param>
- /// <param name="url">
- /// The URL of the object to connect to. This parameter can be null if the
- /// connection is based entirely on the information contained in the
- /// remoteChannelData parameter.
- /// </param>
- /// <param name="remoteChannelData">
- /// A channel data object that describes a channel on the remote server.
- /// </param>
- /// <returns>
- /// The first sink of the newly formed channel sink chain, or null, which
- /// indicates that this provider will not or cannot provide a connection for
- /// this endpoint.
- /// </returns>
- public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData) {
- Host host;
- int port;
- string objectUri;
-
- TcpChannel.ParseUrl(url, out host, out port, out objectUri);
-
- string key = host.ToString() + ":" + port;
-
- lock (this) {
- if (sinkMap.ContainsKey(key) && !sinkMap[key].Connected) {
- // Transport has lost its connection
- this.sinkMap.Remove(key);
- }
-
- // Create a transport if needed
- if (!sinkMap.ContainsKey(key)) {
- this.sinkMap.Add(key, new TcpClientTransportSink(url, remoteChannelData, this.getAuthDetailsCallback, this.certValidationCallback, this.authCompleteCallback, this.useTls));
- }
-
- return this.sinkMap[key];
- }
- }
-
- private Dictionary<string, TcpClientTransportSink> sinkMap = new Dictionary<string, TcpClientTransportSink>();
-
- /// <summary>
- /// Gets or sets the next sink provider in the channel sink provider chain.
- /// </summary>
- public IClientChannelSinkProvider Next {
- get {
- return null;
- }
- set {
- // Ignore: this provider has to be the last in the chain.
- }
- }
- #endregion
- }
-}
Deleted: NMail/branches/luke-dev/NMail/IO/TcpServerChannel.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpServerChannel.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpServerChannel.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,259 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using System.Threading;
-
-using log4net;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-using NMail.Helper;
-
-namespace NMail.IO {
- /// <summary>
- /// A TCP server channel.
- /// </summary>
- public class TcpServerChannel : IChannelReceiver, IChannel {
- /// <summary>
- /// Logging support for this class.
- /// </summary>
- protected static readonly ILog log = LogManager.GetLogger(typeof(TcpServerChannel));
-
- /// <summary>
- /// The port to listen on.
- /// </summary>
- private int port;
-
- /// <summary>
- /// The bind IP address to report to report clients.
- /// </summary>
- private string bindAddress;
-
- /// <summary>
- /// The certificate to use for SSL.
- /// </summary>
- private X509Certificate2 certificate;
-
- /// <summary>
- /// The authentication provider to use.
- /// </summary>
- private IAuthenticationProvider authProvider;
-
- /// <summary>
- /// The sink to pass any incoming messages to.
- /// </summary>
- private IServerChannelSink nextSink;
-
- private bool useTls;
-
- /// <summary>
- /// Creates a new server channel with the given details.
- /// </summary>
- /// <param name="port">The port to listen on.</param>
- /// <param name="certificate">The certificate to use for SSL.</param>
- /// <param name="serverSinkProvider">The provider.</param>
- public TcpServerChannel(int port, X509Certificate2 certificate, IAuthenticationProvider authProvider, IServerChannelSinkProvider serverSinkProvider, bool useTls) {
- this.port = port;
- this.certificate = certificate;
- this.authProvider = authProvider;
- this.useTls = useTls;
-
- // This is needed to report a valid IP to clients asking for channel data
- IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
- if (hostEntry.AddressList.Length == 0) {
- throw new Exception("IP address could not be determined for this host.");
- }
- this.bindAddress = hostEntry.AddressList[0].ToString();
-
- string[] urls = new string[1];
- urls[0] = GetUrlForChannel();
- this.channelData = new ChannelDataStore(urls);
-
- // Collect channel data for all providers
- IServerChannelSinkProvider provider = serverSinkProvider;
- while (provider != null) {
- provider.GetChannelData(this.channelData);
- provider = provider.Next;
- }
-
- // Create the sink chain
- this.nextSink = ChannelServices.CreateServerChannelSinkChain(serverSinkProvider, this);
-
- StartListening(null);
- }
-
- #region IChannelReceiver Members
-
- private ChannelDataStore channelData;
-
- /// <summary>
- /// Gets the channel-specific data.
- /// </summary>
- public object ChannelData {
- get {
- return this.channelData;
- }
- }
-
- /// <summary>
- /// Returns an array of all the URLs for a URI.
- /// </summary>
- /// <param name="objectURI">The URI for which URLs are required.</param>
- /// <returns>The array of URLs.</returns>
- public string[] GetUrlsForUri(string objectURI) {
- string[] urls = new string[1];
-
- if (!objectURI.StartsWith("/")) {
- objectURI = '/' + objectURI;
- }
-
- urls[0] = GetUrlForChannel() + objectURI;
- return urls;
- }
-
- public string GetUrlForChannel() {
- return TcpChannel.UrlPrefix + this.bindAddress + ":" + this.port;
- }
-
- /// <summary>
- /// Instructs the current channel to start listening for requests.
- /// </summary>
- /// <param name="data">Optional initialization information.</param>
- public void StartListening(object data) {
- this.shutdown = false;
-
- IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, this.port);
-
- ThreadHelper th = new ThreadHelper(new WaitCallback(handleConnections), endpoint);
- Thread listenThread = new Thread(new ThreadStart(th.CallDelegate));
- listenThread.Start();
- }
-
- /// <summary>
- /// Instructs the current channel to stop listening for requests.
- /// </summary>
- /// <param name="data">Optional state information for the channel.</param>
- public void StopListening(object data) {
- this.shutdown = true;
-
- lock (this) {
- // Stop listening on all the bound sockets
- foreach (TcpListener listener in this.listenSockets) {
- listener.Stop();
- }
- this.listenSockets = new List<TcpListener>();
- }
- }
- #endregion
-
- #region IChannel Members
- /// <summary>
- /// The name of this channel.
- /// </summary>
- public string ChannelName {
- get {
- return TcpChannel.Name;
- }
- }
-
- /// <summary>
- /// The priority of this channel.
- /// </summary>
- public int ChannelPriority {
- get {
- return TcpChannel.Priority;
- }
- }
-
- /// <summary>
- /// Returns the object URI as an out parameter, and the URI of the current
- /// channel as the return value.
- /// </summary>
- /// <param name="url">The URL of the object.</param>
- /// <param name="objectURI">
- /// When this method returns, contains the object URI. This parameter is
- /// passed uninitialized.
- /// </param>
- /// <returns>
- /// The URI of the current channel, or null if the URI does not belong to
- /// this channel.
- /// </returns>
- public string Parse(string url, out string objectURI) {
- log.Debug("Parse");
-
- return TcpChannel.ParseUrl(url, out objectURI);
- }
- #endregion
-
- /// <summary>
- /// A flag indicating if the listening sockets should shutdown.
- /// </summary>
- private bool shutdown = true;
-
- /// <summary>
- /// A list of listening sockets.
- /// </summary>
- private List<TcpListener> listenSockets = new List<TcpListener>();
-
- /// <summary>
- /// Handles incomming connections for an interface (IP address).
- /// </summary>
- /// <param name="o">The interface to listen for connections on.</param>
- protected void handleConnections(object o) {
- Thread.CurrentThread.Name = "HandleRemoting:" + o.ToString();
- TcpListener socket = null;
-
- try {
- IPEndPoint ep = (IPEndPoint) o;
- if (log.IsDebugEnabled) {
- log.Debug("Binding to IP endpoint: [" + ep + "]");
- }
- socket = new TcpListener(ep);
- socket.Start();
- lock (this) {
- // Register this socket
- this.listenSockets.Add(socket);
- }
-
- while (true) {
- Socket client = socket.AcceptSocket();
- new TcpServerTransportSink(this.nextSink, this.certificate, this.authProvider, client, this.useTls);
- }
- } catch (SocketException e) {
- // Ignore interrupted exception during shutdown
- if (!this.shutdown) {
- log.Warn(e.Message, e);
- }
-
- lock (this) {
- // De-register this socket
- this.listenSockets.Remove(socket);
- }
- }
- }
- }
-}
Deleted: NMail/branches/luke-dev/NMail/IO/TcpServerTransportSink.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpServerTransportSink.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/IO/TcpServerTransportSink.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -1,263 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane and Daniel Frampton
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Messaging;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using System.Threading;
-
-using log4net;
-
-using NMail.Authentication;
-using NMail.DataTypes;
-using NMail.Helper;
-
-namespace NMail.IO {
- /// <summary>
- /// A TCP server transport sink.
- /// </summary>
- public class TcpServerTransportSink : IServerChannelSink {
- /// <summary>
- /// Logging support for this class.
- /// </summary>
- protected static readonly ILog log = LogManager.GetLogger(typeof(TcpServerTransportSink));
-
- /// <summary>
- /// The connection used to communicate to the client.
- /// </summary>
- protected TcpTextConnection connection = new TcpTextConnection(log);
-
- /// <summary>
- /// The next sink in the chain.
- /// </summary>
- protected IServerChannelSink nextSink;
-
- protected IAuthenticationProvider authProvider;
-
- private bool useTls;
-
- /// <summary>
- /// Creates a new transport sink with the given details.
- /// </summary>
- /// <param name="nextSink">The next sink in the chain.</param>
- /// <param name="certificate">The certificate to use in SSL.</param>
- /// <param name="client">The socket to the remote client.</param>
- public TcpServerTransportSink(IServerChannelSink nextSink, X509Certificate2 certificate, IAuthenticationProvider authProvider, Socket client, bool useTls) {
- this.nextSink = nextSink;
- this.connection.Create(client);
- this.connection.Certificate = certificate;
- this.authProvider = authProvider;
- this.useTls = useTls;
-
- // Create a new thread to read requests with
- ThreadHelper th = new ThreadHelper(new WaitCallback(processConnection), null);
- Thread processThread = new Thread(new ThreadStart(th.CallDelegate));
- processThread.Start();
- }
-
- /// <summary>
- /// Handles the connection from the client, reading requests passing them
- /// up the chain.
- /// </summary>
- /// <param name="unused">An unused argument.</param>
- private void processConnection(object unused) {
- Thread.CurrentThread.Name = "NMail TCP server remoting thread.";
-
- try {
- // Present the welcome message and await a valid response
- this.connection.WriteLine("NMail Remoting Channel");
- string response = this.connection.ReadLine();
-
- // Check that we have a valid client
- if (response.Trim().ToLower() != "ok") {
- this.connection.Close();
- }
-
- if (this.useTls)
- {
- // Go encrypted...
- this.connection.StartTlsAsServer();
- }
-
- int authAttempts = 0;
- bool authenticated = false;
-
- // Try to authenticate the user
- while (this.connection.Connected && !authenticated && authAttempts < 3) {
- TcpUserPasswordPair authDetails = (TcpUserPasswordPair) this.connection.Read();
-
- // Attempt to authenticate the user
- IAuthenticationToken authToken = this.authProvider.Authenticate(authDetails.Username, authDetails.Password);
-
- authAttempts++;
- authenticated = (authToken != null);
- this.connection.Write(authToken);
- }
-
- if (authAttempts >= 3) {
- // Auth failed
- this.connection.Close();
- return;
- }
-
- while (this.connection.Connected) {
- // Get the next request from the client
- TcpMessage request = (TcpMessage) this.connection.Read();
- MemoryStream requestStream = new MemoryStream(request.Data);
-
- // Get the message Id
- string messageId = (string) request.Headers["__Id"];
-
- // Strip off all of the Url except the object Uri
- string uri = (string) request.Headers[CommonTransportKeys.RequestUri];
- TcpChannel.ParseUrl(uri, out uri);
- if (uri != null) {
- request.Headers[CommonTransportKeys.RequestUri] = uri;
- }
-
- ServerChannelSinkStack sinkStack = new ServerChannelSinkStack();
- sinkStack.Push(this, messageId);
-
- IMessage responseMessage;
- ITransportHeaders responseHeaders;
- Stream responseStream;
-
- // Send the request down the chain
- ServerProcessing processing = this.nextSink.ProcessMessage(sinkStack,
- null,
- request.Headers,
- requestStream,
- out responseMessage,
- out responseHeaders,
- out responseStream);
-
- // Check if a response is needed
- if (processing == ServerProcessing.Complete) {
- responseHeaders["__Id"] = messageId;
-
- TcpMessage.SendMessage(this.connection, responseStream, responseHeaders);
- this.connection.Flush();
- }
- }
- } catch (SocketException) {
- // Ignore
-
- } catch (IOException) {
- // Ignore
-
- } catch (Exception ex) {
- log.Debug("Unhandled exception.", ex);
- }
- }
-
- #region IServerChannelSink Members
- /// <summary>
- /// Requests processing from the current sink of the response from a method
- /// call sent asynchronously.
- /// </summary>
- /// <param name="sinkStack">
- /// A stack of sinks leading back to the server transport sink.
- /// </param>
- /// <param name="state">
- /// Information generated on the request side that is associated with this sink.
- /// </param>
- /// <param name="msg">The response message.</param>
- /// <param name="responseHeaders">
- /// The headers to add to the return message heading to the client.
- /// </param>
- /// <param name="responseStream">The stream heading back to the transport sink.</param>
- public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders responseHeaders, Stream responseStream) {
- string messageId = (string) state;
-
- responseHeaders["__Id"] = messageId;
-
- TcpMessage.SendMessage(this.connection, responseStream, responseHeaders);
- this.connection.Flush();
- }
-
- /// <summary>
- /// Returns the Stream onto which the provided response message is to be serialized.
- /// </summary>
- /// <param name="sinkStack">A stack of sinks leading back to the server transport sink.</param>
- /// <param name="state">The state that has been pushed to the stack by this sink.</param>
- /// <param name="msg">The response message to serialize.</param>
- /// <param name="headers">The headers to put in the response stream to the client.</param>
- /// <returns>The Stream onto which the provided response message is to be serialized.</returns>
- public Stream GetResponseStream(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers) {
- // Not possible to directly access the stream
- return null;
- }
-
- /// <summary>
- /// Gets the next server channel sink in the server sink chain.
- /// </summary>
- public IServerChannelSink NextChannelSink {
- get {
- return this.nextSink;
- }
- }
-
- /// <summary>
- /// Requests message processing from the current sink.
- /// </summary>
- /// <param name="sinkStack">
- /// A stack of channel sinks that called the current sink.
- /// </param>
- /// <param name="requestMsg">The message that contains the request.</param>
- /// <param name="requestHeaders">
- /// Headers retrieved from the incoming message from the client.
- /// </param>
- /// <param name="requestStream">
- /// The stream that needs to be to processed and passed on to the deserialization sink.
- /// </param>
- /// <param name="responseMsg">
- /// When this method returns, contains a IMessage that holds the response message. This parameter is passed uninitialized.
- /// </param>
- /// <param name="responseHeaders">
- /// When this method returns, contains a ITransportHeaders that holds the headers that are to be added to return message heading to the client. This parameter is passed uninitialized.
- /// </param>
- /// <param name="responseStream">
- /// When this method returns, contains a Stream that is heading back to the transport sink. This parameter is passed uninitialized.
- /// </param>
- /// <returns>
- /// A ServerProcessing status value that provides information about how message was processed.
- /// </returns>
- public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream) {
- // This will never be called for a server side sink
- throw new NotSupportedException();
- }
- #endregion
-
- #region IChannelSinkBase Members
- /// <summary>
- /// Gets a dictionary through which properties on the sink can be accessed.
- /// </summary>
- public IDictionary Properties {
- get {
- // Not needed
- return null;
- }
- }
- #endregion
- }
-}
Modified: NMail/branches/luke-dev/NMail/NMail.csproj
===================================================================
--- NMail/branches/luke-dev/NMail/NMail.csproj 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail/NMail.csproj 2006-11-11 09:37:34 UTC (rev 81)
@@ -246,15 +246,10 @@
<Compile Include="Helper\XmlHelper.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="IO\TcpChannel.cs" />
- <Compile Include="IO\TcpClientChannel.cs" />
- <Compile Include="IO\TcpClientTransportSink.cs" />
- <Compile Include="IO\TcpClientTransportSinkProvider.cs" />
- <Compile Include="IO\TcpServerChannel.cs" />
- <Compile Include="IO\TcpServerTransportSink.cs" />
<Compile Include="IO\TcpTextConnection.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="IO\TcpUserPasswordPair.cs" />
<Compile Include="Threading\NMailThreadPool.cs">
<SubType>Code</SubType>
</Compile>
Modified: NMail/branches/luke-dev/NMail.Administration.Console/Context/TopLevelContext.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Administration.Console/Context/TopLevelContext.cs 2006-11-08 12:58:41 UTC (rev 80)
+++ NMail/branches/luke-dev/NMail.Administration.Console/Context/TopLevelContext.cs 2006-11-11 09:37:34 UTC (rev 81)
@@ -51,10 +51,10 @@
useTls = false;
#endif
- TcpClientChannel channel = new TcpClientChannel(null, new GetAuthDetailsDelegate(GetAuthDetails), new RemoteCertificateValidationCallback(remoteCertificateValidation), new ChannelAuthComplete(AuthCompleteCallback), useTls);
- ChannelServices.RegisterChannel(channel, false);
+ //TcpClientChannel channel = new TcpClientChannel(null, new GetAuthDetailsDelegate(GetAuthDetails), new RemoteCertificateValidationCallback(remoteCertificateValidation), new ChannelAuthComplete(AuthCompleteCallback), useTls);
+ //ChannelServices.RegisterChannel(channel, false);
- string url = "nmtcp://127.0.0.1:7877/RemoteAdministration.rem";
+ string url = "tcp://127.0.0.1:7877/RemoteAdministration.rem";
this.remoteAdmin = (RemoteAdministration)RemotingServices.Connect(Type.GetType("NMail.Server.RemoteAdministration, NMail.Server"), url);
// Wait until the channel gives us an authentication token
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-08 12:58:55
|
Revision: 80
http://svn.sourceforge.net/nmailserver/?rev=80&view=rev
Author: tmyroadctfig
Date: 2006-11-08 04:58:41 -0800 (Wed, 08 Nov 2006)
Log Message:
-----------
Added some missing files to the installer.
Modified Paths:
--------------
NMail/branches/luke-dev/Installer/NMail-Installer.wxs
Modified: NMail/branches/luke-dev/Installer/NMail-Installer.wxs
===================================================================
--- NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-08 12:56:32 UTC (rev 79)
+++ NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-08 12:58:41 UTC (rev 80)
@@ -138,6 +138,12 @@
<Component Id="component39" DiskId="1" Guid="567BD98A-B437-4d06-A236-4710D647D0BE">
<File Id="file39" Name="tasklist.asc" LongName="TaskList.ascx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\TaskList.ascx" />
</Component>
+ <Component Id="component40" DiskId="1" Guid="157B362A-5104-42b1-B073-2A9259933AE8">
+ <File Id="file90" Name="setpass.asc" LongName="SetPasswordPanel.ascx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\SetPasswordPanel.ascx" />
+ </Component>
+ <Component Id="component41" DiskId="1" Guid="7943BF3C-869B-4465-A517-F6CFDB63545F">
+ <File Id="file91" Name="spool.asp" LongName="SpoolDetails.aspx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\SpoolDetails.aspx" />
+ </Component>
<Directory Id="directory1" Name="bin">
<Component Id="component16" DiskId="1" Guid="F1DDFAF8-BB62-45d2-BEAA-CCF24A85B6AE">
<File Id="file40" Name="APP_CO_1.COM" LongName="App_Code.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Code.compiled" />
@@ -157,6 +163,9 @@
<File Id="file54" Name="NMail.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.dll" />
<File Id="file55" Name="NMAILS_1.DLL" LongName="NMail.Server.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.Server.dll" />
<File Id="file56" Name="APP_WE_4.DLL" LongName="App_Web_tasklist.ascx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_tasklist.ascx.cdcab7d2.dll" />
+ <File Id="file57" Name="APP_WE_5.DLL" LongName="App_Web_setpasswordpanel.ascx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_setpasswordpanel.ascx.cdcab7d2.dll" />
+ <File Id="file58" Name="APP_WE_6.DLL" LongName="App_Web_spooldetails.aspx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_spooldetails.aspx.cdcab7d2.dll" />
+ <File Id="file59" Name="NMAILL_1.DLL" LongName="NMail.LocalStoreData.MySql.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.LocalStoreData.MySql.dll" />
</Component>
</Directory>
<Directory Id="directory2" Name="Images">
@@ -478,6 +487,8 @@
<ComponentRef Id="component37"/>
<ComponentRef Id="component38"/>
<ComponentRef Id="component39"/>
+ <ComponentRef Id="component40"/>
+ <ComponentRef Id="component41"/>
</Feature>
<Feature Id="F_DeveloperDoc" Display="expand" Title="Developer Documentation" Level="3"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-08 12:56:44
|
Revision: 79
http://svn.sourceforge.net/nmailserver/?rev=79&view=rev
Author: tmyroadctfig
Date: 2006-11-08 04:56:32 -0800 (Wed, 08 Nov 2006)
Log Message:
-----------
Fixed a small defect in local store data.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-11-08 12:52:40 UTC (rev 78)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-11-08 12:56:32 UTC (rev 79)
@@ -202,8 +202,8 @@
cmd.CommandText = "GetFolder";
cmd.Parameters.Add("?FolderId", folderId);
cmd.Parameters.Add("?ParentId", MySqlDbType.Int32);
- cmd.Parameters.Add("?Name", MySqlDbType.VarString);
- cmd.Parameters.Add("?NameSpace", MySqlDbType.VarString);
+ cmd.Parameters.Add("?Name", MySqlDbType.VarChar);
+ cmd.Parameters.Add("?NameSpace", MySqlDbType.VarChar);
cmd.Parameters.Add("?Children", MySqlDbType.Int32);
cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["ParentId"].Direction = ParameterDirection.Output;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-08 12:53:00
|
Revision: 78
http://svn.sourceforge.net/nmailserver/?rev=78&view=rev
Author: tmyroadctfig
Date: 2006-11-08 04:52:40 -0800 (Wed, 08 Nov 2006)
Log Message:
-----------
Fixed a major defect in BasicAuthToken.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs
Modified: NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs 2006-11-07 12:27:42 UTC (rev 77)
+++ NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs 2006-11-08 12:52:40 UTC (rev 78)
@@ -33,7 +33,7 @@
this.username = username;
this.credentialsExpiry = credentialsExpiry;
this.tokenExpiry = tokenExpiry;
- this.tokenId = new Guid();
+ this.tokenId = Guid.NewGuid();
}
private Guid tokenId;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-07 12:28:48
|
Revision: 77
http://svn.sourceforge.net/nmailserver/?rev=77&view=rev
Author: tmyroadctfig
Date: 2006-11-07 04:27:42 -0800 (Tue, 07 Nov 2006)
Log Message:
-----------
Changes to smooth installation process and ability to run Win32 service in the right location.
Modified Paths:
--------------
NMail/branches/luke-dev/Installer/NMail-Installer.wxs
NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs
NMail/branches/luke-dev/NMail.Server/NMailServer.cs
NMail/branches/luke-dev/NMail.Server.Service/NMailService.cs
Modified: NMail/branches/luke-dev/Installer/NMail-Installer.wxs
===================================================================
--- NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-07 12:25:09 UTC (rev 76)
+++ NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-11-07 12:27:42 UTC (rev 77)
@@ -135,6 +135,9 @@
<Component Id="component15" DiskId="1" Guid="3E8F5756-8B2B-44dc-BCAB-CDBA16EF695E">
<File Id="file15" Name="WEB_1.SIT" LongName="Web.sitemap" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\Web.sitemap" />
</Component>
+ <Component Id="component39" DiskId="1" Guid="567BD98A-B437-4d06-A236-4710D647D0BE">
+ <File Id="file39" Name="tasklist.asc" LongName="TaskList.ascx" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\TaskList.ascx" />
+ </Component>
<Directory Id="directory1" Name="bin">
<Component Id="component16" DiskId="1" Guid="F1DDFAF8-BB62-45d2-BEAA-CCF24A85B6AE">
<File Id="file40" Name="APP_CO_1.COM" LongName="App_Code.compiled" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Code.compiled" />
@@ -153,6 +156,7 @@
<File Id="file53" Name="log4net.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\log4net.dll" />
<File Id="file54" Name="NMail.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.dll" />
<File Id="file55" Name="NMAILS_1.DLL" LongName="NMail.Server.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\NMail.Server.dll" />
+ <File Id="file56" Name="APP_WE_4.DLL" LongName="App_Web_tasklist.ascx.cdcab7d2.dll" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\bin\App_Web_tasklist.ascx.cdcab7d2.dll" />
</Component>
</Directory>
<Directory Id="directory2" Name="Images">
@@ -198,6 +202,17 @@
</Component>
</Directory>
</Directory>
+
+ <Directory Id="D_App_Themes" Name="AppTheme" LongName="App_Themes">
+ <Directory Id="D_Default" Name="Default">
+ <Component Id="component37" DiskId="1" Guid="FD0DED72-FFA7-4f3d-8640-1592535663B9">
+ <File Id="file37" Name="def.skn" LongName="Default.skin" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\App_Themes\Default\Default.skin" />
+ </Component>
+ <Component Id="component38" DiskId="1" Guid="153879DA-AAF8-4a49-8DDD-4D3EFAC7C71C">
+ <File Id="file38" Name="s.css" LongName="StyleSheet.css" Checksum="yes" Compressed="yes" Vital="yes" src="obj\NMail.Administration.Web.Compiled\App_Themes\Default\StyleSheet.css" />
+ </Component>
+ </Directory>
+ </Directory>
</Directory>
<!-- <Component Id="C_VirtualWebDir" Guid="45A1A00F-7CAB-462f-A361-18566149FEBF">
@@ -226,6 +241,8 @@
<Component Id="C_NMail.dll" Guid="0A709B39-711B-46a0-911A-05D12E66BBDD">
<File Id="NMail.dll" Name="NMail.dll" LongName="NMail.dll" DiskId="1" Source="obj\NMail.dll" Vital="yes" />
+ <Registry Id='R_NMail' Root='HKLM' Key='Software\NMail\NMail Server 1.0' Name='InstallDirectory' Action='write' Type='string' Value='[INSTALLDIR]' />
+ <RemoveFile Id='NMail.log' On='uninstall' Name='NMail.log' LongName='NMail.log' />
</Component>
<Component Id="C_NMail.DnsClient.dll" Guid="527A7514-6746-4ead-9E0C-60986478FB6A">
@@ -359,11 +376,10 @@
<Binary Id="B_NMail.PostInstall.exe" SourceFile="obj\NMail.PostInstall.exe" />
<CustomAction Id="CA_PostInstall" BinaryKey="B_NMail.PostInstall.exe" ExeCommand="" />
- <CustomAction Id="CA_SetupWizard" FileKey="NMail.SetupWizard.exe" ExeCommand="" Return="asyncNoWait"/>
+ <CustomAction Id="CA_FinalUninstall" BinaryKey="B_NMail.PostInstall.exe" ExeCommand="/u" />
<InstallExecuteSequence>
- <Custom Action="CA_PostInstall" After="InstallFinalize" />
- <Custom Action="CA_SetupWizard" After="CA_PostInstall" />
+ <Custom Action="CA_PostInstall" After="InstallFinalize">$C_NMail.dll>2</Custom>
</InstallExecuteSequence>
@@ -459,6 +475,9 @@
<ComponentRef Id="component34"/>
<ComponentRef Id="component35"/>
<ComponentRef Id="component36"/>
+ <ComponentRef Id="component37"/>
+ <ComponentRef Id="component38"/>
+ <ComponentRef Id="component39"/>
</Feature>
<Feature Id="F_DeveloperDoc" Display="expand" Title="Developer Documentation" Level="3"
Modified: NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-11-07 12:25:09 UTC (rev 76)
+++ NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-11-07 12:27:42 UTC (rev 77)
@@ -38,6 +38,15 @@
}
/// <summary>
+ /// Remove the config section from the config file.
+ /// </summary>
+ public static void RemoveFromConfigFile() {
+ if (NMailConfigFile.Current.Sections["NMail.MessageRouter"] != null) {
+ NMailConfigFile.Current.Sections.Remove("NMail.MessageRouter");
+ }
+ }
+
+ /// <summary>
/// Returns true if a message router configuration section exists in the current
/// configuration.
/// </summary>
Modified: NMail/branches/luke-dev/NMail.Server/NMailServer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Server/NMailServer.cs 2006-11-07 12:25:09 UTC (rev 76)
+++ NMail/branches/luke-dev/NMail.Server/NMailServer.cs 2006-11-07 12:27:42 UTC (rev 77)
@@ -19,6 +19,7 @@
using System.Collections;
using System.Threading;
+using Microsoft.Win32;
using log4net;
using NMail.Authentication;
@@ -316,5 +317,22 @@
return NMailConfiguration.Current.AuthenticationProvider;
}
}
+
+ /// <summary>
+ /// Gets the NMail install directory from the registery.
+ /// </summary>
+ /// <returns>The install location or null if an error occurs.</returns>
+ public static string GetInstallDirectory() {
+ string installDirectory = null;
+ RegistryKey nmailServerKey = Registry.LocalMachine.OpenSubKey(@"Software\NMail\NMail Server 1.0", false);
+
+ if (nmailServerKey != null) {
+ installDirectory = nmailServerKey.GetValue("InstallDirectory") as string;
+
+ nmailServerKey.Close();
+ }
+
+ return installDirectory;
+ }
}
}
Modified: NMail/branches/luke-dev/NMail.Server.Service/NMailService.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Server.Service/NMailService.cs 2006-11-07 12:25:09 UTC (rev 76)
+++ NMail/branches/luke-dev/NMail.Server.Service/NMailService.cs 2006-11-07 12:27:42 UTC (rev 77)
@@ -20,6 +20,7 @@
using System.ServiceProcess;
using System.Threading;
+using Microsoft.Win32;
using log4net;
using NMail.Configuration;
@@ -33,13 +34,16 @@
private static ILog log = LogManager.GetLogger(typeof(NMailService));
private NMailServer server;
-
+
public NMailService() {
try {
+ // Change the working directory from System32 to our install directory
+ Environment.CurrentDirectory = NMailServer.GetInstallDirectory();
+
log.Debug("Switching to event log...");
log4net.Layout.ILayout layout = new log4net.Layout.SimpleLayout();
- //log4net.Appender.IAppender appender = new log4net.Appender.FileAppender(layout, "NMail.log", true);
- log4net.Appender.IAppender appender = new log4net.Appender.EventLogAppender(layout);
+ log4net.Appender.IAppender appender = new log4net.Appender.FileAppender(layout, "NMail.log", true);
+ //log4net.Appender.IAppender appender = new log4net.Appender.EventLogAppender(layout);
log4net.Config.BasicConfigurator.Configure(appender);
log.Debug("Now logging to event log.");
@@ -78,9 +82,6 @@
// configure logging
log4net.Config.BasicConfigurator.Configure();
- // TODO: lookup from somewhere
- Environment.CurrentDirectory = @"C:\Program Files\NMail\NMail Server 1.0\";
-
ServiceBase.Run(new NMailService());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-07 12:26:25
|
Revision: 76
http://svn.sourceforge.net/nmailserver/?rev=76&view=rev
Author: tmyroadctfig
Date: 2006-11-07 04:25:09 -0800 (Tue, 07 Nov 2006)
Log Message:
-----------
Fixed some defects.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/IO/TcpTextConnection.cs
NMail/branches/luke-dev/NMail.SmtpService/Command/DataCommand.cs
NMail/branches/luke-dev/NMail.SmtpService/Command/ResetCommand.cs
Modified: NMail/branches/luke-dev/NMail/IO/TcpTextConnection.cs
===================================================================
--- NMail/branches/luke-dev/NMail/IO/TcpTextConnection.cs 2006-11-07 12:13:59 UTC (rev 75)
+++ NMail/branches/luke-dev/NMail/IO/TcpTextConnection.cs 2006-11-07 12:25:09 UTC (rev 76)
@@ -132,7 +132,11 @@
AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
- this.socket.Connect(new IPEndPoint(target.Address, (int) port));
+ if (target.Address != null) {
+ this.socket.Connect(new IPEndPoint(target.Address, port));
+ } else {
+ this.socket.Connect(target.Domain.ToString(), port);
+ }
this.networkStream = new NetworkStream(this.socket, FileAccess.ReadWrite, true);
this.readBuffer = string.Empty;
Modified: NMail/branches/luke-dev/NMail.SmtpService/Command/DataCommand.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SmtpService/Command/DataCommand.cs 2006-11-07 12:13:59 UTC (rev 75)
+++ NMail/branches/luke-dev/NMail.SmtpService/Command/DataCommand.cs 2006-11-07 12:25:09 UTC (rev 76)
@@ -82,7 +82,7 @@
session.Connection.ErrorMessageTooLarge();
// All bets are off?
- session.Message = null;
+ session.Message = new SmtpMessage();
session.CurrentState = new NegotiatedState(session);
return;
}
Modified: NMail/branches/luke-dev/NMail.SmtpService/Command/ResetCommand.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SmtpService/Command/ResetCommand.cs 2006-11-07 12:13:59 UTC (rev 75)
+++ NMail/branches/luke-dev/NMail.SmtpService/Command/ResetCommand.cs 2006-11-07 12:25:09 UTC (rev 76)
@@ -18,6 +18,8 @@
using System;
using System.Collections.Generic;
using System.Text;
+
+using NMail.DataTypes;
using NMail.SmtpService.State;
namespace NMail.SmtpService.Command {
@@ -51,7 +53,7 @@
session.CurrentState = new ConnectedState(session);
}
- session.Message = null;
+ session.Message = new SmtpMessage();
session.Connection.Ok();
} else {
throw new ApplicationException("Invalid command syntax");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-07 12:15:38
|
Revision: 75
http://svn.sourceforge.net/nmailserver/?rev=75&view=rev
Author: tmyroadctfig
Date: 2006-11-07 04:13:59 -0800 (Tue, 07 Nov 2006)
Log Message:
-----------
Changes to include a "?" in front of parameter names.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
NMail/branches/luke-dev/NMail.SpoolData.MySql/MySqlSpoolData.cs
NMail/branches/luke-dev/NMail.SpoolFilter/SpoolFilter.cs
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs 2006-11-07 12:13:59 UTC (rev 75)
@@ -106,13 +106,13 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Disabled FROM `User` WHERE Username = ?Username";
- cmd.Parameters.Add("Username", user.Username);
+ cmd.Parameters.Add("?Username", user.Username);
object o = cmd.ExecuteNonQuery();
bool disabled = true;
- if (o is bool) {
- disabled = (bool) o;
+ if (o is sbyte) {
+ disabled = ((sbyte) o == 1) ? true : false;
}
return (!disabled);
@@ -124,8 +124,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "UPDATE `User` SET Password = ?Password WHERE Username = ?Username";
- cmd.Parameters.Add("Username", user.Username);
- cmd.Parameters.Add("Password", newPassword);
+ cmd.Parameters.Add("?Username", user.Username);
+ cmd.Parameters.Add("?Password", newPassword);
int count = cmd.ExecuteNonQuery();
return (count == 1);
@@ -141,8 +141,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "UPDATE `User` SET Disabled = ?Disabled WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
- cmd.Parameters.Add("Disabled", !enabled);
+ cmd.Parameters.Add("?Username", username);
+ cmd.Parameters.Add("?Disabled", !enabled);
int count = cmd.ExecuteNonQuery();
}
}
@@ -153,12 +153,12 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Disabled, LockedOutData, PasswordExpiry, Password FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
+ cmd.Parameters.Add("?Username", username);
MySqlDataReader reader = cmd.ExecuteReader();
if (reader.Read()) {
string dbHash = reader["Password"] as string;
- bool disabled = (bool) reader["Disabled"];
+ bool disabled = ((sbyte) reader["Disabled"] == 1) ? true : false;
DateTime passwordExpiry = (DateTime) reader["PasswordExpiry"];
return createValidatedToken(username, disabled, passwordExpiry);
@@ -175,7 +175,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
+ cmd.Parameters.Add("?Username", username);
long count = (long) cmd.ExecuteScalar();
if (count == 1) {
@@ -197,12 +197,12 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Disabled, LockedOutData, PasswordExpiry, Password FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
+ cmd.Parameters.Add("?Username", username);
MySqlDataReader reader = cmd.ExecuteReader();
if (reader.Read()) {
string dbPassword = reader["Password"] as string;
- bool disabled = (bool) reader["Disabled"];
+ bool disabled = ((sbyte) reader["Disabled"] == 1) ? true : false;
DateTime passwordExpiry = (DateTime) reader["PasswordExpiry"];
// Generate a NTLM hash
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-11-07 12:13:59 UTC (rev 75)
@@ -64,7 +64,7 @@
// Get the next folder message id
cmd.CommandText = "SELECT NextMessageId FROM Folder WHERE FolderId=?FolderId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
int folderMessageId = (int)cmd.ExecuteScalar();
// Update the next message id
@@ -72,8 +72,8 @@
cmd.Transaction = transaction;
cmd.Connection = cnn;
cmd.CommandText = "UPDATE Folder SET NextMessageId=?NextMessageId WHERE FolderId=?FolderId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("NextMessageId", folderMessageId + 1);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?NextMessageId", folderMessageId + 1);
int count = cmd.ExecuteNonQuery();
if (count == 1) {
// Insert the message body
@@ -82,20 +82,20 @@
cmd.Connection = cnn;
cmd.CommandText = "INSERT INTO Message (FolderId, FolderMessageId, MimeMessage, Headers, Preamble, Postamble, SeenFlag, AnsweredFlag, FlaggedFlag, DeletedFlag, DraftFlag, RecentFlag, Size, InternalDate) " +
"VALUES (?FolderId, ?FolderMessageId, ?MimeMessage, ?Headers, ?Preamble, ?Postamble, ?SeenFlag, ?AnsweredFlag, ?FlaggedFlag, ?DeletedFlag, ?DraftFlag, ?RecentFlag, ?Size, ?InternalDate)";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", folderMessageId);
- cmd.Parameters.Add("MimeMessage", message.MultipartBody);
- cmd.Parameters.Add("Headers", message.Headers.Data.Bytes);
- cmd.Parameters.Add("Preamble", (message.Preamble != null) ? message.Preamble.Data.Bytes : null);
- cmd.Parameters.Add("Postamble", (message.Postamble != null) ? message.Postamble.Data.Bytes : null);
- cmd.Parameters.Add("SeenFlag", false);
- cmd.Parameters.Add("AnsweredFlag", false);
- cmd.Parameters.Add("FlaggedFlag", false);
- cmd.Parameters.Add("DeletedFlag", false);
- cmd.Parameters.Add("DraftFlag", false);
- cmd.Parameters.Add("RecentFlag", true);
- cmd.Parameters.Add("Size", message.Size);
- cmd.Parameters.Add("InternalDate", DateTime.Now);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", folderMessageId);
+ cmd.Parameters.Add("?MimeMessage", message.MultipartBody);
+ cmd.Parameters.Add("?Headers", message.Headers.Data.Bytes);
+ cmd.Parameters.Add("?Preamble", (message.Preamble != null) ? message.Preamble.Data.Bytes : null);
+ cmd.Parameters.Add("?Postamble", (message.Postamble != null) ? message.Postamble.Data.Bytes : null);
+ cmd.Parameters.Add("?SeenFlag", false);
+ cmd.Parameters.Add("?AnsweredFlag", false);
+ cmd.Parameters.Add("?FlaggedFlag", false);
+ cmd.Parameters.Add("?DeletedFlag", false);
+ cmd.Parameters.Add("?DraftFlag", false);
+ cmd.Parameters.Add("?RecentFlag", true);
+ cmd.Parameters.Add("?Size", message.Size);
+ cmd.Parameters.Add("?InternalDate", DateTime.Now);
count = cmd.ExecuteNonQuery();
if (count == 1) {
@@ -115,9 +115,9 @@
cmd.Connection = cnn;
cmd.CommandText = "INSERT INTO MessageData (MessageId, Part, Data) " +
"VALUES (?MessageId, ?Part, ?Data)";
- cmd.Parameters.Add("MessageId", messageId);
- cmd.Parameters.Add("Part", i + 1); // Count from 1
- cmd.Parameters.Add("Data", message.MimeParts[i].Data.Bytes);
+ cmd.Parameters.Add("?MessageId", messageId);
+ cmd.Parameters.Add("?Part", i + 1); // Count from 1
+ cmd.Parameters.Add("?Data", message.MimeParts[i].Data.Bytes);
count = cmd.ExecuteNonQuery();
if (count != 1) {
@@ -132,9 +132,9 @@
cmd.Connection = cnn;
cmd.CommandText = "INSERT INTO MessageData (MessageId, Part, Data) " +
"VALUES (?MessageId, ?Part, ?Data)";
- cmd.Parameters.Add("MessageId", messageId);
- cmd.Parameters.Add("Part", 0); // Part 0 is not counted below in GetMessageMimePartCount
- cmd.Parameters.Add("Data", message.BodyData.Bytes);
+ cmd.Parameters.Add("?MessageId", messageId);
+ cmd.Parameters.Add("?Part", 0); // Part 0 is not counted below in GetMessageMimePartCount
+ cmd.Parameters.Add("?Data", message.BodyData.Bytes);
count = cmd.ExecuteNonQuery();
if (count != 1) {
@@ -171,9 +171,9 @@
cmd.Transaction = transaction;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolderId";
- cmd.Parameters.Add("FolderId", MySqlDbType.Int32);
- cmd.Parameters.Add("Name", folder.FolderName);
- cmd.Parameters.Add("NameSpace", folder.NameSpace);
+ cmd.Parameters.Add("?FolderId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", folder.FolderName);
+ cmd.Parameters.Add("?NameSpace", folder.NameSpace);
cmd.Parameters["FolderId"].Direction = ParameterDirection.Output;
int count = cmd.ExecuteNonQuery();
@@ -200,12 +200,12 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolder";
- cmd.Parameters.Add("FolderId", folderId);
- cmd.Parameters.Add("ParentId", MySqlDbType.Int32);
- cmd.Parameters.Add("Name", MySqlDbType.String);
- cmd.Parameters.Add("NameSpace", MySqlDbType.String);
- cmd.Parameters.Add("Children", MySqlDbType.Int32);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?FolderId", folderId);
+ cmd.Parameters.Add("?ParentId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", MySqlDbType.VarString);
+ cmd.Parameters.Add("?NameSpace", MySqlDbType.VarString);
+ cmd.Parameters.Add("?Children", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["ParentId"].Direction = ParameterDirection.Output;
cmd.Parameters["Name"].Direction = ParameterDirection.Output;
cmd.Parameters["NameSpace"].Direction = ParameterDirection.Output;
@@ -257,12 +257,12 @@
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "CreateFolder";
- cmd.Parameters.Add("ParentId", parentFolderId);
- cmd.Parameters.Add("NamespaceId", 1);
- cmd.Parameters.Add("Name", newFolder.FolderName);
- cmd.Parameters.Add("UserId", userId);
- cmd.Parameters.Add("FolderId", MySqlDbType.Int32);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?ParentId", parentFolderId);
+ cmd.Parameters.Add("?NamespaceId", 1);
+ cmd.Parameters.Add("?Name", newFolder.FolderName);
+ cmd.Parameters.Add("?UserId", userId);
+ cmd.Parameters.Add("?FolderId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["FolderId"].Direction = ParameterDirection.Output;
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
@@ -288,8 +288,8 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteFolder";
- cmd.Parameters.Add("DeleteFolderId", folderId);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?DeleteFolderId", folderId);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -356,7 +356,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolderChildIds";
- cmd.Parameters.Add("FolderId", parent.FolderId);
+ cmd.Parameters.Add("?FolderId", parent.FolderId);
using (MySqlDataReader reader = cmd.ExecuteReader()) {
List<int> childIds = new List<int>();
@@ -423,7 +423,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT s.FolderId AS FolderId FROM User u, Subscription s WHERE s.UserId = u.UserId AND u.UserName = ?UserName";
- cmd.Parameters.Add("UserName", userName);
+ cmd.Parameters.Add("?UserName", userName);
using (MySqlDataReader reader = cmd.ExecuteReader()) {
List<int> subscribedIds = new List<int>();
@@ -451,8 +451,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Subscription WHERE UserId = ?UserId AND FolderId = ?FolderId";
- cmd.Parameters.Add("UserId", userId);
- cmd.Parameters.Add("FolderId", folderId);
+ cmd.Parameters.Add("?UserId", userId);
+ cmd.Parameters.Add("?FolderId", folderId);
long count = (long) cmd.ExecuteScalar();
return (count > 0);
@@ -464,13 +464,13 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT UserId FROM User WHERE UserName = ?UserName";
- cmd.Parameters.Add("UserName", userName);
+ cmd.Parameters.Add("?UserName", userName);
int userId = (int) cmd.ExecuteScalar();
if (!folderSubscribed(userId, folder.FolderId)) {
cmd.CommandText = "INSERT INTO Subscription (UserId, FolderId) VALUES(?UserId, ?FolderId)";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("UserId", userId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?UserId", userId);
if (cmd.ExecuteNonQuery() != 1) {
throw new System.Data.DataException("Error updating subscription.");
@@ -486,12 +486,12 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT UserId FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", userName);
+ cmd.Parameters.Add("?Username", userName);
int userId = (int)cmd.ExecuteScalar();
cmd.CommandText = "DELETE FROM Subscription WHERE UserId = ?UserId AND FolderId = ?FolderId";
- cmd.Parameters.Add("UserId", userId);
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?UserId", userId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
if (cmd.ExecuteNonQuery() != 1) {
throw new System.Data.DataException("Error updating subscription.");
@@ -510,8 +510,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT FolderMessageId FROM Message WHERE FolderId = ?FolderId AND FolderMessageId > ?MessageId ORDER BY FolderMessageId LIMIT 1";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?MessageId", messageId);
object o = cmd.ExecuteScalar();
return (o == null) ? 0 : (int)o;
@@ -523,7 +523,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT NextMessageId FROM Folder WHERE FolderId = ?FolderId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
object o = cmd.ExecuteScalar();
return (o == null) ? 0 : (int)o;
@@ -537,8 +537,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT FolderMessageId FROM Message WHERE FolderId = ?FolderId ORDER BY FolderMessageId LIMIT 1 OFFSET ?Offset";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("Offset", messageOffset - 1);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?Offset", messageOffset - 1);
return (int)cmd.ExecuteScalar();
}
}
@@ -550,8 +550,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Message WHERE FolderId = ?FolderId AND FolderMessageId <= ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
return Convert.ToInt32((long)cmd.ExecuteScalar());
}
}
@@ -569,8 +569,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT SeenFlag, AnsweredFlag, FlaggedFlag, DeletedFlag, DraftFlag, RecentFlag FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
using (MySqlDataReader reader = cmd.ExecuteReader()) {
if (reader.Read()) {
@@ -606,14 +606,14 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "UPDATE Message SET SeenFlag = ?SeenFlag, AnsweredFlag = ?AnsweredFlag, FlaggedFlag = ?FlaggedFlag, DeletedFlag = ?DeletedFlag, DraftFlag = ?DraftFlag, RecentFlag = ?RecentFlag WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
- cmd.Parameters.Add("SeenFlag", ((flags & StoreMessageFlags.Seen) != StoreMessageFlags.None));
- cmd.Parameters.Add("AnsweredFlag", ((flags & StoreMessageFlags.Answered) != StoreMessageFlags.None));
- cmd.Parameters.Add("FlaggedFlag", ((flags & StoreMessageFlags.Flagged) != StoreMessageFlags.None));
- cmd.Parameters.Add("DeletedFlag", ((flags & StoreMessageFlags.Deleted) != StoreMessageFlags.None));
- cmd.Parameters.Add("DraftFlag", ((flags & StoreMessageFlags.Draft) != StoreMessageFlags.None));
- cmd.Parameters.Add("RecentFlag", ((flags & StoreMessageFlags.Recent) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
+ cmd.Parameters.Add("?SeenFlag", ((flags & StoreMessageFlags.Seen) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?AnsweredFlag", ((flags & StoreMessageFlags.Answered) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?FlaggedFlag", ((flags & StoreMessageFlags.Flagged) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?DeletedFlag", ((flags & StoreMessageFlags.Deleted) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?DraftFlag", ((flags & StoreMessageFlags.Draft) != StoreMessageFlags.None));
+ cmd.Parameters.Add("?RecentFlag", ((flags & StoreMessageFlags.Recent) != StoreMessageFlags.None));
if (cmd.ExecuteNonQuery() != 1) {
throw new Exception("Error updating message flags.");
@@ -632,8 +632,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT InternalDate FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
return (DateTime)cmd.ExecuteScalar();
}
}
@@ -645,8 +645,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Size FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
return (int)cmd.ExecuteScalar();
}
}
@@ -658,8 +658,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Headers FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
byte[] headerBytes = (byte[]) cmd.ExecuteScalar();
if (headerBytes == null) {
@@ -677,9 +677,9 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT md.Data FROM Message m, MessageData md WHERE m.MessageId = md.MessageId AND m.FolderId = ?FolderId AND m.FolderMessageId = ?FolderMessageId AND md.Part = ?Part";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
- cmd.Parameters.Add("Part", messagePart);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
+ cmd.Parameters.Add("?Part", messagePart);
byte[] bodyDataBytes = (byte[]) cmd.ExecuteScalar();
return new SimpleBodyPart(new ByteString(bodyDataBytes, Encoding.ASCII));
}
@@ -692,8 +692,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT MimeMessage FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
SByte sb = (SByte) cmd.ExecuteScalar();
bool mimeMessage = (sb == 1) ? true : false;
@@ -702,8 +702,8 @@
if (mimeMessage) {
cmd.CommandText = "SELECT Preamble, Postamble FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
MySqlDataReader reader = cmd.ExecuteReader();
if (reader.Read()) {
@@ -719,8 +719,8 @@
reader.Close();
cmd.CommandText = "SELECT md.Data FROM Message m, MessageData md WHERE m.MessageId = md.MessageId AND m.FolderId = ?FolderId AND m.FolderMessageId = ?FolderMessageId ORDER BY md.Part";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
reader = cmd.ExecuteReader();
ArrayList mimePartList = new ArrayList();
@@ -735,8 +735,8 @@
} else {
cmd.CommandText = "SELECT md.Data FROM Message m, MessageData md WHERE m.MessageId = md.MessageId AND m.FolderId = ?FolderId AND m.FolderMessageId = ?FolderMessageId AND md.Part = 0";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", messageId);
byte[] data = (byte[]) cmd.ExecuteScalar();
result = new Message(new SimpleBodyPart(headers, new ByteString(data, Encoding.ASCII))); // TODO: check if encoding is ok?
@@ -757,7 +757,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) as MessageCount FROM Message WHERE FolderId = ?FolderId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
return Convert.ToInt32((Int64)cmd.ExecuteScalar());
}
}
@@ -769,7 +769,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Message WHERE FolderId = ?FolderId AND RecentFlag = true";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
return Convert.ToInt32((long)cmd.ExecuteScalar());
}
}
@@ -787,7 +787,7 @@
MySqlCommand cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT FolderMessageId FROM Message WHERE FolderId = ?FolderId AND DeletedFlag = true";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
// Get a list of deleted messages
MySqlDataReader reader = cmd.ExecuteReader();
@@ -803,15 +803,15 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT MessageId FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("FolderMessageId", (int) folderMsgIds[i]);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderMessageId", (int) folderMsgIds[i]);
long messageId = (long) cmd.ExecuteScalar();
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "DELETE FROM Message WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() != 1) {
transaction.Rollback();
@@ -835,7 +835,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Data FROM AuxData WHERE `Key` = ?Key";
- cmd.Parameters.Add("Key", key);
+ cmd.Parameters.Add("?Key", key);
byte[] data = (byte[]) cmd.ExecuteScalar();
return SerializationHelper.Deserialize(data);
@@ -853,15 +853,15 @@
MySqlCommand cmd = cnn.CreateCommand();
cmd.CommandText = "DELETE FROM AuxData WHERE `Key` = ?Key";
- cmd.Parameters.Add("Key", key);
+ cmd.Parameters.Add("?Key", key);
cmd.Transaction = trans;
cmd.ExecuteNonQuery();
cmd = cnn.CreateCommand();
cmd.CommandText = "INSERT INTO AuxData (`Key`, Data) VALUES (?Key, ?Data)";
- cmd.Parameters.Add("Key", key);
- cmd.Parameters.Add("Data", SerializationHelper.Serialize(o));
+ cmd.Parameters.Add("?Key", key);
+ cmd.Parameters.Add("?Data", SerializationHelper.Serialize(o));
cmd.Transaction = trans;
if (cmd.ExecuteNonQuery() == 1) {
@@ -891,12 +891,12 @@
cmd.Transaction = transaction;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetUserFromName";
- cmd.Parameters.Add("Name", name);
- cmd.Parameters.Add("UserId", MySqlDbType.Int32);
- cmd.Parameters.Add("QuotaHardLimit", MySqlDbType.Int32);
- cmd.Parameters.Add("QuotaWarnLimit", MySqlDbType.Int32);
- cmd.Parameters.Add("UserFolderId", MySqlDbType.Int32);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", name);
+ cmd.Parameters.Add("?UserId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?QuotaHardLimit", MySqlDbType.Int32);
+ cmd.Parameters.Add("?QuotaWarnLimit", MySqlDbType.Int32);
+ cmd.Parameters.Add("?UserFolderId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["UserId"].Direction = ParameterDirection.Output;
cmd.Parameters["QuotaHardLimit"].Direction = ParameterDirection.Output;
cmd.Parameters["QuotaWarnLimit"].Direction = ParameterDirection.Output;
@@ -947,12 +947,12 @@
cmd.Transaction = transaction;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetUserFromId";
- cmd.Parameters.Add("UserId", userId);
- cmd.Parameters.Add("Name", MySqlDbType.VarChar);
- cmd.Parameters.Add("QuotaHardLimit", MySqlDbType.Int32);
- cmd.Parameters.Add("QuotaWarnLimit", MySqlDbType.Int32);
- cmd.Parameters.Add("UserFolderId", MySqlDbType.Int32);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?UserId", userId);
+ cmd.Parameters.Add("?Name", MySqlDbType.VarChar);
+ cmd.Parameters.Add("?QuotaHardLimit", MySqlDbType.Int32);
+ cmd.Parameters.Add("?QuotaWarnLimit", MySqlDbType.Int32);
+ cmd.Parameters.Add("?UserFolderId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Name"].Direction = ParameterDirection.Output;
cmd.Parameters["QuotaHardLimit"].Direction = ParameterDirection.Output;
cmd.Parameters["QuotaWarnLimit"].Direction = ParameterDirection.Output;
@@ -1044,11 +1044,11 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "CreateUser";
- cmd.Parameters.Add("Name", username);
- cmd.Parameters.Add("QuotaHardLimit", hardQuota);
- cmd.Parameters.Add("QuotaWarnLimit", warnQuota);
- cmd.Parameters.Add("UserId", MySqlDbType.Int32);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", username);
+ cmd.Parameters.Add("?QuotaHardLimit", hardQuota);
+ cmd.Parameters.Add("?QuotaWarnLimit", warnQuota);
+ cmd.Parameters.Add("?UserId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["UserId"].Direction = ParameterDirection.Output;
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
@@ -1073,8 +1073,8 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteUser";
- cmd.Parameters.Add("DeleteUserId", userId);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?DeleteUserId", userId);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1098,11 +1098,11 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateUser";
- cmd.Parameters.Add("UserId", user.UserId);
- cmd.Parameters.Add("Name", user.Username);
- cmd.Parameters.Add("QuotaHardLimit", user.QuotaHardLimit);
- cmd.Parameters.Add("QuotaWarnLimit", user.QuotaWarnLimit);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?UserId", user.UserId);
+ cmd.Parameters.Add("?Name", user.Username);
+ cmd.Parameters.Add("?QuotaHardLimit", user.QuotaHardLimit);
+ cmd.Parameters.Add("?QuotaWarnLimit", user.QuotaWarnLimit);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1125,7 +1125,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetUserFolders";
- cmd.Parameters.Add("UserId", userId);
+ cmd.Parameters.Add("?UserId", userId);
List<StoreFolder> folders = new List<StoreFolder>();
MySqlDataReader reader = cmd.ExecuteReader();
@@ -1166,10 +1166,10 @@
cmd.Transaction = transaction;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetGroupFromName";
- cmd.Parameters.Add("Name", name);
- cmd.Parameters.Add("GroupId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", name);
+ cmd.Parameters.Add("?GroupId", MySqlDbType.Int32);
cmd.Parameters["GroupId"].Direction = ParameterDirection.Output;
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
DataSet groupData = new DataSet();
@@ -1220,10 +1220,10 @@
cmd.Transaction = transaction;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetGroupFromId";
- cmd.Parameters.Add("GroupId", groupId);
- cmd.Parameters.Add("Name", MySqlDbType.VarChar);
+ cmd.Parameters.Add("?GroupId", groupId);
+ cmd.Parameters.Add("?Name", MySqlDbType.VarChar);
cmd.Parameters["Name"].Direction = ParameterDirection.Output;
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
DataSet groupData = new DataSet();
@@ -1311,10 +1311,10 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "CreateGroup";
- cmd.Parameters.Add("Name", name);
- cmd.Parameters.Add("GroupId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Name", name);
+ cmd.Parameters.Add("?GroupId", MySqlDbType.Int32);
cmd.Parameters["GroupId"].Direction = ParameterDirection.Output;
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1338,8 +1338,8 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteGroup";
- cmd.Parameters.Add("DeleteGroupId", groupId);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?DeleteGroupId", groupId);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1363,10 +1363,10 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateGroup";
- cmd.Parameters.Add("GroupId", group.GroupId);
- cmd.Parameters.Add("Name", group.Name);
- cmd.Parameters.Add("ObjectData", SerializationHelper.Serialize(group));
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?GroupId", group.GroupId);
+ cmd.Parameters.Add("?Name", group.Name);
+ cmd.Parameters.Add("?ObjectData", SerializationHelper.Serialize(group));
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1391,10 +1391,10 @@
private void setStoreFolderAce(StoreFolder folder, GenericAce<StoreFolderPrivilege> ace, MySqlConnection cnn, MySqlTransaction transaction) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "REPLACE FolderAcl (FolderId, Identifier, Allow, Privilege) VALUES (?FolderId, ?Identifier, ?Allow, ?Privilege)";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("Identifier", ace.Identifier);
- cmd.Parameters.Add("Privilege", Convert.ToUInt32(ace.Privilege));
- cmd.Parameters.Add("Allow", (ace.AceType == AcePrivilegeType.Allow));
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?Identifier", ace.Identifier);
+ cmd.Parameters.Add("?Privilege", Convert.ToUInt32(ace.Privilege));
+ cmd.Parameters.Add("?Allow", (ace.AceType == AcePrivilegeType.Allow));
int count = cmd.ExecuteNonQuery();
if (count != 1 && count != 2) { // Replace returns a count of 2
@@ -1409,8 +1409,8 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "DELETE FROM FolderAcl WHERE FolderId = ?FolderId AND Identifier = ?Identifier";
- cmd.Parameters.Add("FolderId", folder.FolderId);
- cmd.Parameters.Add("Identifier", identifier);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
+ cmd.Parameters.Add("?Identifier", identifier);
if (cmd.ExecuteNonQuery() != 1) {
throw new System.Data.DataException("Error deleting ACE.");
@@ -1428,7 +1428,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Identifier, Allow, Privilege FROM FolderAcl WHERE FolderId = ?FolderId";
- cmd.Parameters.Add("FolderId", folder.FolderId);
+ cmd.Parameters.Add("?FolderId", folder.FolderId);
using (MySqlDataReader reader = cmd.ExecuteReader()) {
while (reader.Read()) {
@@ -1456,7 +1456,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.Transaction = transaction;
cmd.CommandText = "SELECT ObjectData FROM MailDomain WHERE MailDomainId = ?MailDomainId";
- cmd.Parameters.Add("MailDomainId", mailDomainId);
+ cmd.Parameters.Add("?MailDomainId", mailDomainId);
MailDomain result = null;
byte[] objectData = cmd.ExecuteScalar() as byte[];
@@ -1526,11 +1526,11 @@
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "AddMailDomain";
- cmd.Parameters.Add("PrimaryHost", mailDomain.PrimaryHost.ToString());
- cmd.Parameters.Add("ObjectData", SerializationHelper.Serialize(mailDomain));
- cmd.Parameters.Add("MailDomainId", MySqlDbType.Int32);
+ cmd.Parameters.Add("?PrimaryHost", mailDomain.PrimaryHost.ToString());
+ cmd.Parameters.Add("?ObjectData", SerializationHelper.Serialize(mailDomain));
+ cmd.Parameters.Add("?MailDomainId", MySqlDbType.Int32);
cmd.Parameters["MailDomainId"].Direction = ParameterDirection.Output;
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1554,8 +1554,8 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteMailDomain";
- cmd.Parameters.Add("DeleteMailDomainId", mailDomainId);
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?DeleteMailDomainId", mailDomainId);
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1579,10 +1579,10 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateMailDomain";
- cmd.Parameters.Add("PrimaryHost", updatedMailDomain.PrimaryHost.ToString());
- cmd.Parameters.Add("MailDomainId", updatedMailDomain.MailDomainId);
- cmd.Parameters.Add("ObjectData", SerializationHelper.Serialize(updatedMailDomain));
- cmd.Parameters.Add("Result", MySqlDbType.Int32);
+ cmd.Parameters.Add("?PrimaryHost", updatedMailDomain.PrimaryHost.ToString());
+ cmd.Parameters.Add("?MailDomainId", updatedMailDomain.MailDomainId);
+ cmd.Parameters.Add("?ObjectData", SerializationHelper.Serialize(updatedMailDomain));
+ cmd.Parameters.Add("?Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
@@ -1607,9 +1607,9 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SetSystemAce";
- cmd.Parameters.Add("Identifier", ace.Identifier);
- cmd.Parameters.Add("Privilege", Convert.ToUInt32(ace.Privilege));
- cmd.Parameters.Add("Allow", (ace.AceType == AcePrivilegeType.Allow));
+ cmd.Parameters.Add("?Identifier", ace.Identifier);
+ cmd.Parameters.Add("?Privilege", Convert.ToUInt32(ace.Privilege));
+ cmd.Parameters.Add("?Allow", (ace.AceType == AcePrivilegeType.Allow));
cmd.ExecuteNonQuery();
}
}
@@ -1624,7 +1624,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "RemoveSystemAce";
- cmd.Parameters.Add("Identifier", identifier);
+ cmd.Parameters.Add("?Identifier", identifier);
cmd.ExecuteNonQuery();
}
}
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs 2006-11-07 12:13:59 UTC (rev 75)
@@ -46,7 +46,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
// First check if the username matches the mailbox
cmd.CommandText = "SELECT u.UserId FROM User u WHERE u.Username LIKE ?Mailbox";
- cmd.Parameters.Add("Mailbox", mailbox);
+ cmd.Parameters.Add("?Mailbox", mailbox);
object o = cmd.ExecuteScalar();
if (o is int) {
@@ -55,7 +55,7 @@
// Next check if the mailbox maps to a user
cmd.CommandText = "SELECT u.UserId FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND m.Mailbox LIKE ?Mailbox";
- cmd.Parameters.Add("Mailbox", mailbox);
+ cmd.Parameters.Add("?Mailbox", mailbox);
o = cmd.ExecuteScalar();
if (o is int) {
@@ -72,7 +72,7 @@
using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT m.Mailbox FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND u.Username LIKE ?Username";
- cmd.Parameters.Add("Username", username);
+ cmd.Parameters.Add("?Username", username);
using (MySqlDataReader reader = cmd.ExecuteReader()) {
List<Mailbox> mailboxes = new List<Mailbox>();
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-11-07 12:13:59 UTC (rev 75)
@@ -78,9 +78,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\Mono.Security.dll</HintPath>
</Reference>
- <Reference Include="MySql.Data">
- <Name>MySql.Data</Name>
- <HintPath>..\..\..\..\..\..\..\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySql.Data.dll</HintPath>
+ <Reference Include="MySql.Data, Version=1.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\References\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
Modified: NMail/branches/luke-dev/NMail.SpoolData.MySql/MySqlSpoolData.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SpoolData.MySql/MySqlSpoolData.cs 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.SpoolData.MySql/MySqlSpoolData.cs 2006-11-07 12:13:59 UTC (rev 75)
@@ -65,8 +65,8 @@
MySqlCommand cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT MessageRecipientId FROM Message m, MessageRecipient mr WHERE m.MessageGuid = ?MessageGuid AND mr.Recipient = ?Recipient AND mr.MessageId = m.MessageId";
- cmd.Parameters.Add("MessageGuid", recipient.Message.MessageId.ToByteArray());
- cmd.Parameters.Add("Recipient", recipient.ToString());
+ cmd.Parameters.Add("?MessageGuid", recipient.Message.MessageId.ToByteArray());
+ cmd.Parameters.Add("?Recipient", recipient.ToString());
int messageRecipientId = (int)cmd.ExecuteScalar();
if (result.Type == DeliveryResultType.TemporaryError) {
@@ -74,10 +74,10 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "UPDATE MessageRecipient SET DeliveryAttempts = ?DeliveryAttempts, NextDeliveryAttempt = ?NextDeliveryAttempt, InProgress = ?InProgress WHERE MessageRecipientId = ?MessageRecipientId";
- cmd.Parameters.Add("DeliveryAttempts", recipient.DeliveryAttempts);
- cmd.Parameters.Add("NextDeliveryAttempt", recipient.NextDeliveryAttempt);
- cmd.Parameters.Add("InProgress", false);
- cmd.Parameters.Add("MessageRecipientId", messageRecipientId);
+ cmd.Parameters.Add("?DeliveryAttempts", recipient.DeliveryAttempts);
+ cmd.Parameters.Add("?NextDeliveryAttempt", recipient.NextDeliveryAttempt);
+ cmd.Parameters.Add("?InProgress", false);
+ cmd.Parameters.Add("?MessageRecipientId", messageRecipientId);
if (cmd.ExecuteNonQuery() == 1) {
transaction.Commit();
@@ -91,21 +91,21 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT MessageId FROM MessageRecipient WHERE MessageRecipientId = ?MessageRecipientId";
- cmd.Parameters.Add("MessageRecipientId", messageRecipientId);
+ cmd.Parameters.Add("?MessageRecipientId", messageRecipientId);
int messageId = (int)cmd.ExecuteScalar();
// Either delivered successfully or permenant failure, delete the recipient
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "DELETE FROM MessageRecipient WHERE MessageRecipientId = ?MessageRecipientId";
- cmd.Parameters.Add("MessageRecipientId", messageRecipientId);
+ cmd.Parameters.Add("?MessageRecipientId", messageRecipientId);
if (cmd.ExecuteNonQuery() == 1) {
// Check if any recipients remain
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT COUNT(*) FROM MessageRecipient WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
long count = (long)cmd.ExecuteScalar();
if (count == 0) {
@@ -113,7 +113,7 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "DELETE FROM Message WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() != 1) {
transaction.Rollback();
@@ -142,7 +142,7 @@
MySqlTransaction trans = cnn.BeginTransaction();
cmd.Transaction = trans;
cmd.CommandText = "SELECT MessageId FROM Message WHERE MessageGuid = ?MessageGuid";
- cmd.Parameters.Add("MessageGuid", message.MessageId.ToByteArray());
+ cmd.Parameters.Add("?MessageGuid", message.MessageId.ToByteArray());
int messageId = (int)cmd.ExecuteScalar();
if (filtered) {
@@ -150,7 +150,7 @@
cmd = cnn.CreateCommand();
cmd.Transaction = trans;
cmd.CommandText = "UPDATE Message SET Filtered = true, InProgress = false WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() != 1) {
trans.Rollback();
throw new Exception("Error updating filtered status.");
@@ -159,7 +159,7 @@
cmd = cnn.CreateCommand();
cmd.Transaction = trans;
cmd.CommandText = "DELETE FROM MessageRecipient WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() <= 0) {
trans.Rollback();
throw new Exception("Error removing previous recipients.");
@@ -171,12 +171,12 @@
cmd = cnn.CreateCommand();
cmd.Transaction = trans;
cmd.CommandText = "INSERT INTO MessageRecipient (MessageId, Host, Recipient, NextDeliveryAttempt, DeliveryAttempts, InProgress) VALUES (?MessageId, ?Host, ?Recipient, ?NextDeliveryAttempt, ?DeliveryAttempts - 1, ?InProgress)";
- cmd.Parameters.Add("MessageId", messageId);
- cmd.Parameters.Add("Host", recipient.Host.ToString());
- cmd.Parameters.Add("Recipient", recipient.ToString());
- cmd.Parameters.Add("DeliveryAttempts", 1); // TODO: this is a fix for some NULL bug in the connector, chase it up
- cmd.Parameters.Add("NextDeliveryAttempt", deliveryTime);
- cmd.Parameters.Add("InProgress", false);
+ cmd.Parameters.Add("?MessageId", messageId);
+ cmd.Parameters.Add("?Host", recipient.Host.ToString());
+ cmd.Parameters.Add("?Recipient", recipient.ToString());
+ cmd.Parameters.Add("?DeliveryAttempts", 1); // TODO: this is a fix for some NULL bug in the connector, chase it up
+ cmd.Parameters.Add("?NextDeliveryAttempt", deliveryTime);
+ cmd.Parameters.Add("?InProgress", false);
if (cmd.ExecuteNonQuery() != 1) {
trans.Rollback();
@@ -189,14 +189,14 @@
} else {
// Delete the message
cmd.CommandText = "DELETE FROM MessageRecipient WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() <= 0) {
trans.Rollback();
throw new Exception("Error removing recipients.");
}
cmd.CommandText = "DELETE FROM Message WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() != 1) {
trans.Rollback();
throw new Exception("Error removing message.");
@@ -232,14 +232,14 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "UPDATE Message SET InProgress = true WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
if (cmd.ExecuteNonQuery() == 1) {
// Get the recipients for the message
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT Recipient FROM MessageRecipient WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
reader = cmd.ExecuteReader();
while (reader.Read()) {
@@ -279,14 +279,14 @@
// Insert the sender details and message data
cmd.CommandText = "INSERT INTO Message (MessageGuid, MessageData, MessageEnvelope, ReportedHost, SourceAddress, Sender, InProgress, Filtered) VALUES (?MessageGuid, ?MessageData, ?MessageEnvelope, ?ReportedHost, ?SourceAddress, ?Sender, ?InProgress, ?Filtered);";
- cmd.Parameters.Add("MessageGuid", message.MessageId.ToByteArray());
- cmd.Parameters.Add("MessageData", SerializationHelper.Serialize(message.Data));
- cmd.Parameters.Add("MessageEnvelope", SerializationHelper.Serialize(message.Data.GetEnvelope()));
- cmd.Parameters.Add("ReportedHost", message.ReportedHost.ToString());
- cmd.Parameters.Add("SourceAddress", message.SourceAddress.ToString());
- cmd.Parameters.Add("Sender", message.Sender.ToString());
- cmd.Parameters.Add("InProgress", false);
- cmd.Parameters.Add("Filtered", false);
+ cmd.Parameters.Add("?MessageGuid", message.MessageId.ToByteArray());
+ cmd.Parameters.Add("?MessageData", SerializationHelper.Serialize(message.Data));
+ cmd.Parameters.Add("?MessageEnvelope", SerializationHelper.Serialize(message.Data.GetEnvelope()));
+ cmd.Parameters.Add("?ReportedHost", message.ReportedHost.ToString());
+ cmd.Parameters.Add("?SourceAddress", message.SourceAddress.ToString());
+ cmd.Parameters.Add("?Sender", message.Sender.ToString());
+ cmd.Parameters.Add("?InProgress", false);
+ cmd.Parameters.Add("?Filtered", false);
int count = cmd.ExecuteNonQuery();
if (count != 1) {
@@ -306,12 +306,12 @@
cmd.Transaction = transaction;
cmd.CommandText = "INSERT INTO MessageRecipient (MessageId, Host, Recipient, NextDeliveryAttempt, DeliveryAttempts, InProgress) VALUES (?MessageId, ?Host, ?Recipient, ?NextDeliveryAttempt, ?DeliveryAttempts - 1, ?InProgress)";
- cmd.Parameters.Add("MessageId", messageId);
- cmd.Parameters.Add("Host", recipient.Host.ToString());
- cmd.Parameters.Add("Recipient", recipient.ToString());
- cmd.Parameters.Add("DeliveryAttempts", 1); // TODO: fix for some null bug in the connector, chase it up
- cmd.Parameters.Add("NextDeliveryAttempt", deliveryTime);
- cmd.Parameters.Add("InProgress", false);
+ cmd.Parameters.Add("?MessageId", messageId);
+ cmd.Parameters.Add("?Host", recipient.Host.ToString());
+ cmd.Parameters.Add("?Recipient", recipient.ToString());
+ cmd.Parameters.Add("?DeliveryAttempts", 1); // TODO: fix for some null bug in the connector, chase it up
+ cmd.Parameters.Add("?NextDeliveryAttempt", deliveryTime);
+ cmd.Parameters.Add("?InProgress", false);
count = cmd.ExecuteNonQuery();
@@ -337,7 +337,7 @@
MySqlCommand cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT mr.Host FROM MessageRecipient mr, Message m WHERE mr.NextDeliveryAttempt <= ?CurrentTime AND mr.InProgress = false AND m.MessageId = mr.MessageId AND m.Filtered = true AND mr.Host NOT IN (SELECT Host FROM MessageRecipient WHERE InProgress = true) ORDER BY mr.NextDeliveryAttempt ASC LIMIT 1";
- cmd.Parameters.Add("CurrentTime", DateTime.Now);
+ cmd.Parameters.Add("?CurrentTime", DateTime.Now);
object hostname = cmd.ExecuteScalar();
if (hostname is DBNull) {
@@ -356,8 +356,8 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT mr.MessageId, LENGTH(m.MessageData) AS Size FROM Message m, MessageRecipient mr WHERE mr.MessageId = m.MessageId AND mr.InProgress = false AND m.Filtered = true AND mr.Host = ?Host ORDER BY mr.NextDeliveryAttempt LIMIT ?Limit";
- cmd.Parameters.Add("Host", host.ToString());
- cmd.Parameters.Add("Limit", messageLimit);
+ cmd.Parameters.Add("?Host", host.ToString());
+ cmd.Parameters.Add("?Limit", messageLimit);
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read()) {
messageIdList.Add(reader.GetInt32(0));
@@ -373,7 +373,7 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT MessageGuid, ReportedHost, SourceAddress, Sender, MessageData FROM Message WHERE MessageId = ?MessageId";
- cmd.Parameters.Add("MessageId", messageIds[i]);
+ cmd.Parameters.Add("?MessageId", messageIds[i]);
reader = cmd.ExecuteReader();
if (reader.Read()) {
@@ -389,7 +389,7 @@
cmd = cnn.CreateCommand();
cmd.Transaction = transaction;
cmd.CommandText = "SELECT MessageRecipientId, Recipient, DeliveryAttempts, NextDeliveryAttempt FROM MessageRecipient WHERE MessageId = ?MessageId AND InProgress = false";
- cmd.Parameters.Add("MessageId", messageIds[i]);
+ cmd.Parameters.Add("?MessageId", messageIds[i]);
reader = cmd.ExecuteReader();
ArrayList recipientIdList = new ArrayList();
@@ -408,7 +408,7 @@
int[] recipientIds = (int[])recipientIdList.ToArray(typeof(int));
for (int j = 0; j < recipientIds.Length; j++) {
cmd.CommandText = "UPDATE MessageRecipient SET InProgress = true WHERE MessageRecipientId = ?MessageRecipientId";
- cmd.Parameters.Add("MessageRecipientId", recipientIds[j]);
+ cmd.Parameters.Add("?MessageRecipientId", recipientIds[j]);
cmd.Transaction = transaction;
if (cmd.ExecuteNonQuery() != 1) {
@@ -493,7 +493,7 @@
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetSpoolRecipients";
- cmd.Parameters.Add("MessageId", messageId);
+ cmd.Parameters.Add("?MessageId", messageId);
List<SpoolRecipient> result = new List<SpoolRecipient>();
MySqlDataReader reader = cmd.ExecuteReader();
Modified: NMail/branches/luke-dev/NMail.SpoolFilter/SpoolFilter.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SpoolFilter/SpoolFilter.cs 2006-11-07 12:09:49 UTC (rev 74)
+++ NMail/branches/luke-dev/NMail.SpoolFilter/SpoolFilter.cs 2006-11-07 12:13:59 UTC (rev 75)
@@ -227,9 +227,12 @@
private void FilterMessage(object state) {
SmtpMessage message = (SmtpMessage)state;
+ bool passed = true;
// Pass a new message through the filter
- bool passed = this.config.FilterRule.FilterMessage(message);
+ if (this.config.FilterRule != null) {
+ passed = this.config.FilterRule.FilterMessage(message);
+ }
// Set the filtered bit in the spool data
this.data.SetFilterStatus(message, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-07 12:11:24
|
Revision: 74
http://svn.sourceforge.net/nmailserver/?rev=74&view=rev
Author: tmyroadctfig
Date: 2006-11-07 04:09:49 -0800 (Tue, 07 Nov 2006)
Log Message:
-----------
Work on setup wizard. Fixed some defects.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/MySqlHelper.cs
NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
Modified: NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.Designer.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -86,7 +86,7 @@
// password
//
this.password.Enabled = false;
- this.password.Location = new System.Drawing.Point(127, 168);
+ this.password.Location = new System.Drawing.Point(127, 191);
this.password.Name = "password";
this.password.PasswordChar = '*';
this.password.Size = new System.Drawing.Size(176, 20);
@@ -97,19 +97,20 @@
this.createDbUserCheckBox.AutoSize = true;
this.createDbUserCheckBox.Checked = true;
this.createDbUserCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
- this.createDbUserCheckBox.Location = new System.Drawing.Point(127, 194);
+ this.createDbUserCheckBox.Location = new System.Drawing.Point(127, 145);
this.createDbUserCheckBox.Name = "createDbUserCheckBox";
this.createDbUserCheckBox.Size = new System.Drawing.Size(159, 17);
this.createDbUserCheckBox.TabIndex = 8;
this.createDbUserCheckBox.Text = "Create a new database user";
this.createDbUserCheckBox.UseVisualStyleBackColor = true;
+ this.createDbUserCheckBox.CheckedChanged += new System.EventHandler(this.createDbUserCheckBox_CheckedChanged);
//
// autoPassCheckBox
//
this.autoPassCheckBox.AutoSize = true;
this.autoPassCheckBox.Checked = true;
this.autoPassCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
- this.autoPassCheckBox.Location = new System.Drawing.Point(127, 145);
+ this.autoPassCheckBox.Location = new System.Drawing.Point(127, 168);
this.autoPassCheckBox.Name = "autoPassCheckBox";
this.autoPassCheckBox.Size = new System.Drawing.Size(141, 17);
this.autoPassCheckBox.TabIndex = 6;
@@ -137,7 +138,7 @@
// passwordLbl
//
this.passwordLbl.AutoSize = true;
- this.passwordLbl.Location = new System.Drawing.Point(17, 171);
+ this.passwordLbl.Location = new System.Drawing.Point(17, 194);
this.passwordLbl.Name = "passwordLbl";
this.passwordLbl.Size = new System.Drawing.Size(104, 13);
this.passwordLbl.TabIndex = 9;
Modified: NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/DatabaseConfigPanel.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -24,6 +24,7 @@
using System.Windows.Forms;
using NMail.SpoolData.MySql.Configuration;
+using NMail.LocalStoreData.MySql.Configuration;
namespace NMail.SetupWizard {
public partial class DatabaseConfigPanel : BasePanel {
@@ -39,8 +40,13 @@
// Make a random password
this.password.Text = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
+ this.password.Text = this.password.Text.Replace("=", "a");
+ this.password.Text = this.password.Text.Replace("+", "b");
+ this.password.Text = this.password.Text.Replace("/", "c");
this.createDbUserTask = new Task("Create a new database user.", new TaskDelegate(createDbUser));
+
+ this.grantDbUserPrivsTask = new Task("Grant privileges to the database user.", new TaskDelegate(grantDbPrivileges));
}
private LocalStoreConfigPanel localStoreConfigPanel;
@@ -49,6 +55,8 @@
private Task createDbUserTask;
+ private Task grantDbUserPrivsTask;
+
/// <summary>
/// The code that attempts to create a new database user.
/// </summary>
@@ -68,6 +76,28 @@
}
/// <summary>
+ /// Grants the database user the required privileges to the database.
+ /// </summary>
+ /// <param name="message">A message if an error occurs.</param>
+ /// <returns>The result of the attempt to grant the privileges.</returns>
+ private TaskResult grantDbPrivileges(out string message) {
+ try {
+ string dbUser = this.DatabaseUsername + "@'%'";
+ MySqlHelper.DatabaseHost = this.DatabaseHost;
+ MySqlHelper.GrantPrivileges(dbUser, "mysql.proc", "SELECT"); // TODO: remove for MySql connector 1.0.8 and higher
+ MySqlHelper.GrantPrivileges(dbUser, "NMailSpool.*", "INSERT,SELECT,UPDATE,DELETE,EXECUTE");
+ MySqlHelper.GrantPrivileges(dbUser, "NMailLocalStore.*", "INSERT,SELECT,UPDATE,DELETE,EXECUTE");
+
+ message = null;
+ return TaskResult.Ok;
+
+ } catch (Exception e) {
+ message = "Error granting privileges to database user: " + e.Message;
+ return TaskResult.Error;
+ }
+ }
+
+ /// <summary>
/// Gets the database host.
/// </summary>
public string DatabaseHost {
@@ -115,6 +145,24 @@
// Remove the configuration
MySqlSpoolDataConfiguration.RemoveFromConfigFile();
}
+
+ if (this.localStoreConfigPanel.LocalStoreSubSystemEnabled) {
+ // Ensure our config sections are there
+ MySqlLocalStoreDataConfiguration.AddToConfigFile();
+
+ MySqlLocalStoreDataConfiguration mlsdc = MySqlLocalStoreDataConfiguration.Current;
+
+ // Save the connection string
+ mlsdc.ConnectionString = string.Format(
+ "Host={0};Password={1};Uid={2};Database=NMailLocalStore",
+ this.hostname.Text,
+ this.password.Text,
+ this.username.Text);
+
+ } else {
+ // Remove the configuration
+ MySqlLocalStoreDataConfiguration.RemoveFromConfigFile();
+ }
}
private void loadConfiguration() {
@@ -137,9 +185,11 @@
if (makeTablesIndex == -1) {
this.BaseForm.Tasks.Add(this.createDbUserTask);
+ this.BaseForm.Tasks.Add(this.grantDbUserPrivsTask);
} else {
// Insert the create user task before the make spool tables task
this.BaseForm.Tasks.Insert(makeTablesIndex, this.createDbUserTask);
+ this.BaseForm.Tasks.Insert(makeTablesIndex + 1, this.grantDbUserPrivsTask);
}
}
@@ -148,8 +198,14 @@
protected override void OnBackButtonClick() {
this.BaseForm.Tasks.Remove(this.createDbUserTask);
+ this.BaseForm.Tasks.Remove(this.grantDbUserPrivsTask);
base.OnBackButtonClick();
}
+
+ private void createDbUserCheckBox_CheckedChanged(object sender, EventArgs e) {
+ this.autoPassCheckBox.Enabled = this.createDbUserCheckBox.Checked;
+ this.password.Enabled = this.createDbUserCheckBox.Checked && !this.autoPassCheckBox.Checked;
+ }
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -91,6 +91,23 @@
DnsClientConfiguration.Current.DnsServers.Add(element);
}
+ // Ensure we are in the list of named services
+ NMailConfiguration nc = NMailConfiguration.Current;
+ bool foundDnsClient = false;
+
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "DnsClient") {
+ foundDnsClient = true;
+ }
+ }
+
+ if (!foundDnsClient) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "DnsClient";
+ service.ObjectType = typeof(DnsClient.DnsClient);
+ nc.NamedServiceDetails.Add(service);
+ }
+
base.OnNextButtonClick();
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -143,12 +143,15 @@
// Ensure the local store and localstore data are in the list of named services
bool foundLocalStore = false;
bool foundLocalStoreData = false;
+ bool foundAuthProvider = false;
for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
if (nc.NamedServiceDetails[i].Name == "LocalStore") {
foundLocalStore = true;
} else if (nc.NamedServiceDetails[i].Name == "LocalStoreData") {
foundLocalStoreData = true;
+ } else if (nc.NamedServiceDetails[i].Name == "AuthProvider") {
+ foundAuthProvider = true;
}
}
@@ -166,6 +169,13 @@
nc.NamedServiceDetails.Add(service);
}
+ if (!foundAuthProvider) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "AuthProvider";
+ service.ObjectType = typeof(MySqlAuthProvider);
+ nc.NamedServiceDetails.Add(service);
+ }
+
// Save the visible host
try {
isc.VisibleHost = new Host(this.visibleHostTextBox.Text);
Modified: NMail/branches/luke-dev/NMail.SetupWizard/MySqlHelper.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/MySqlHelper.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/MySqlHelper.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -84,18 +84,35 @@
MySqlCommand cmd = cnn.CreateCommand();
cmd.CommandText = "CREATE DATABASE ?Database";
- cmd.Parameters.Add("Database", databaseName);
+ cmd.Parameters.Add("?Database", databaseName);
cmd.ExecuteNonQuery();
}
+ /// <summary>
+ /// Grants privileges on a database to a user.
+ /// </summary>
+ /// <remarks><b>WARNING:</b> The strings used in this function are not
+ /// checked for SQL injection attacks. Only use input from a trusted
+ /// source!</remarks>
+ public static void GrantPrivileges(string username, string database, string privileges) {
+ MySqlConnection cnn = GetConnection();
+
+ string cmdText = string.Format("GRANT {0} ON {1} TO {2}", privileges, database, username);
+
+ MySqlCommand cmd = cnn.CreateCommand();
+ cmd.CommandText = cmdText;
+
+ cmd.ExecuteNonQuery();
+ }
+
public static void CreateUser(string username, string password) {
MySqlConnection cnn = GetConnection();
MySqlCommand cmd = cnn.CreateCommand();
cmd.CommandText = "CREATE USER ?User IDENTIFIED BY ?Password";
- cmd.Parameters.Add("User", username);
- cmd.Parameters.Add("Password", password);
+ cmd.Parameters.Add("?User", username);
+ cmd.Parameters.Add("?Password", password);
cmd.ExecuteNonQuery();
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-11-07 12:09:49 UTC (rev 74)
@@ -28,7 +28,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
+ <Reference Include="MySql.Data, Version=1.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\MySql.Data.dll</HintPath>
</Reference>
Modified: NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-11-06 14:05:36 UTC (rev 73)
+++ NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-11-07 12:09:49 UTC (rev 74)
@@ -62,7 +62,7 @@
loadConfiguration();
} else {
- this.relayList.Items.Add("localhost");
+ this.relayList.Items.Add("127.0.0.1");
}
this.makeTablesTask = new Task("Create tables for SMTP spool.", new TaskDelegate(makeSpoolTables));
@@ -128,9 +128,11 @@
SmtpServiceConfiguration.AddToConfigFile();
SpoolFilterServiceConfiguration.AddToConfigFile();
SpoolServiceConfiguration.AddToConfigFile();
-
+ MessageRouterConfiguration.AddToConfigFile();
+
SmtpClientConfiguration scc = SmtpClientConfiguration.Current;
SmtpServiceConfiguration ssc = SmtpServiceConfiguration.Current;
+ MessageRouterConfiguration mrc = MessageRouterConfiguration.Current;
// Ensure the SMTP service is in the list of services
bool foundSmtpService = false;
@@ -152,6 +154,7 @@
bool foundSpoolData = false;
bool foundSpoolService = false;
bool foundSpoolFilter = false;
+ bool foundMessageRouter = false;
for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
if (nc.NamedServiceDetails[i].Name == "SmtpClient") {
@@ -162,6 +165,8 @@
foundSpoolService = true;
} else if (nc.NamedServiceDetails[i].Name == "SpoolFilterService") {
foundSpoolFilter = true;
+ } else if (nc.NamedServiceDetails[i].Name == "MessageRouter") {
+ foundMessageRouter = true;
}
}
@@ -193,14 +198,22 @@
nc.NamedServiceDetails.Add(service);
}
+ if (!foundMessageRouter) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "MessageRouter";
+ service.ObjectType = typeof(MessageRouter.MessageRouter);
+ nc.NamedServiceDetails.Add(service);
+ }
+
// Save the visible host
try {
ssc.VisibleHost = new Host(this.visibleHostTextBox.Text);
+ mrc.VisibleHost = ssc.VisibleHost;
} catch (Exception) {
throw new ArgumentException("Invalid host name: " + this.visibleHostTextBox.Text);
}
- // Save the relay hosts
+ // Save the relay hosts
ssc.RelaySubnets.Clear();
foreach (string host in this.relayList.Items) {
WildcardHostConfigurationElement element = new WildcardHostConfigurationElement();
@@ -208,12 +221,25 @@
ssc.RelaySubnets.Add(element);
}
+ // Set the listen endpoints
+ // TODO: make these configurable
+ ssc.ListenEndPoints.Clear();
+ IPEndPointElement endpoint = new IPEndPointElement();
+ endpoint.Address = System.Net.IPAddress.Any;
+ endpoint.Port = 25;
+ ssc.ListenEndPoints.Add(endpoint);
+
+ // Save message router config
+ mrc.WarningTemplate = "Warning.txt";
+ mrc.BounceTemplate = "Bounce.txt";
+
} else {
// Remove the configuration
SmtpClientConfiguration.RemoveFromConfigFile();
SmtpServiceConfiguration.RemoveFromConfigFile();
SpoolFilterServiceConfiguration.RemoveFromConfigFile();
SpoolServiceConfiguration.RemoveFromConfigFile();
+ MessageRouterConfiguration.RemoveFromConfigFile();
// Ensure the Smtp service is not in the list of services
for (int i = 0; i < nc.ServiceDetails.Count; i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-11-06 14:05:47
|
Revision: 73
http://svn.sourceforge.net/nmailserver/?rev=73&view=rev
Author: tmyroadctfig
Date: 2006-11-06 06:05:36 -0800 (Mon, 06 Nov 2006)
Log Message:
-----------
Work on post install.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj
NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
NMail/branches/luke-dev/NMail.PostInstall/Program.cs
Removed Paths:
-------------
NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs
Deleted: NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs 2006-10-31 12:29:59 UTC (rev 72)
+++ NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs 2006-11-06 14:05:36 UTC (rev 73)
@@ -1,35 +0,0 @@
-/*
- * Copyright 2004-2006 Luke Quinane
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Text;
-using System.Windows.Forms;
-
-using Microsoft.Win32;
-
-using NMail.SmtpService;
-
-namespace NMail.PostInstall {
-
- public class CustomAction {
-
-
- }
-}
Modified: NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj 2006-10-31 12:29:59 UTC (rev 72)
+++ NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj 2006-11-06 14:05:36 UTC (rev 73)
@@ -36,7 +36,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="CustomAction.cs" />
<Compile Include="PostInstallForm.cs">
<SubType>Form</SubType>
</Compile>
Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-10-31 12:29:59 UTC (rev 72)
+++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-11-06 14:05:36 UTC (rev 73)
@@ -21,6 +21,7 @@
using System.Data;
using System.Diagnostics;
using System.Drawing;
+using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@@ -31,10 +32,11 @@
namespace NMail.PostInstall {
public partial class PostInstallForm : Form {
- public PostInstallForm() {
+
+ public PostInstallForm(string[] args) {
InitializeComponent();
- if (NMailInstalled()) {
+ if (args.Length > 1 && args[1].Contains("/u")) {
this.messageLbl.Text = "Performing final uninstall steps.";
ThreadPool.QueueUserWorkItem(new WaitCallback(Uninstall), null);
} else {
@@ -68,92 +70,53 @@
}
private bool NMailInstalled() {
- RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", false);
-
- // Check for the NMail key
- RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, false);
-
- if (nmailKey == null) {
- return false;
- }
-
- // Check for the NMail Server key
- RegistryKey nmailSeverKey = nmailKey.OpenSubKey(NMailServerKey, false);
-
- bool installed = (nmailSeverKey != null);
-
- nmailKey.Close();
- if (nmailSeverKey != null) {
- nmailSeverKey.Close();
- }
-
- return installed;
+ return (GetInstallDirectory() != null);
}
+
+ /// <summary>
+ /// Gets the NMail install directory from the registery.
+ /// </summary>
+ /// <returns>The install location or null if an error occurs.</returns>
+ public string GetInstallDirectory() {
+ string installDirectory = null;
+ RegistryKey nmailServerKey = Registry.LocalMachine.OpenSubKey(@"Software\NMail\NMail Server 1.0", false);
- private void SetupNMailRegistryKeys() {
- RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", true);
+ if (nmailServerKey != null) {
+ installDirectory = nmailServerKey.GetValue("InstallDirectory") as string;
- // Create for the NMail key
- RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, true);
-
- if (nmailKey == null) {
- nmailKey = softwareKey.CreateSubKey(NMailKey);
+ nmailServerKey.Close();
}
- // Create for the NMail Server key
- RegistryKey nmailSeverKey = nmailKey.OpenSubKey(NMailServerKey, false);
-
- if (nmailSeverKey == null) {
- nmailSeverKey = nmailKey.CreateSubKey(NMailServerKey);
- }
-
- nmailKey.Close();
- nmailSeverKey.Close();
+ return installDirectory;
}
- private void DeleteNMailRegistryKeys() {
- RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", true);
-
- // Get the key for the NMail
- RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, true);
-
- if (nmailKey != null) {
- nmailKey.DeleteSubKeyTree(NMailServerKey);
- nmailKey.Close();
- }
-
- // Try to delete the top level key (will fail if other sub-keys are present)
- softwareKey.DeleteSubKey(NMailKey, false);
- }
-
public void Install(object unused) {
try {
DeleteSmtpServiceCounters();
- DeleteNMailRegistryKeys();
-
- SetupNMailRegistryKeys();
-
SetupSmtpServiceCounters();
- Application.Exit();
+ ProcessStartInfo psi = new ProcessStartInfo();
+ psi.WorkingDirectory = GetInstallDirectory();
+ psi.FileName = psi.WorkingDirectory + Path.DirectorySeparatorChar + "NMail.SetupWizard.exe";
+ Process.Start(psi);
} catch (Exception e) {
ShowErrorBox("Error performing install: " + e.Message);
}
+
+ Application.Exit();
}
public void Uninstall(object unused) {
try {
DeleteSmtpServiceCounters();
- DeleteNMailRegistryKeys();
-
- Application.Exit();
-
} catch (Exception e) {
ShowErrorBox("Error performing uninstall: " + e.Message);
}
+
+ Application.Exit();
}
private void ShowErrorBox(object o) {
@@ -170,9 +133,5 @@
protected override void OnClosing(CancelEventArgs e) {
e.Cancel = true;
}
-
- public const string NMailKey = "NMail";
-
- public const string NMailServerKey = "NMail Server 1.0";
}
}
\ No newline at end of file
Modified: NMail/branches/luke-dev/NMail.PostInstall/Program.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-10-31 12:29:59 UTC (rev 72)
+++ NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-11-06 14:05:36 UTC (rev 73)
@@ -25,10 +25,10 @@
/// The main entry point for the application.
/// </summary>
[STAThread]
- static void Main() {
+ static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new PostInstallForm());
+ Application.Run(new PostInstallForm(args));
}
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 12:30:08
|
Revision: 72
http://svn.sourceforge.net/nmailserver/?rev=72&view=rev
Author: tmyroadctfig
Date: 2006-10-31 04:29:59 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Fixed defect in local store SQL script.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-10-31 11:45:40 UTC (rev 71)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-10-31 12:29:59 UTC (rev 72)
@@ -982,7 +982,7 @@
-- -----------------------------------------------------------------------
INSERT INTO Namespace (Name) VALUES ("LocalMail");
-INSERT INTO User (UserName, Password, UserFolderId) VALUES ("Administrator", "changeme", 1);
+INSERT INTO User (UserName, Password, UserFolderId, Disabled, PasswordExpiry) VALUES ("Administrator", "changeme", 1, False, NOW());
INSERT INTO Folder (NamespaceId, Name, OwnerUserId, NextMessageId) VALUES (1, "Administrator", 1, 1);
INSERT INTO Folder (NamespaceId, Name, OwnerUserId, NextMessageId, ParentFolderId) VALUES (1, "Administrator.INBOX", 1, 1, 1);
INSERT INTO FolderAcl (FolderId, Identifier, Allow, Privilege) VALUES (1, "Administrator", 1, 0xffffff); -- All privs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 11:45:52
|
Revision: 71
http://svn.sourceforge.net/nmailserver/?rev=71&view=rev
Author: tmyroadctfig
Date: 2006-10-31 03:45:40 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Improvements to SmtpSubSysConfigPanel.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.Server.Console/NMail.Server.Console.csproj
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
Modified: NMail/branches/luke-dev/NMail.Server.Console/NMail.Server.Console.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.Server.Console/NMail.Server.Console.csproj 2006-10-31 09:28:13 UTC (rev 70)
+++ NMail/branches/luke-dev/NMail.Server.Console/NMail.Server.Console.csproj 2006-10-31 11:45:40 UTC (rev 71)
@@ -171,7 +171,7 @@
<ItemGroup>
<Content Include="oldconfig.xml" />
<None Include="NMail.config">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="NMail.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Modified: NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 09:28:13 UTC (rev 70)
+++ NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 11:45:40 UTC (rev 71)
@@ -261,7 +261,7 @@
return;
}
- if (this.regenDbCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.makeTablesTask)) {
+ if (this.enableLocalStoreSubSysBox.Checked && this.regenDbCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.makeTablesTask)) {
this.BaseForm.Tasks.Add(this.makeTablesTask);
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-10-31 09:28:13 UTC (rev 70)
+++ NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-10-31 11:45:40 UTC (rev 71)
@@ -28,6 +28,7 @@
using NMail.MessageRouter.Configuration;
using NMail.SmtpClient.Configuration;
using NMail.SmtpService.Configuration;
+using NMail.SpoolData.MySql;
using NMail.SpoolFilter.Configuration;
using NMail.SpoolService.Configuration;
@@ -118,6 +119,9 @@
/// Stores the settings into the configuration objects.
/// </summary>
private void storeConfiguration() {
+ NMailConfiguration.AddToConfigFile();
+ NMailConfiguration nc = NMailConfiguration.Current;
+
if (this.enableSmtpSubSysBox.Checked) {
// Ensure our config sections are there
SmtpClientConfiguration.AddToConfigFile();
@@ -128,6 +132,67 @@
SmtpClientConfiguration scc = SmtpClientConfiguration.Current;
SmtpServiceConfiguration ssc = SmtpServiceConfiguration.Current;
+ // Ensure the SMTP service is in the list of services
+ bool foundSmtpService = false;
+
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(SmtpService.SmtpService)) {
+ foundSmtpService = true;
+ }
+ }
+
+ if (!foundSmtpService) {
+ IServiceElement service = new IServiceElement();
+ service.ObjectType = typeof(SmtpService.SmtpService);
+ nc.ServiceDetails.Add(service);
+ }
+
+ // Ensure the local store and localstore data are in the list of named services
+ bool foundSmtpClient = false;
+ bool foundSpoolData = false;
+ bool foundSpoolService = false;
+ bool foundSpoolFilter = false;
+
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "SmtpClient") {
+ foundSmtpClient = true;
+ } else if (nc.NamedServiceDetails[i].Name == "SpoolData") {
+ foundSpoolData = true;
+ } else if (nc.NamedServiceDetails[i].Name == "SpoolService") {
+ foundSpoolService = true;
+ } else if (nc.NamedServiceDetails[i].Name == "SpoolFilterService") {
+ foundSpoolFilter = true;
+ }
+ }
+
+ if (!foundSmtpClient) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "SmtpClient";
+ service.ObjectType = typeof(SmtpClient.SmtpClient);
+ nc.NamedServiceDetails.Add(service);
+ }
+
+ if (!foundSpoolData) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "SpoolData";
+ service.ObjectType = typeof(MySqlSpoolData);
+ nc.NamedServiceDetails.Add(service);
+ }
+
+ if (!foundSpoolService) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "SpoolService";
+ service.ObjectType = typeof(SpoolService.SpoolService);
+ nc.NamedServiceDetails.Add(service);
+ }
+
+ if (!foundSpoolFilter) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "SpoolFilterService";
+ service.ObjectType = typeof(SpoolFilter.SpoolFilter);
+ nc.NamedServiceDetails.Add(service);
+ }
+
// Save the visible host
try {
ssc.VisibleHost = new Host(this.visibleHostTextBox.Text);
@@ -149,6 +214,40 @@
SmtpServiceConfiguration.RemoveFromConfigFile();
SpoolFilterServiceConfiguration.RemoveFromConfigFile();
SpoolServiceConfiguration.RemoveFromConfigFile();
+
+ // Ensure the Smtp service is not in the list of services
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(SmtpService.SmtpService)) {
+ nc.ServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+
+ // Ensure the SmtpClient, SpoolData, SpoolFilterService, SpoolService services are not in the list of named services
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "SmtpClient") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "SpoolData") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "SpoolService") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "SpoolFilterService") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
}
}
@@ -202,7 +301,7 @@
return;
}
- if (this.regenDbCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.makeTablesTask)) {
+ if (this.enableSmtpSubSysBox.Checked && this.regenDbCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.makeTablesTask)) {
this.BaseForm.Tasks.Add(this.makeTablesTask);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 09:28:25
|
Revision: 70
http://svn.sourceforge.net/nmailserver/?rev=70&view=rev
Author: tmyroadctfig
Date: 2006-10-31 01:28:13 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Added files to ignore lists.
Added Paths:
-----------
NMail/branches/luke-dev/NMail.Administration.Web/Bin/NMail.LocalStoreData.MySql.dll.refresh
Property Changed:
----------------
NMail/branches/luke-dev/NMail.Administration.Web/Bin/
NMail/branches/luke-dev/NMail.OutlookPlugin/
Property changes on: NMail/branches/luke-dev/NMail.Administration.Web/Bin
___________________________________________________________________
Name: svn:ignore
- log4net.dll
NMail.dll
NMail.Server.dll
+ log4net.dll
NMail.dll
NMail.Server.dll
NMail.LocalStoreData.MySql.dll
Added: NMail/branches/luke-dev/NMail.Administration.Web/Bin/NMail.LocalStoreData.MySql.dll.refresh
===================================================================
(Binary files differ)
Property changes on: NMail/branches/luke-dev/NMail.Administration.Web/Bin/NMail.LocalStoreData.MySql.dll.refresh
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Property changes on: NMail/branches/luke-dev/NMail.OutlookPlugin
___________________________________________________________________
Name: svn:ignore
+ obj
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 09:26:23
|
Revision: 69
http://svn.sourceforge.net/nmailserver/?rev=69&view=rev
Author: tmyroadctfig
Date: 2006-10-31 01:26:12 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Changed FinalConfigPanel to allow errors to be viewed. Improvements to LocalStoreConfigPanel.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
Modified: NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -85,6 +85,23 @@
return base.ConvertFrom(context, culture, value);
}
+
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
+ if (destinationType == typeof(string)) {
+ return true;
+ }
+
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
+ if (destinationType == typeof(string)) {
+ Type t = (Type) value;
+
+ return string.Format("{0}, {1}", t.FullName, t.Assembly.GetName().Name);
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
}
-
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -24,11 +24,10 @@
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
- this.taskListView = new System.Windows.Forms.ListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.descriptionTextBox = new System.Windows.Forms.TextBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ this.taskTreeView = new System.Windows.Forms.TreeView();
this.mainPanel.SuspendLayout();
this.SuspendLayout();
//
@@ -40,24 +39,8 @@
// mainPanel
//
this.mainPanel.Controls.Add(this.descriptionTextBox);
- this.mainPanel.Controls.Add(this.taskListView);
+ this.mainPanel.Controls.Add(this.taskTreeView);
//
- // taskListView
- //
- this.taskListView.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.taskListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1});
- this.taskListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.taskListView.Location = new System.Drawing.Point(65, 63);
- this.taskListView.MultiSelect = false;
- this.taskListView.Name = "taskListView";
- this.taskListView.Size = new System.Drawing.Size(232, 211);
- this.taskListView.SmallImageList = this.imageList;
- this.taskListView.TabIndex = 0;
- this.taskListView.UseCompatibleStateImageBehavior = false;
- this.taskListView.View = System.Windows.Forms.View.Details;
- this.taskListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.taskListView_MouseDoubleClick);
- //
// imageList
//
this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
@@ -78,6 +61,18 @@
this.descriptionTextBox.Text = "The NMail setup is almost complete. Below are a list of actions that will be perf" +
"ormed, click \"Next\" to continue.";
//
+ // taskTreeView
+ //
+ this.taskTreeView.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.taskTreeView.ImageIndex = 0;
+ this.taskTreeView.ImageList = this.imageList;
+ this.taskTreeView.Location = new System.Drawing.Point(65, 63);
+ this.taskTreeView.Name = "taskTreeView";
+ this.taskTreeView.SelectedImageIndex = 0;
+ this.taskTreeView.ShowRootLines = false;
+ this.taskTreeView.Size = new System.Drawing.Size(232, 211);
+ this.taskTreeView.TabIndex = 3;
+ //
// FinalConfigPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -91,11 +86,10 @@
#endregion
- private System.Windows.Forms.ListView taskListView;
private System.Windows.Forms.TextBox descriptionTextBox;
private System.Windows.Forms.ImageList imageList;
- private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ToolTip toolTip;
+ private System.Windows.Forms.TreeView taskTreeView;
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -35,22 +35,20 @@
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.ok);
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.warning);
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.error);
-
- this.taskListView.Columns[0].Width = this.taskListView.Width;
}
- private Dictionary<Task, ListViewItem> taskMap = new Dictionary<Task, ListViewItem>();
+ private Dictionary<Task, TreeNode> taskMap = new Dictionary<Task, TreeNode>();
protected override void OnPanelDisplayed() {
this.taskMap.Clear();
- this.taskListView.Items.Clear();
+ this.taskTreeView.Nodes.Clear();
// Re-populate the task list
foreach (Task task in this.BaseForm.Tasks) {
- ListViewItem item = new ListViewItem(task.Description, 0);
- item.Tag = task;
- this.taskMap.Add(task, item);
- this.taskListView.Items.Add(item);
+ TreeNode node = new TreeNode(task.Description, 0, 0);
+ node.Tag = task;
+ this.taskMap.Add(task, node);
+ this.taskTreeView.Nodes.Add(node);
}
}
@@ -91,16 +89,21 @@
delegate void updateTaskDelegate(Task task, TaskResult result, string message);
public void updateTask(Task task, TaskResult result, string message) {
- ListViewItem item = this.taskMap[task];
+ TreeNode node = this.taskMap[task];
if (result == TaskResult.Error) {
- item.ImageIndex = 3;
- item.ToolTipText = message;
+ node.ImageIndex = 3;
+ node.SelectedImageIndex = 3;
+ node.Nodes.Add(message);
+ node.Expand();
} else if (result == TaskResult.Warning) {
- item.ImageIndex = 2;
- item.ToolTipText = message;
+ node.ImageIndex = 2;
+ node.SelectedImageIndex = 2;
+ node.Nodes.Add(message);
+ node.Expand();
} else {
- item.ImageIndex = 1;
+ node.ImageIndex = 1;
+ node.SelectedImageIndex = 1;
}
}
@@ -110,13 +113,5 @@
this.backButton.Enabled = false;
this.cancelButton.Enabled = false;
}
-
- private void taskListView_MouseDoubleClick(object sender, MouseEventArgs e) {
- ListViewItem item = this.taskListView.GetItemAt(e.X, e.Y);
-
- if (item != null && item.ImageIndex != 1) {
- MessageBox.Show(item.ToolTipText);
- }
- }
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -28,6 +28,7 @@
using NMail.DataTypes;
using NMail.Helper;
using NMail.ImapService.Configuration;
+using NMail.LocalStoreData.MySql;
using NMail.LocalStoreData.MySql.Configuration;
namespace NMail.SetupWizard {
@@ -113,6 +114,9 @@
/// Stores the settings into the configuration objects.
/// </summary>
private void storeConfiguration() {
+ NMailConfiguration.AddToConfigFile();
+ NMailConfiguration nc = NMailConfiguration.Current;
+
if (this.enableLocalStoreSubSysBox.Checked) {
// Ensure our config sections are there
ImapServiceConfiguration.AddToConfigFile();
@@ -121,6 +125,47 @@
ImapServiceConfiguration isc = ImapServiceConfiguration.Current;
MySqlLocalStoreDataConfiguration mlsdc = MySqlLocalStoreDataConfiguration.Current;
+ // Ensure the IMAP service is in the list of services
+ bool foundImapService = false;
+
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(ImapService.ImapService)) {
+ foundImapService = true;
+ }
+ }
+
+ if (!foundImapService) {
+ IServiceElement service = new IServiceElement();
+ service.ObjectType = typeof(ImapService.ImapService);
+ nc.ServiceDetails.Add(service);
+ }
+
+ // Ensure the local store and localstore data are in the list of named services
+ bool foundLocalStore = false;
+ bool foundLocalStoreData = false;
+
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStore") {
+ foundLocalStore = true;
+ } else if (nc.NamedServiceDetails[i].Name == "LocalStoreData") {
+ foundLocalStoreData = true;
+ }
+ }
+
+ if (!foundLocalStore) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "LocalStore";
+ service.ObjectType = typeof(LocalStore.LocalStore);
+ nc.NamedServiceDetails.Add(service);
+ }
+
+ if (!foundLocalStoreData) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "LocalStoreData";
+ service.ObjectType = typeof(MySqlLocalStoreData);
+ nc.NamedServiceDetails.Add(service);
+ }
+
// Save the visible host
try {
isc.VisibleHost = new Host(this.visibleHostTextBox.Text);
@@ -143,6 +188,28 @@
// Remove the configuration
ImapServiceConfiguration.RemoveFromConfigFile();
MySqlLocalStoreDataConfiguration.RemoveFromConfigFile();
+
+ // Ensure the IMAP service is not in the list of services
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(ImapService.ImapService)) {
+ nc.ServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+
+ // Ensure the LocalStore and LocalStoreData services are removed
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStore") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStoreData") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 09:24:57
|
Revision: 68
http://svn.sourceforge.net/nmailserver/?rev=68&view=rev
Author: tmyroadctfig
Date: 2006-10-31 01:24:33 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Added a project for an Outlook plugin. Other project file changes.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
NMail/branches/luke-dev/NMail.Server.Console/NMail.config
NMail/branches/luke-dev/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj
Added Paths:
-----------
NMail/branches/luke-dev/NMail/Authentication/ILockOutPolicy.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlHelper.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs
NMail/branches/luke-dev/NMail.OutlookPlugin/
NMail/branches/luke-dev/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj
NMail/branches/luke-dev/NMail.OutlookPlugin/Properties/
NMail/branches/luke-dev/NMail.OutlookPlugin/Properties/AssemblyInfo.cs
Added: NMail/branches/luke-dev/NMail/Authentication/ILockOutPolicy.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/ILockOutPolicy.cs (rev 0)
+++ NMail/branches/luke-dev/NMail/Authentication/ILockOutPolicy.cs 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,8 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NMail.Authentication {
+ public interface ILockOutPolicy {
+ }
+}
Added: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlAuthProvider.cs 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2004-2006 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using System.Text;
+
+using Mono.Security.Protocol.Ntlm;
+using MySql.Data.MySqlClient;
+
+using NMail.Authentication;
+using NMail.Configuration;
+using NMail.LocalStoreData.MySql.Configuration;
+
+// TODO: account lockout if too many bad attempts
+
+namespace NMail.LocalStoreData.MySql {
+ public class MySqlAuthProvider : MarshalByRefObject, IHashAuthProvider {
+
+ /// <summary>
+ /// A map of username to tokens.
+ /// </summary>
+ Dictionary<string, Dictionary<Guid, BasicAuthToken>> currentTokens = new Dictionary<string, Dictionary<Guid, BasicAuthToken>>();
+
+ private void purgeExpiredTokens() {
+ // TODO: implement!!!
+ }
+
+ private void addToCurrentTokens(BasicAuthToken authToken) {
+ // Ensure the user has a token dictionary
+ if (!this.currentTokens.ContainsKey(authToken.Username)) {
+ this.currentTokens.Add(authToken.Username, new Dictionary<Guid, BasicAuthToken>());
+ }
+
+ this.currentTokens[authToken.Username].Add(authToken.TokenId, authToken);
+
+ purgeExpiredTokens();
+ }
+
+ private IAuthenticationToken createValidatedToken(string username, bool disabled, DateTime passwordExpiry) {
+ // TODO: lockout check
+
+ // Check if the password is correct and the account is not disabled, etc
+ if (!disabled) {
+ DateTime expiry = (DateTime.Now + DefaultTokenExpiry > passwordExpiry)
+ ? DateTime.Now + DefaultTokenExpiry
+ : passwordExpiry;
+
+ BasicAuthToken token = new BasicAuthToken(username, passwordExpiry, expiry);
+ addToCurrentTokens(token);
+ return token;
+ }
+
+ return null;
+ }
+
+ #region IAuthenticationProvider
+
+ public DateTime GetTokenExpiry(IAuthenticationToken user) {
+ // Only basic tokens are valid
+ BasicAuthToken authToken = user as BasicAuthToken;
+
+ if (authToken != null && this.currentTokens.ContainsKey(authToken.Username)) {
+ Dictionary<Guid, BasicAuthToken> userTokens = this.currentTokens[authToken.Username];
+
+ if (userTokens.ContainsKey(authToken.TokenId)) {
+ // Don't trust the passed in expiry - we don't know where it has been!
+ return userTokens[authToken.TokenId].CredentialsExpiry;
+ }
+ }
+
+ // Invalid token
+ return DateTime.MinValue;
+ }
+
+ public bool TokenExpired(IAuthenticationToken user) {
+ return (GetTokenExpiry(user) > DateTime.Now);
+ }
+
+ public bool ValidToken(IAuthenticationToken user) {
+ // This also checks if the token is valid as well as not expired
+ return !TokenExpired(user);
+ }
+
+ public bool IsLockedOut(IAuthenticationToken user) {
+ // TODO: fix this!
+ return false;
+ }
+
+ public bool IsEnabled(IAuthenticationToken user) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "SELECT Disabled FROM `User` WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", user.Username);
+ object o = cmd.ExecuteNonQuery();
+
+ bool disabled = true;
+
+ if (o is bool) {
+ disabled = (bool) o;
+ }
+
+ return (!disabled);
+ }
+ }
+ }
+
+ public bool ChangePassword(IAuthenticationToken user, string newPassword) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "UPDATE `User` SET Password = ?Password WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", user.Username);
+ cmd.Parameters.Add("Password", newPassword);
+ int count = cmd.ExecuteNonQuery();
+
+ return (count == 1);
+ }
+ }
+ }
+
+ public void ResetLockOut(string username) {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void SetEnabled(string username, bool enabled) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "UPDATE `User` SET Disabled = ?Disabled WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", username);
+ cmd.Parameters.Add("Disabled", !enabled);
+ int count = cmd.ExecuteNonQuery();
+ }
+ }
+ }
+
+ public IAuthenticationToken Authenticate(string username, string password) {
+ // Get the hash stored in the database.
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "SELECT Disabled, LockedOutData, PasswordExpiry, Password FROM User WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", username);
+ MySqlDataReader reader = cmd.ExecuteReader();
+
+ if (reader.Read()) {
+ string dbHash = reader["Password"] as string;
+ bool disabled = (bool) reader["Disabled"];
+ DateTime passwordExpiry = (DateTime) reader["PasswordExpiry"];
+
+ return createValidatedToken(username, disabled, passwordExpiry);
+ }
+ }
+ }
+
+ // Hashes do not match or no such user
+ return null;
+ }
+
+ public IAuthenticationToken CreateAuthToken(string username) {
+ // Get the hash stored in the database.
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "SELECT COUNT(*) FROM User WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", username);
+ long count = (long) cmd.ExecuteScalar();
+
+ if (count == 1) {
+ return createValidatedToken(username, false, DateTime.MaxValue);
+ }
+ }
+ }
+
+ // No such user
+ return null;
+ }
+ #endregion
+
+ #region IHashAuthProvider Members
+
+ public IAuthenticationToken Authenticate(string username, string hash, HashAuthType authType) {
+ if ((authType & HashAuthType.Ntlm) == HashAuthType.Ntlm) {
+ // Get the hash stored in the database.
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "SELECT Disabled, LockedOutData, PasswordExpiry, Password FROM User WHERE Username = ?Username";
+ cmd.Parameters.Add("Username", username);
+ MySqlDataReader reader = cmd.ExecuteReader();
+
+ if (reader.Read()) {
+ string dbPassword = reader["Password"] as string;
+ bool disabled = (bool) reader["Disabled"];
+ DateTime passwordExpiry = (DateTime) reader["PasswordExpiry"];
+
+ // Generate a NTLM hash
+ Type3Message type3Msg = new Type3Message();
+ type3Msg.Password = dbPassword;
+ string dbHash = Convert.ToBase64String(type3Msg.NT);
+
+ if (dbHash == hash) {
+ // Hashes match, return a valid token
+ return createValidatedToken(username, disabled, passwordExpiry);
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public HashAuthType HashAuthType {
+ get { return HashAuthType.Ntlm; }
+ }
+
+ #endregion
+
+ public static readonly TimeSpan DefaultTokenExpiry = TimeSpan.FromMinutes(30);
+ }
+}
Added: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlHelper.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlHelper.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlHelper.cs 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using MySql.Data.MySqlClient;
+
+using NMail.LocalStoreData.MySql.Configuration;
+
+namespace NMail.LocalStoreData.MySql {
+ internal static class MySqlHelper {
+ internal static MySqlConnection GetConnection() {
+ MySqlConnection cnn = new MySqlConnection(MySqlLocalStoreDataConfiguration.Current.ConnectionString);
+ cnn.Open();
+ return cnn;
+ }
+ }
+}
Added: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlUserMap.cs 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2004-2006 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using MySql.Data.MySqlClient;
+
+using NMail.Configuration;
+using NMail.DataTypes;
+using NMail.DataTypes.LocalStore;
+
+namespace NMail.LocalStoreData.MySql {
+ [Serializable]
+ public class MySqlUserMap : ILocalStoreUserMap {
+
+ protected ILocalStoreData LocalStoreData {
+ get {
+ return NMailConfiguration.Current.LocalStoreData;
+ }
+ }
+
+ #region ILocalStoreUserMap Members
+ /// <summary>
+ /// Maps the given mailbox to a user.
+ /// </summary>
+ /// <param name="mailbox">The mailbox to map.</param>
+ /// <returns>The user or null.</returns>
+ public LocalStoreUser MapMailboxToUser(string mailbox) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ // First check if the username matches the mailbox
+ cmd.CommandText = "SELECT u.UserId FROM User u WHERE u.Username LIKE ?Mailbox";
+ cmd.Parameters.Add("Mailbox", mailbox);
+ object o = cmd.ExecuteScalar();
+
+ if (o is int) {
+ return this.LocalStoreData.GetUser((int) o);
+ }
+
+ // Next check if the mailbox maps to a user
+ cmd.CommandText = "SELECT u.UserId FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND m.Mailbox LIKE ?Mailbox";
+ cmd.Parameters.Add("Mailbox", mailbox);
+ o = cmd.ExecuteScalar();
+
+ if (o is int) {
+ return this.LocalStoreData.GetUser((int) o);
+ }
+
+ // No such mailbox
+ return null;
+ }
+ }
+ }
+
+ public Mailbox[] GetUserMailboxes(string username) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
+ using (MySqlCommand cmd = cnn.CreateCommand()) {
+ cmd.CommandText = "SELECT m.Mailbox FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND u.Username LIKE ?Username";
+ cmd.Parameters.Add("Username", username);
+
+ using (MySqlDataReader reader = cmd.ExecuteReader()) {
+ List<Mailbox> mailboxes = new List<Mailbox>();
+
+ while (reader.Read()) {
+ string mailboxName = (string) reader["Mailbox"];
+ mailboxes.Add(new Mailbox(mailboxName));
+ }
+
+ return mailboxes.ToArray();
+ }
+ }
+ }
+ }
+
+ public void AddUserMailbox(string username, Mailbox mailbox) {
+ throw new NotImplementedException();
+ }
+
+ public void RemoveUserMailbox(string username, Mailbox mailbox) {
+ throw new NotImplementedException();
+ }
+ #endregion
+ }
+}
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-10-31 09:22:41 UTC (rev 67)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-10-31 09:24:33 UTC (rev 68)
@@ -111,7 +111,9 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="MySqlUserMap.cs" />
- <Content Include="MySqlLocalStore.sql" />
+ <Content Include="MySqlLocalStore.sql">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="NMail.LocalStoreData.Mysql.build" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Added: NMail/branches/luke-dev/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj (rev 0)
+++ NMail/branches/luke-dev/NMail.OutlookPlugin/NMail.OutlookPlugin.csproj 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,65 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9080FAD0-0BD8-4CA2-A645-9F2198C38CFE}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>NMail.OutlookPlugin</RootNamespace>
+ <AssemblyName>NMail.OutlookPlugin</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\References\NMail\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\References\NMail\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Class1.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Microsoft.Office.Core">
+ <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
+ <VersionMajor>2</VersionMajor>
+ <VersionMinor>3</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>primary</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ <COMReference Include="Outlook">
+ <Guid>{00062FFF-0000-0000-C000-000000000046}</Guid>
+ <VersionMajor>9</VersionMajor>
+ <VersionMinor>2</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>primary</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: NMail/branches/luke-dev/NMail.OutlookPlugin/Properties/AssemblyInfo.cs
===================================================================
--- NMail/branches/luke-dev/NMail.OutlookPlugin/Properties/AssemblyInfo.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.OutlookPlugin/Properties/AssemblyInfo.cs 2006-10-31 09:24:33 UTC (rev 68)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("NMail.OutlookPlugin")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NMail.OutlookPlugin")]
+[assembly: AssemblyCopyright("Copyright © 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6ec6c56a-8925-4e4e-9f93-e07309b0e646")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Modified: NMail/branches/luke-dev/NMail.Server.Console/NMail.config
===================================================================
--- NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-10-31 09:22:41 UTC (rev 67)
+++ NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-10-31 09:24:33 UTC (rev 68)
@@ -10,7 +10,6 @@
<section name="NMail.SpoolFilterService" type="NMail.SpoolFilter.Configuration.SpoolFilterServiceConfiguration, NMail.SpoolFilter" />
<section name="NMail.SpoolData.MySql" type="NMail.SpoolData.MySql.Configuration.MySqlSpoolDataConfiguration, NMail.SpoolData.MySql" />
<section name="NMail.MessageRouter" type="NMail.MessageRouter.Configuration.MessageRouterConfiguration, NMail.MessageRouter" />
- <section name="NMail.LocalStore" type="NMail.LocalStore.Configuration.LocalStoreConfiguration, NMail.LocalStore" />
<section name="NMail.LocalStoreData.MySql" type="NMail.LocalStoreData.MySql.Configuration.MySqlLocalStoreDataConfiguration, NMail.LocalStoreData.MySql" />
</configSections>
Modified: NMail/branches/luke-dev/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj 2006-10-31 09:22:41 UTC (rev 67)
+++ NMail/branches/luke-dev/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj 2006-10-31 09:24:33 UTC (rev 68)
@@ -108,7 +108,9 @@
<Compile Include="MySqlSpoolData.cs">
<SubType>Code</SubType>
</Compile>
- <Content Include="MySqlSpoolData.sql" />
+ <Content Include="MySqlSpoolData.sql">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="NMail.SpoolData.MySql.build" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-31 09:22:55
|
Revision: 67
http://svn.sourceforge.net/nmailserver/?rev=67&view=rev
Author: tmyroadctfig
Date: 2006-10-31 01:22:41 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Work on installer and post install program.
Modified Paths:
--------------
NMail/branches/luke-dev/Installer/NMail-installer.build
NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj
NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs
NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
Added Paths:
-----------
NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs
Property Changed:
----------------
NMail/branches/luke-dev/NMail.PostInstall/
Modified: NMail/branches/luke-dev/Installer/NMail-installer.build
===================================================================
--- NMail/branches/luke-dev/Installer/NMail-installer.build 2006-10-24 12:21:38 UTC (rev 66)
+++ NMail/branches/luke-dev/Installer/NMail-installer.build 2006-10-31 09:22:41 UTC (rev 67)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<project name="nant" default="package">
<!-- default configuration -->
- <property name="project.config" value="Debug" />
+ <property name="project.config" value="Release" />
<property name="current.build.defines" value="" />
<target name="Debug" description="Packages up a 'debug' build into an installer">
@@ -72,6 +72,7 @@
<!-- Compile the installer package -->
<exec program="candle" verbose="true">
+ <arg value="-nologo" />
<arg value="-out" />
<arg>
<path>
@@ -84,6 +85,7 @@
<!-- Link the installer package -->
<exec program="light">
<!-- TODO: add a date and revision number into the installer name -->
+ <arg value="-nologo" />
<arg value="-out" />
<arg><path><pathelement file="${output.dir}/NMail-${project.config}-${build.date}.msi" /></path></arg>
Property changes on: NMail/branches/luke-dev/NMail.PostInstall
___________________________________________________________________
Name: svn:ignore
- obj
bin
+ obj
bin
NMail.PostInstall.csproj.user
Added: NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.PostInstall/CustomAction.cs 2006-10-31 09:22:41 UTC (rev 67)
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004-2006 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Text;
+using System.Windows.Forms;
+
+using Microsoft.Win32;
+
+using NMail.SmtpService;
+
+namespace NMail.PostInstall {
+
+ public class CustomAction {
+
+
+ }
+}
Modified: NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj 2006-10-24 12:21:38 UTC (rev 66)
+++ NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj 2006-10-31 09:22:41 UTC (rev 67)
@@ -36,6 +36,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="CustomAction.cs" />
<Compile Include="PostInstallForm.cs">
<SubType>Form</SubType>
</Compile>
Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs 2006-10-24 12:21:38 UTC (rev 66)
+++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs 2006-10-31 09:22:41 UTC (rev 67)
@@ -23,25 +23,25 @@
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
- this.label1 = new System.Windows.Forms.Label();
+ this.messageLbl = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
- this.label1.AutoSize = true;
- this.label1.Dock = System.Windows.Forms.DockStyle.Top;
- this.label1.Location = new System.Drawing.Point(0, 0);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(141, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "Performing post install setup.";
+ this.messageLbl.AutoSize = true;
+ this.messageLbl.Dock = System.Windows.Forms.DockStyle.Top;
+ this.messageLbl.Location = new System.Drawing.Point(0, 0);
+ this.messageLbl.Name = "label1";
+ this.messageLbl.Size = new System.Drawing.Size(141, 13);
+ this.messageLbl.TabIndex = 0;
+ this.messageLbl.Text = "Performing post install setup.";
//
// PostInstallForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(251, 17);
- this.Controls.Add(this.label1);
+ this.Controls.Add(this.messageLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
@@ -55,7 +55,7 @@
#endregion
- private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label messageLbl;
}
}
Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-10-24 12:21:38 UTC (rev 66)
+++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-10-31 09:22:41 UTC (rev 67)
@@ -25,6 +25,8 @@
using System.Threading;
using System.Windows.Forms;
+using Microsoft.Win32;
+
using NMail.SmtpService;
namespace NMail.PostInstall {
@@ -32,15 +34,22 @@
public PostInstallForm() {
InitializeComponent();
- ThreadPool.QueueUserWorkItem(new WaitCallback(SetupSmtpServiceCounters), null);
+ if (NMailInstalled()) {
+ this.messageLbl.Text = "Performing final uninstall steps.";
+ ThreadPool.QueueUserWorkItem(new WaitCallback(Uninstall), null);
+ } else {
+ ThreadPool.QueueUserWorkItem(new WaitCallback(Install), null);
+ }
}
- private void SetupSmtpServiceCounters(object unused) {
+ private void DeleteSmtpServiceCounters() {
if (PerformanceCounterCategory.Exists(SmtpService.SmtpService.PerfCounterCategory)) {
// Remove any old performance counters if they are present
PerformanceCounterCategory.Delete(SmtpService.SmtpService.PerfCounterCategory);
}
+ }
+ private void SetupSmtpServiceCounters() {
CounterCreationDataCollection ccdc = new CounterCreationDataCollection();
// Number of connections received
@@ -56,12 +65,114 @@
"Performance counters for NMail's SMTP service.",
PerformanceCounterCategoryType.SingleInstance,
ccdc);
+ }
- Application.Exit();
+ private bool NMailInstalled() {
+ RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", false);
+
+ // Check for the NMail key
+ RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, false);
+
+ if (nmailKey == null) {
+ return false;
+ }
+
+ // Check for the NMail Server key
+ RegistryKey nmailSeverKey = nmailKey.OpenSubKey(NMailServerKey, false);
+
+ bool installed = (nmailSeverKey != null);
+
+ nmailKey.Close();
+ if (nmailSeverKey != null) {
+ nmailSeverKey.Close();
+ }
+
+ return installed;
}
+ private void SetupNMailRegistryKeys() {
+ RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", true);
+
+ // Create for the NMail key
+ RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, true);
+
+ if (nmailKey == null) {
+ nmailKey = softwareKey.CreateSubKey(NMailKey);
+ }
+
+ // Create for the NMail Server key
+ RegistryKey nmailSeverKey = nmailKey.OpenSubKey(NMailServerKey, false);
+
+ if (nmailSeverKey == null) {
+ nmailSeverKey = nmailKey.CreateSubKey(NMailServerKey);
+ }
+
+ nmailKey.Close();
+ nmailSeverKey.Close();
+ }
+
+ private void DeleteNMailRegistryKeys() {
+ RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", true);
+
+ // Get the key for the NMail
+ RegistryKey nmailKey = softwareKey.OpenSubKey(NMailKey, true);
+
+ if (nmailKey != null) {
+ nmailKey.DeleteSubKeyTree(NMailServerKey);
+ nmailKey.Close();
+ }
+
+ // Try to delete the top level key (will fail if other sub-keys are present)
+ softwareKey.DeleteSubKey(NMailKey, false);
+ }
+
+ public void Install(object unused) {
+ try {
+ DeleteSmtpServiceCounters();
+
+ DeleteNMailRegistryKeys();
+
+ SetupNMailRegistryKeys();
+
+ SetupSmtpServiceCounters();
+
+ Application.Exit();
+
+ } catch (Exception e) {
+ ShowErrorBox("Error performing install: " + e.Message);
+ }
+ }
+
+ public void Uninstall(object unused) {
+ try {
+ DeleteSmtpServiceCounters();
+
+ DeleteNMailRegistryKeys();
+
+ Application.Exit();
+
+ } catch (Exception e) {
+ ShowErrorBox("Error performing uninstall: " + e.Message);
+ }
+ }
+
+ private void ShowErrorBox(object o) {
+ if (this.InvokeRequired) {
+ object[] args = { o };
+ this.Invoke(new WaitCallback(ShowErrorBox), args);
+ return;
+ }
+
+ string message = o as string;
+ MessageBox.Show(null, message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+
protected override void OnClosing(CancelEventArgs e) {
e.Cancel = true;
}
+
+ public const string NMailKey = "NMail";
+
+ public const string NMailServerKey = "NMail Server 1.0";
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-24 12:22:10
|
Revision: 66
http://svn.sourceforge.net/nmailserver/?rev=66&view=rev
Author: tmyroadctfig
Date: 2006-10-24 05:21:38 -0700 (Tue, 24 Oct 2006)
Log Message:
-----------
Work on authentication and mail domain management.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs
NMail/branches/luke-dev/NMail/Authentication/IAuthenticationProvider.cs
NMail/branches/luke-dev/NMail/Authentication/IAuthenticationToken.cs
NMail/branches/luke-dev/NMail/Authentication/NullAuthentication.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/MailDomain.cs
NMail/branches/luke-dev/NMail/NMail.csproj
NMail/branches/luke-dev/NMail.Administration.Web/CreateMailDomain.aspx.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
NMail/branches/luke-dev/NMail.Server.Console/NMail.config
Modified: NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/Authentication/BasicAuthToken.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -28,9 +28,12 @@
/// </summary>
/// <param name="username">The username associated with then authentication token.</param>
/// <param name="credentialsExpiry">The date and time that the user's credentials expire.</param>
- public BasicAuthToken(string username, DateTime credentialsExpiry) {
+ /// <param name="credentialsExpiry">The date and time that the token will expire.</param>
+ public BasicAuthToken(string username, DateTime credentialsExpiry, DateTime tokenExpiry) {
this.username = username;
this.credentialsExpiry = credentialsExpiry;
+ this.tokenExpiry = tokenExpiry;
+ this.tokenId = new Guid();
}
private Guid tokenId;
@@ -63,6 +66,12 @@
return this.credentialsExpiry;
}
}
+
+ private DateTime tokenExpiry;
+
+ public DateTime TokenExpiry {
+ get { return tokenExpiry; }
+ }
#endregion
}
}
Modified: NMail/branches/luke-dev/NMail/Authentication/IAuthenticationProvider.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/IAuthenticationProvider.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/Authentication/IAuthenticationProvider.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -67,20 +67,39 @@
bool ValidToken(IAuthenticationToken user);
/// <summary>
- /// Checks if the user's account is currently locked out.
+ /// Checks if the user's account is currently locked out. This situation
+ /// is triggered when the user attempts too many incorrect logins.
/// </summary>
/// <param name="user">The user to check.</param>
/// <returns>True if their account is locked out.</returns>
bool IsLockedOut(IAuthenticationToken user);
/// <summary>
+ /// Resets a locked out account restoring access.
+ /// </summary>
+ /// <param name="username">The username for the account to reset.</param>
+ void ResetLockOut(string username);
+
+ /// <summary>
+ /// Checks if the user's account is enabled.
+ /// </summary>
+ /// <param name="user">The user to check.</param>
+ /// <returns>True if their account is enabled.</returns>
+ bool IsEnabled(IAuthenticationToken user);
+
+ /// <summary>
+ /// Sets whether an account is enabled.
+ /// </summary>
+ /// <param name="username">The username to alter.</param>
+ /// <param name="enabled">True if the account is enabled, false for disabled.</param>
+ void SetEnabled(string username, bool enabled);
+
+ /// <summary>
/// Changes the user's password.
/// </summary>
/// <param name="user">The user to change the password for.</param>
/// <param name="newPassword">The new password.</param>
/// <returns>True on success, false otherwise.</returns>
bool ChangePassword(IAuthenticationToken user, string newPassword);
-
- // TODO: reset password & others
}
}
Modified: NMail/branches/luke-dev/NMail/Authentication/IAuthenticationToken.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/IAuthenticationToken.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/Authentication/IAuthenticationToken.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -32,5 +32,10 @@
/// password expires and needs changing.
/// </summary>
DateTime CredentialsExpiry { get; }
+
+ /// <summary>
+ /// Gets the date and time that this token will expire.
+ /// </summary>
+ DateTime TokenExpiry { get; }
}
}
Modified: NMail/branches/luke-dev/NMail/Authentication/NullAuthentication.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Authentication/NullAuthentication.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/Authentication/NullAuthentication.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -28,11 +28,11 @@
#region IAuthenticationProvider Members
public IAuthenticationToken Authenticate(string username, string password) {
- return new BasicAuthToken(username, DateTime.MaxValue);
+ return new BasicAuthToken(username, DateTime.MaxValue, DateTime.MaxValue);
}
public IAuthenticationToken CreateAuthToken(string username) {
- return new BasicAuthToken(username, DateTime.MaxValue);
+ return new BasicAuthToken(username, DateTime.MaxValue, DateTime.MaxValue);
}
public DateTime GetTokenExpiry(IAuthenticationToken user) {
@@ -54,6 +54,14 @@
public bool ChangePassword(IAuthenticationToken user, string newPassword) {
return true;
}
+
+ public void ResetLockOut(string username) { }
+
+ public void SetEnabled(string username, bool enabled) { }
+
+ public bool IsEnabled(IAuthenticationToken user) {
+ return true;
+ }
#endregion
}
}
Modified: NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs
===================================================================
--- NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -412,22 +412,6 @@
/// <returns>The user's email addresses.</returns>
EmailAddress[] GetUserAddresses(IAuthenticationToken authToken, int userId);
- ///// <summary>
- ///// Adds the given address the to list of addresses for the user.
- ///// </summary>
- ///// <param name="authToken">The authentication credentials.</param>
- ///// <param name="userId">The Id of the user to add the address for.</param>
- ///// <param name="address">The address to add.</param>
- //void AddUserAddress(IAuthenticationToken authToken, int userId, EmailAddress address);
-
- ///// <summary>
- ///// Removes the given address from the list of addresses for the user.
- ///// </summary>
- ///// <param name="authToken">The authentication credentials.</param>
- ///// <param name="userId">The Id of the user to remove the address from.</param>
- ///// <param name="address">The address to remove.</param>
- //void RemoveUserAddress(IAuthenticationToken authToken, int userId, EmailAddress address);
-
/// <summary>
/// Gets a list of folder that belong to the user with the given user Id.
/// </summary>
Modified: NMail/branches/luke-dev/NMail/DataTypes/LocalStore/MailDomain.cs
===================================================================
--- NMail/branches/luke-dev/NMail/DataTypes/LocalStore/MailDomain.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/DataTypes/LocalStore/MailDomain.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -107,11 +107,6 @@
}
}
- public void AddMailboxMapping(Type mappingType) {
- ILocalStoreUserMap mapping = (ILocalStoreUserMap) Activator.CreateInstance(mappingType);
- this.mailboxMappings.Add(mapping);
- }
-
private List<ILocalStoreDeliveryAction> allowedActions = new List<ILocalStoreDeliveryAction>();
/// <summary>
@@ -167,7 +162,7 @@
}
// TODO: should also check group membership
-
+
return result;
}
Modified: NMail/branches/luke-dev/NMail/NMail.csproj
===================================================================
--- NMail/branches/luke-dev/NMail/NMail.csproj 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail/NMail.csproj 2006-10-24 12:21:38 UTC (rev 66)
@@ -106,6 +106,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Authentication\IHashAuthProvider.cs" />
+ <Compile Include="Authentication\ILockOutPolicy.cs" />
<Compile Include="Authentication\NullAuthentication.cs">
<SubType>Code</SubType>
</Compile>
Modified: NMail/branches/luke-dev/NMail.Administration.Web/CreateMailDomain.aspx.cs
===================================================================
--- NMail/branches/luke-dev/NMail.Administration.Web/CreateMailDomain.aspx.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail.Administration.Web/CreateMailDomain.aspx.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -30,16 +30,11 @@
if (mailDomain != null)
{
- Type mappingType = typeof(MySqlLocalStoreData);
+ Type mappingType = typeof(MySqlUserMap);
- //ILocalStoreUserMap mapping = MailDomainDataSource.CreateMailboxMapping(mappingType);
- //ILocalStoreUserMap mapping = Activator.CreateInstance
- //mailDomain.MailboxMappings.Add(mapping);
- mailDomain.AddMailboxMapping(mappingType);
+ ILocalStoreUserMap mapping = (ILocalStoreUserMap) Activator.CreateInstance(mappingType);
+ mailDomain.MailboxMappings.Add(mapping);
result = MailDomainDataSource.UpdateMailDomain(mailDomain);
-
-
- //MailDomainDataSource.AddMailboxMapping(mailDomain.MailDomainId, mappingType);
}
}
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql 2006-10-24 12:21:38 UTC (rev 66)
@@ -40,6 +40,9 @@
QuotaHardLimit INT,
QuotaWarnLimit INT,
Password VARCHAR(255),
+ Disabled BOOL NOT NULL,
+ LockedOutData LONGBLOB,
+ PasswordExpiry DATETIME NOT NULL,
PRIMARY KEY(UserId)
) TYPE=InnoDB;
@@ -868,6 +871,7 @@
DROP PROCEDURE IF EXISTS UpdateMailDomain ;
CREATE PROCEDURE UpdateMailDomain
(
+ MailDomainId INT,
PrimaryHost VARCHAR(255),
ObjectData LONGBLOB,
OUT Result INT
@@ -875,17 +879,25 @@
BEGIN
START TRANSACTION;
- /* Check if the name is valid. */
- IF NOT EXISTS (SELECT m.MailDomainId FROM MailDomain m WHERE m.PrimaryHost LIKE PrimaryHost AND m.MailDomainId != MailDomainId) THEN
-
- UPDATE MailDomain m SET m.PrimaryHost = PrimaryHost, m.ObjectData = ObjectData WHERE m.MailDomainId = MailDomainId;
+ /* Check if the Id is valid. */
+ IF EXISTS (SELECT m.PrimaryHost FROM MailDomain m WHERE m.MailDomainId = MailDomainId) THEN
+
+ /* Check if the name is valid. */
+ IF NOT EXISTS (SELECT m.MailDomainId FROM MailDomain m WHERE m.PrimaryHost LIKE PrimaryHost AND m.MailDomainId != MailDomainId) THEN
+
+ UPDATE MailDomain m SET m.PrimaryHost = PrimaryHost, m.ObjectData = ObjectData WHERE m.MailDomainId = MailDomainId;
+
+ /* Ok successful. */
+ SELECT 0 INTO Result;
- /* Ok successful. */
- SELECT 0 INTO Result;
+ ELSE
+ /* Already exists. */
+ SELECT 1 INTO Result;
+ END IF;
ELSE
- /* Already exists. */
- SELECT 1 INTO Result;
+ /* No such mail domain. */
+ SELECT 2 INTO Result;
END IF;
COMMIT;
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs 2006-10-24 12:21:38 UTC (rev 66)
@@ -22,33 +22,22 @@
using System.Security.Cryptography;
using System.Text;
-using Mono.Security.Protocol.Ntlm;
using MySql.Data.MySqlClient;
-using NMail.Authentication;
using NMail.Configuration;
using NMail.DataTypes;
using NMail.DataTypes.ACLs;
using NMail.DataTypes.LocalStore;
using NMail.Helper;
-using NMail.LocalStoreData.MySql.Configuration;
// TODO: implement quotas
-// TODO: password expiry
-// TODO: account lockout if too many bad attempts
namespace NMail.LocalStoreData.MySql {
/// <summary>
/// A MySql based local store data provider.
/// </summary>
[Serializable]
- public class MySqlLocalStoreData : MarshalByRefObject, ILocalStoreData, IHashAuthProvider, ILocalStoreUserMap {
- private MySqlConnection GetConnection() {
- MySqlConnection cnn = new MySqlConnection(MySqlLocalStoreDataConfiguration.Current.ConnectionString);
- cnn.Open();
- return cnn;
- }
-
+ public class MySqlLocalStoreData : MarshalByRefObject, ILocalStoreData {
#region ILocalStoreData Members
#region Message Delivery
@@ -63,7 +52,7 @@
}
public void DeliverMessage(Message message, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction transaction = null;
try {
@@ -201,13 +190,13 @@
}
public StoreFolder GetStoreFolder(Folder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
return getStoreFolder(folder, cnn, null);
}
}
public StoreFolder GetStoreFolder(int folderId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolder";
@@ -262,7 +251,7 @@
/// <param name="newFolder">The folder to create.</param>
/// <returns>The result of the attempt to create the folder.</returns>
public LocalStoreFolderResult CreateFolder(int userId, StoreFolder parent, Folder newFolder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
int? parentFolderId = (parent == null) ? null : (int?) parent.FolderId;
@@ -295,7 +284,7 @@
/// <param name="folderId">The Id of the folder to delete.</param>
/// <returns>The result of the delete attempt.</returns>
public LocalStoreFolderResult DeleteFolder(int folderId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteFolder";
@@ -344,7 +333,7 @@
}
// Only the last part of the folder name has changed, proceed with the rename
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction transaction = cnn.BeginTransaction();
// Check for a folder with the same name
@@ -363,7 +352,7 @@
#region GetChildren
public StoreFolder[] GetChildren(StoreFolder parent) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolderChildIds";
@@ -401,7 +390,7 @@
/// </summary>
/// <returns>The list of folders.</returns>
public StoreFolder[] GetFolders() {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetFolders";
@@ -431,7 +420,7 @@
#region GetSubscribedFolders
public StoreFolder[] GetSubscribedFolders(string userName) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT s.FolderId AS FolderId FROM User u, Subscription s WHERE s.UserId = u.UserId AND u.UserName = ?UserName";
cmd.Parameters.Add("UserName", userName);
@@ -459,7 +448,7 @@
#region Subscribe
private bool folderSubscribed(int userId, int folderId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Subscription WHERE UserId = ?UserId AND FolderId = ?FolderId";
cmd.Parameters.Add("UserId", userId);
@@ -472,7 +461,7 @@
}
public void Subscribe(string userName, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT UserId FROM User WHERE UserName = ?UserName";
cmd.Parameters.Add("UserName", userName);
@@ -494,7 +483,7 @@
#region UnSubscribe
public void UnSubscribe(string userName, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT UserId FROM User WHERE Username = ?Username";
cmd.Parameters.Add("Username", userName);
@@ -518,7 +507,7 @@
#region GetNextMessageId
public int GetNextMessageId(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT FolderMessageId FROM Message WHERE FolderId = ?FolderId AND FolderMessageId > ?MessageId ORDER BY FolderMessageId LIMIT 1";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -531,7 +520,7 @@
}
public int GetNextMessageId(StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT NextMessageId FROM Folder WHERE FolderId = ?FolderId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -545,7 +534,7 @@
#region GetMessageId
public int GetMessageId(int messageOffset, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT FolderMessageId FROM Message WHERE FolderId = ?FolderId ORDER BY FolderMessageId LIMIT 1 OFFSET ?Offset";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -558,7 +547,7 @@
#region GetMessageOffset
public int GetMessageOffset(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Message WHERE FolderId = ?FolderId AND FolderMessageId <= ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -577,7 +566,7 @@
public StoreMessageFlags GetMessageFlags(int messageId, StoreFolder folder) {
StoreMessageFlags flags = StoreMessageFlags.None;
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT SeenFlag, AnsweredFlag, FlaggedFlag, DeletedFlag, DraftFlag, RecentFlag FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -614,7 +603,7 @@
#region SetMessageFlags
public void SetMessageFlags(int messageId, StoreFolder folder, StoreMessageFlags flags) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "UPDATE Message SET SeenFlag = ?SeenFlag, AnsweredFlag = ?AnsweredFlag, FlaggedFlag = ?FlaggedFlag, DeletedFlag = ?DeletedFlag, DraftFlag = ?DraftFlag, RecentFlag = ?RecentFlag WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -640,7 +629,7 @@
#region GetInternalDate
public DateTime GetInternalDate(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT InternalDate FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -653,7 +642,7 @@
#region GetMessageSize
public int GetMessageSize(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Size FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -666,7 +655,7 @@
#region GetMessageHeaders
public MessageHeaders GetMessageHeaders(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Headers FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -685,7 +674,7 @@
#region GetMessageMimePart
public IMessageBodyPart GetMessageMimePart(int messageId, StoreFolder folder, int messagePart) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT md.Data FROM Message m, MessageData md WHERE m.MessageId = md.MessageId AND m.FolderId = ?FolderId AND m.FolderMessageId = ?FolderMessageId AND md.Part = ?Part";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -700,7 +689,7 @@
#region GetMessage
public Message GetMessage(int messageId, StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT MimeMessage FROM Message WHERE FolderId = ?FolderId AND FolderMessageId = ?FolderMessageId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -765,7 +754,7 @@
#region GetMessageCount
public int GetMessageCount(StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) as MessageCount FROM Message WHERE FolderId = ?FolderId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -777,7 +766,7 @@
#region GetRecentMessageCount
public int GetRecentMessageCount(StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT COUNT(*) FROM Message WHERE FolderId = ?FolderId AND RecentFlag = true";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -791,7 +780,7 @@
#region PurgeDeletedMessages
public int[] PurgeDeletedMessages(StoreFolder folder) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
ArrayList folderMsgIds = new ArrayList();
MySqlTransaction transaction = cnn.BeginTransaction();
@@ -843,7 +832,7 @@
/// <param name="key">A key to identify which object to get.</param>
/// <returns>The object.</returns>
public object LoadObject(string key) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Data FROM AuxData WHERE `Key` = ?Key";
cmd.Parameters.Add("Key", key);
@@ -859,7 +848,7 @@
/// </summary>
/// <param name="key">A key to identify the object at load time.</param>
public void SaveObject(object o, string key) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction trans = cnn.BeginTransaction();
MySqlCommand cmd = cnn.CreateCommand();
@@ -892,7 +881,7 @@
/// <param name="username">The username to look up.</param>
/// <returns>The matching user or null if non is found.</returns>
public LocalStoreUser GetUser(string name) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
return getUser(name, cnn, null);
}
}
@@ -948,7 +937,7 @@
/// <param name="userId">The Id of the user to look up.</param>
/// <returns>The matching user or null if non is found.</returns>
public LocalStoreUser GetUser(int userId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
return getUser(userId, cnn, null);
}
}
@@ -1005,7 +994,7 @@
/// </summary>
/// <returns>The list of users.</returns>
public LocalStoreUser[] GetUsers() {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction transaction = cnn.BeginTransaction();
try {
@@ -1051,7 +1040,7 @@
/// <param name="hardQuota">The hard quota.</param>
/// <returns>The result of the attemp to create a new user.</returns>
public LocalStoreUserResult CreateUser(string username, int? warnQuota, int? hardQuota) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "CreateUser";
@@ -1080,7 +1069,7 @@
/// <param name="userId">The Id of the user to delete.</param>
/// <returns>The result of the attempt to delete a user.</returns>
public LocalStoreUserResult DeleteUser(int userId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteUser";
@@ -1105,7 +1094,7 @@
/// <param name="user">The user details to update.</param>
/// <returns>The result of the attempt to update the user.</returns>
public LocalStoreUserResult UpdateUser(LocalStoreUser user) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateUser";
@@ -1132,7 +1121,7 @@
/// <param name="userId">The Id of the user to get the folder for.</param>
/// <returns>The list of folders or null if the user Id is invalid.</returns>
public StoreFolder[] GetUserFolders(int userId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetUserFolders";
@@ -1167,7 +1156,7 @@
/// <param name="name">The name to look up.</param>
/// <returns>The matching group or null if non is found.</returns>
public LocalStoreGroup GetGroup(string name) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
return getGroup(name, cnn, null);
}
}
@@ -1221,7 +1210,7 @@
/// <param name="groupId">The Id of the group to look up.</param>
/// <returns>The matching group or null if non is found.</returns>
public LocalStoreGroup GetGroup(int groupId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
return getGroup(groupId, cnn, null);
}
}
@@ -1276,7 +1265,7 @@
/// </summary>
/// <returns>The list of groups.</returns>
public LocalStoreGroup[] GetGroups() {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction transaction = cnn.BeginTransaction();
try {
@@ -1318,7 +1307,7 @@
/// <param name="name">The name of the new group.</param>
/// <returns>The result of the attemp to create a new group.</returns>
public LocalStoreGroupResult CreateGroup(string name) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "CreateGroup";
@@ -1345,7 +1334,7 @@
/// <param name="groupId">The Id of the group to delete.</param>
/// <returns>The result of the attempt to delete a group.</returns>
public LocalStoreGroupResult DeleteGroup(int groupId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteGroup";
@@ -1370,7 +1359,7 @@
/// <param name="group">The updated group.</param>
/// <returns>The result of the attempt to update the group.</returns>
public LocalStoreGroupResult UpdateGroup(LocalStoreGroup group) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateGroup";
@@ -1394,7 +1383,7 @@
#region Folder ACLs
#region Set StoreFolder ACE
public void SetStoreFolderAce(StoreFolder folder, GenericAce<StoreFolderPrivilege> ace) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
setStoreFolderAce(folder, ace, cnn, null);
}
}
@@ -1417,7 +1406,7 @@
#region Remove StoreFolder ACE
public void RemoveStoreFolderAce(StoreFolder folder, string identifier) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "DELETE FROM FolderAcl WHERE FolderId = ?FolderId AND Identifier = ?Identifier";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -1436,7 +1425,7 @@
StoreFolder folder = GetStoreFolder(folderId);
StoreFolderAcl result = new StoreFolderAcl(folder);
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandText = "SELECT Identifier, Allow, Privilege FROM FolderAcl WHERE FolderId = ?FolderId";
cmd.Parameters.Add("FolderId", folder.FolderId);
@@ -1488,7 +1477,7 @@
/// </summary>
/// <returns>The mail domains.</returns>
public MailDomain[] GetMailDomains() {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
MySqlTransaction transaction = cnn.BeginTransaction();
try {
@@ -1531,7 +1520,7 @@
/// <param name="host">The primary host for the mail domain.</param>
/// <returns>The result of the attempt to add the mail domain.</returns>
public LocalStoreMailDomainResult CreateMailDomain(Host host) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
MailDomain mailDomain = new MailDomain(-1, host);
@@ -1561,7 +1550,7 @@
/// <param name="mailDomainId">The Id of the mail domain to delete.</param>
/// <returns>The result of the attempt to delete the domain.</returns>
public LocalStoreMailDomainResult DeleteMailDomain(int mailDomainId) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DeleteMailDomain";
@@ -1586,11 +1575,12 @@
/// <param name="updatedMailDomain">The updated mail domain.</param>
/// <returns>The result of the attempt to update the mail domain.</returns>
public LocalStoreMailDomainResult UpdateMailDomain(MailDomain updatedMailDomain) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UpdateMailDomain";
cmd.Parameters.Add("PrimaryHost", updatedMailDomain.PrimaryHost.ToString());
+ cmd.Parameters.Add("MailDomainId", updatedMailDomain.MailDomainId);
cmd.Parameters.Add("ObjectData", SerializationHelper.Serialize(updatedMailDomain));
cmd.Parameters.Add("Result", MySqlDbType.Int32);
cmd.Parameters["Result"].Direction = ParameterDirection.Output;
@@ -1613,7 +1603,7 @@
/// </summary>
/// <param name="ace">The privileges and the identifier to put.</param>
public void SetSystemPrivilegeAce(GenericAce<SystemPrivilege> ace) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SetSystemAce";
@@ -1630,7 +1620,7 @@
/// </summary>
/// <param name="identifier">The identifier to remove from the ACL.</param>
public void RemoveSystemPrivilegeAce(string identifier) {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "RemoveSystemAce";
@@ -1645,7 +1635,7 @@
/// </summary>
/// <returns>The system ACL.</returns>
public GenericAcl<SystemPrivilege> GetSystemPrivilegeAcl() {
- using (MySqlConnection cnn = GetConnection()) {
+ using (MySqlConnection cnn = MySqlHelper.GetConnection()) {
using (MySqlCommand cmd = cnn.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetSystemAcl";
@@ -1669,181 +1659,5 @@
}
#endregion
#endregion
-
- #region Auth Provider
- #region IAuthProvider
-
- public DateTime GetTokenExpiry(IAuthenticationToken user) {
- // TODO: fix this!
- return DateTime.MaxValue;
- }
-
- public bool TokenExpired(IAuthenticationToken user) {
- // TODO: fix this!!
- return false;
- }
-
- public bool ValidToken(IAuthenticationToken user) {
- // TODO: fix this!!
- return true;
- }
-
- public bool IsLockedOut(IAuthenticationToken user) {
- // TODO: fix this!
- return false;
- }
-
- public bool ChangePassword(IAuthenticationToken user, string newPassword) {
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- cmd.CommandText = "UPDATE `User` SET Password = ?Password WHERE Username = ?Username";
- cmd.Parameters.Add("Username", user.Username);
- cmd.Parameters.Add("Password", newPassword);
- int count = cmd.ExecuteNonQuery();
-
- return (count == 1);
- }
- }
- }
- #endregion
-
- #region IHashAuthProvider Members
-
- public IAuthenticationToken Authenticate(string username, string hash, HashAuthType authType) {
- if ((authType & HashAuthType.Ntlm) == HashAuthType.Ntlm) {
- // Get the hash stored in the database.
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- cmd.CommandText = "SELECT Password FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
- string dbPassword = (string)cmd.ExecuteScalar();
-
- // Generate a NTLM hash
- Type3Message type3Msg = new Type3Message();
- type3Msg.Password = dbPassword;
- string dbHash = Convert.ToBase64String(type3Msg.NT);
-
- if (dbHash == hash) {
- // Hashes match, return a valid token
- // TODO: get the password expiry details
- return new BasicAuthToken(username, DateTime.MaxValue);
- }
- }
- }
- }
-
- return null;
- }
-
- public HashAuthType HashAuthType {
- get { return HashAuthType.Ntlm; }
- }
-
- #endregion
-
- #region IAuthenticationProvider Members
-
- public IAuthenticationToken Authenticate(string username, string password) {
- // Get the hash stored in the database.
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- cmd.CommandText = "SELECT Password FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
- string dbHash = cmd.ExecuteScalar() as string;
-
- if (dbHash == password) {
- // Hashes match, return a valid token
- // TODO: get the password expiry details
- return new BasicAuthToken(username, DateTime.MaxValue);
- }
- }
- }
-
- // Hashes do not match
- return null;
- }
-
- public IAuthenticationToken CreateAuthToken(string username) {
- // Get the hash stored in the database.
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- cmd.CommandText = "SELECT COUNT(*) FROM User WHERE Username = ?Username";
- cmd.Parameters.Add("Username", username);
- long count = (long) cmd.ExecuteScalar();
-
- if (count == 1) {
- // TODO: get the password expiry details
- return new BasicAuthToken(username, DateTime.MaxValue);
- }
- }
- }
-
- // No such user
- return null;
- }
- #endregion
- #endregion
-
- #region ILocalStoreUserMap Members
- /// <summary>
- /// Maps the given mailbox to a user.
- /// </summary>
- /// <param name="mailbox">The mailbox to map.</param>
- /// <returns>The user or null.</returns>
- public LocalStoreUser MapMailboxToUser(string mailbox) {
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- // First check if the username matches the mailbox
- cmd.CommandText = "SELECT u.UserId FROM User u WHERE u.Username LIKE ?Mailbox";
- cmd.Parameters.Add("Mailbox", mailbox);
- object o = cmd.ExecuteScalar();
-
- if (o is int) {
- return GetUser((int) o);
- }
-
- // Next check if the mailbox maps to a user
- cmd.CommandText = "SELECT u.UserId FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND m.Mailbox LIKE ?Mailbox";
- cmd.Parameters.Add("Mailbox", mailbox);
- o = cmd.ExecuteScalar();
-
- if (o is int) {
- return GetUser((int) o);
- }
-
- // No such mailbox
- return null;
- }
- }
- }
-
- public Mailbox[] GetUserMailboxes(string username) {
- using (MySqlConnection cnn = GetConnection()) {
- using (MySqlCommand cmd = cnn.CreateCommand()) {
- cmd.CommandText = "SELECT m.Mailbox FROM User u, MailboxMapping m WHERE u.UserId = m.UserId AND u.Username LIKE ?Username";
- cmd.Parameters.Add("Username", username);
-
- using (MySqlDataReader reader = cmd.ExecuteReader()) {
- List<Mailbox> mailboxes = new List<Mailbox>();
-
- while (reader.Read()) {
- string mailboxName = (string)reader["Mailbox"];
- mailboxes.Add(new Mailbox(mailboxName));
- }
-
- return mailboxes.ToArray();
- }
- }
- }
- }
-
- public void AddUserMailbox(string username, Mailbox mailbox) {
- throw new NotImplementedException();
- }
-
- public void RemoveUserMailbox(string username, Mailbox mailbox) {
- throw new NotImplementedException();
- }
- #endregion
}
}
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj 2006-10-24 12:21:38 UTC (rev 66)
@@ -105,9 +105,12 @@
<Compile Include="Configuration\MySqlLocalStoreDataConfiguration.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="MySqlAuthProvider.cs" />
+ <Compile Include="MySqlHelper.cs" />
<Compile Include="MySqlLocalStoreData.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="MySqlUserMap.cs" />
<Content Include="MySqlLocalStore.sql" />
<Content Include="NMail.LocalStoreData.Mysql.build" />
</ItemGroup>
Modified: NMail/branches/luke-dev/NMail.Server.Console/NMail.config
===================================================================
--- NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-10-19 11:08:29 UTC (rev 65)
+++ NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-10-24 12:21:38 UTC (rev 66)
@@ -21,7 +21,7 @@
</Services>
<NamedServices>
- <NamedService Name="AuthProvider" Type="NMail.LocalStoreData.MySql.MySqlLocalStoreData, NMail.LocalStoreData.MySql" />
+ <NamedService Name="AuthProvider" Type="NMail.LocalStoreData.MySql.MySqlAuthProvider, NMail.LocalStoreData.MySql" />
<NamedService Name="DnsClient" Type="NMail.DnsClient.DnsClient, NMail.DnsClient" />
<NamedService Name="MessageRouter" Type="NMail.MessageRouter.MessageRouter, NMail.MessageRouter" />
<NamedService Name="LocalStore" Type="NMail.LocalStore.LocalStore, NMail.LocalStore" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tmy...@us...> - 2006-10-21 13:43:32
|
Revision: 65
http://svn.sourceforge.net/nmailserver/?rev=65&view=rev
Author: tmyroadctfig
Date: 2006-10-19 04:08:29 -0700 (Thu, 19 Oct 2006)
Log Message:
-----------
Changed the output location of all projects. Changed the local store interfaces. Other changes.
Modified Paths:
--------------
NMail/branches/luke-dev/MonoPrivileges/MonoPrivileges.csproj
NMail/branches/luke-dev/NDns/NDns.csproj
NMail/branches/luke-dev/NDns/NDns.xml
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStoreData.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStoreUserMap.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/LocalStoreGroup.cs
NMail/branches/luke-dev/NMail/DataTypes/LocalStore/MailDomain.cs
NMail/branches/luke-dev/NMail/NMail.build
NMail/branches/luke-dev/NMail/NMail.csproj
NMail/branches/luke-dev/NMail.Administration.Console/Command/AddUserToMailDomainCommand.cs
NMail/branches/luke-dev/NMail.Administration.Console/Command/RemoveUserFromMailDomainCommand.cs
NMail/branches/luke-dev/NMail.Administration.Console/NMail.Administration.Console.csproj
NMail/branches/luke-dev/NMail.Administration.Web/App_Code/MailDomainDataSource.cs
NMail/branches/luke-dev/NMail.Administration.Web/CreateMailDomain.aspx.cs
NMail/branches/luke-dev/NMail.Administration.Web/MailDomainDetails.aspx
NMail/branches/luke-dev/NMail.Administration.Web/MailDomainDetails.aspx.cs
NMail/branches/luke-dev/NMail.DnsClient/NMail.DnsClient.csproj
NMail/branches/luke-dev/NMail.ImapService/NMail.ImapService.csproj
NMail/branches/luke-dev/NMail.LocalStore/LocalStore.cs
NMail/branches/luke-dev/NMail.LocalStore/NMail.LocalStore.csproj
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStore.sql
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/MySqlLocalStoreData.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.csproj
NMail/branches/luke-dev/NMail.MessageRouter/NMail.MessageRouter.csproj
NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.csproj
NMail/branches/luke-dev/NMail.Sendmail/NMail.Sendmail.csproj
NMail/branches/luke-dev/NMail.Server/NMail.Server.csproj
NMail/branches/luke-dev/NMail.Server.Console/NMail.Server.Console.csproj
NMail/branches/luke-dev/NMail.Server.Service/NMail.Server.Service.csproj
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/MySqlHelper.cs
NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
NMail/branches/luke-dev/NMail.SmtpClient/NMail.SmtpClient.csproj
NMail/branches/luke-dev/NMail.SmtpService/Command/DataCommand.cs
NMail/branches/luke-dev/NMail.SmtpService/NMail.SmtpService.csproj
NMail/branches/luke-dev/NMail.SpoolData.MySql/NMail.SpoolData.MySql.csproj
NMail/branches/luke-dev/NMail.SpoolFilter/NMail.SpoolFilter.csproj
NMail/branches/luke-dev/NMail.SpoolFilter.RegexAddressRewriter/NMail.SpoolFilter.RegexAddressRewriter.csproj
NMail/branches/luke-dev/NMail.SpoolService/NMail.SpoolService.csproj
NMail/branches/luke-dev/NMail.UnitTests/NMail.UnitTests.csproj
NMail/branches/luke-dev/NMail.build
NMail/branches/luke-dev/NMail.sln
Modified: NMail/branches/luke-dev/MonoPrivileges/MonoPrivileges.csproj
===================================================================
--- NMail/branches/luke-dev/MonoPrivileges/MonoPrivileges.csproj 2006-09-28 13:55:11 UTC (rev 64)
+++ NMail/branches/luke-dev/MonoPrivileges/MonoPrivileges.csproj 2006-10-19 11:08:29 UTC (rev 65)
@@ -28,7 +28,7 @@
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\References\NMail\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
@@ -51,7 +51,7 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\References\NMail\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Modified: NMail/branches/luke-dev/NDns/NDns.csproj
===================================================================
--- NMail/branches/luke-dev/NDns/NDns.csproj 2006-09-28 13:55:11 UTC (rev 64)
+++ NMail/branches/luke-dev/NDns/NDns.csproj 2006-10-19 11:08:29 UTC (rev 65)
@@ -28,7 +28,7 @@
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\References\NMail\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
@@ -50,7 +50,7 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\References\NMail\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Modified: NMail/branches/luke-dev/NDns/NDns.xml
===================================================================
--- NMail/branches/luke-dev/NDns/NDns.xml 2006-09-28 13:55:11 UTC (rev 64)
+++ NMail/branches/luke-dev/NDns/NDns.xml 2006-10-19 11:08:29 UTC (rev 65)
@@ -4,292 +4,310 @@
<name>NDns</name>
</assembly>
<members>
- <member name="T:NDns.Message.Header">
+ <member name="T:NDns.Message.Records.PTRRecord">
<summary>
- Represents the header component of a DNS message.
+ A DNS PTR record.
</summary>
</member>
- <member name="F:NDns.Message.Header.id">
+ <member name="T:NDns.Message.Records.Record">
<summary>
- A 16 bit Id number to identify this message.
+ A DNS record.
</summary>
</member>
- <member name="F:NDns.Message.Header.response">
+ <member name="F:NDns.Message.Records.Record.type">
<summary>
- Was this message a query or a response?
+ The type of this record.
</summary>
</member>
- <member name="F:NDns.Message.Header.opcode">
+ <member name="F:NDns.Message.Records.Record.recordTTL">
<summary>
- A four bit field that specifies query type in the message.
+ The time to live for this record (in seconds).
</summary>
</member>
- <member name="F:NDns.Message.Header.authoritative">
+ <member name="F:NDns.Message.Records.Record.creationTime">
<summary>
- Is the answer authoritative?
+ The time this record was created.
</summary>
</member>
- <member name="F:NDns.Message.Header.truncated">
+ <member name="M:NDns.Message.Records.Record.#ctor">
<summary>
- Was the message truncated due to size constraints?
+ Creates a new DNS record.
</summary>
</member>
- <member name="F:NDns.Message.Header.recursionDesired">
+ <member name="P:NDns.Message.Records.Record.Type">
<summary>
- Is recursion desired?
+ Returns the type for this record.
</summary>
</member>
- <member name="F:NDns.Message.Header.recursionAvailable">
+ <member name="P:NDns.Message.Records.Record.Data">
<summary>
- Is recursion available?
+ The data associated with this record as a user readable string.
</summary>
</member>
- <member name="F:NDns.Message.Header.rcode">
+ <member name="P:NDns.Message.Records.Record.TTL">
<summary>
- The response code for this message.
+ Gets and sets the time to live for this record (in seconds).
</summary>
</member>
- <member name="F:NDns.Message.Header.questionEntries">
+ <member name="F:NDns.Message.Records.PTRRecord.name">
<summary>
- An unsigned 16 bit integer specifying the number of entries in the
- question section.
+ The name for this record.
</summary>
</member>
- <member name="F:NDns.Message.Header.answerEntries">
+ <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.String)">
<summary>
- An unsigned 16 bit integer specifying the number of resource
- records in the answer section.
+ Creates a PTR record from the given domain.
</summary>
+ <param name="name">The string of the name.</param>
</member>
- <member name="F:NDns.Message.Header.nameServerEntries">
+ <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- An unsigned 16 bit integer specifying the number of name server
- resource records in the authority records section.
+ Creates a PTR record from the given byte data.
</summary>
+ <param name="data">The data to create the CName record from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="F:NDns.Message.Header.additionalEntries">
+ <member name="P:NDns.Message.Records.PTRRecord.Name">
<summary>
- An unsigned 16 bit integer specifying the number of resource records in
- the additional records section.
+ Returns the name for this record.
</summary>
</member>
- <member name="F:NDns.Message.Header.lastId">
+ <member name="P:NDns.Message.Records.PTRRecord.Data">
<summary>
- The last Id number assigned to a DNS message.
+ The data associated with this record as a user readable string.
</summary>
</member>
- <member name="M:NDns.Message.Header.#ctor">
+ <member name="T:NDns.Message.QuestionSection">
<summary>
- Creates a new DNS message header with a unique Id number.
+ A question section entry in a DNS message.
</summary>
</member>
- <member name="M:NDns.Message.Header.#ctor(System.Byte[],System.UInt16,System.UInt16@)">
+ <member name="F:NDns.Message.QuestionSection.queryName">
<summary>
- Creates a new DNS message header using the given data. This data is
- typically the response from a DNS server.
+ The string name being looked up.
</summary>
- <param name="data">The data to create the message header from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
</member>
- <member name="M:NDns.Message.Header.GetId">
+ <member name="F:NDns.Message.QuestionSection.queryType">
<summary>
- Gets the next available Id number.
+ The type of query being performed.
</summary>
- <returns>The Id number.</returns>
</member>
- <member name="M:NDns.Message.Header.ToByteArray">
+ <member name="F:NDns.Message.QuestionSection.queryClass">
<summary>
- Converts the header to a byte array ready to send in a DNS message.
+ The class of query.
</summary>
- <returns>The header as a byte array.</returns>
</member>
- <member name="M:NDns.Message.Header.CreateOpCode(System.Byte)">
+ <member name="M:NDns.Message.QuestionSection.#ctor(System.String,NDns.Message.QType)">
<summary>
- Creates the opcode that corresponds to the given byte.
+ Creates a new question section with the given string and type.
</summary>
- <param name="opcode">The data to create the opcode from.</param>
- <returns>The opcode.</returns>
+ <param name="queryName">The string to query.</param>
+ <param name="queryType">The type of query to perform.</param>
</member>
- <member name="M:NDns.Message.Header.CreateResponseCode(System.Byte)">
+ <member name="M:NDns.Message.QuestionSection.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- Creates the response code that corresponds to the given byte.
+ Creates a question section from the given byte data.
</summary>
- <param name="rcode">The data to create the response code from.</param>
- <returns>The response code.</returns>
+ <param name="data">The data to create the question section from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.Header.Id">
+ <member name="M:NDns.Message.QuestionSection.ToByteArray(NDns.Message.DomainCoder,System.UInt16)">
<summary>
- Gets the Id number for this header (and thus message).
+ Converts the question section into a byte array.
</summary>
+ <param name="coder">The string coder used to compress queries with.</param>
+ <param name="reference">A reference to the location of this entry in the message.</param>
+ <returns>The question section as a byte array.</returns>
</member>
- <member name="T:NDns.Message.AnswerSection">
+ <member name="T:NDns.Configuration.NDnsConfiguration">
<summary>
- A answer section entry in a DNS message.
+ Provides configuration settings for this package.
</summary>
</member>
- <member name="F:NDns.Message.AnswerSection.answerName">
+ <member name="M:NDns.Configuration.NDnsConfiguration.#ctor(System.Net.IPAddress[],System.Int32,System.Int32,System.Int32)">
<summary>
- The string name in this answer.
+ Creates a new NDns configuration from the arguments.
</summary>
+ <param name="dnsServers">The list of DNS servers to query (in order).</param>
+ <param name="maxMXCacheSize">The maximum number of MX records to the cache.</param>
+ <param name="maxDomainCacheSize">The maximum number of domain records to the cache.</param>
+ <param name="maxAddressCacheSize">The maximum number of address records to the cache.</param>
</member>
- <member name="F:NDns.Message.AnswerSection.answerType">
+ <member name="P:NDns.Configuration.NDnsConfiguration.DnsServers">
<summary>
- The type of record.
+ The list of DNS servers to query (in order of perference).
</summary>
</member>
- <member name="F:NDns.Message.AnswerSection.answerClass">
+ <member name="P:NDns.Configuration.NDnsConfiguration.MaximumMXCacheSize">
<summary>
- The query class.
+ Returns the maximum cache for MX records size in entries.
</summary>
</member>
- <member name="F:NDns.Message.AnswerSection.answerTTL">
+ <member name="P:NDns.Configuration.NDnsConfiguration.MaximumDomainCacheSize">
<summary>
- The time to live for the answer.
+ Returns the maximum cache for domain records size in entries.
</summary>
</member>
- <member name="F:NDns.Message.AnswerSection.answerRecord">
+ <member name="P:NDns.Configuration.NDnsConfiguration.MaximumAddressCacheSize">
<summary>
- The record data associated with this record.
+ Returns the maximum cache for address records size in entries.
</summary>
</member>
- <member name="M:NDns.Message.AnswerSection.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="T:NDns.Message.OpCode">
<summary>
- Creates a answer section from the given byte data.
+ The opcode is a four bit field that specifies query type in the message.
+ This value is set by the originator of a query and copied into the response.
</summary>
- <param name="data">The data to create the answer section from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.AnswerSection.Record">
+ <member name="F:NDns.Message.OpCode.StandardQuery">
<summary>
- The answer record associated with this answer entry.
+ A standard query (QUERY).
</summary>
</member>
- <member name="T:NDns.Message.Records.CNameRecord">
+ <member name="F:NDns.Message.OpCode.InverseQuery">
<summary>
- A DNS Canonical NAME record.
+ An inverse query (IQUERY).
</summary>
</member>
- <member name="T:NDns.Message.Records.Record">
+ <member name="F:NDns.Message.OpCode.StatusRequest">
<summary>
- A DNS record.
+ A server status request (STATUS).
</summary>
</member>
- <member name="F:NDns.Message.Records.Record.type">
+ <member name="T:NDns.Message.DomainCoder">
<summary>
- The type of this record.
+ This class encodes and decodes DNS string names in or for DNS messages.
</summary>
</member>
- <member name="F:NDns.Message.Records.Record.recordTTL">
+ <member name="F:NDns.Message.DomainCoder.references">
<summary>
- The time to live for this record (in seconds).
+ A hash table of references indexed by string names.
</summary>
</member>
- <member name="F:NDns.Message.Records.Record.creationTime">
+ <member name="M:NDns.Message.DomainCoder.EncodeDomain(System.String,System.UInt16)">
<summary>
- The time this record was created.
+ Encodes a string entry or a reference to the string entry for the given
+ domain.
</summary>
+ <param name="domainName">The string to create the entry for.</param>
+ <param name="start">The reference to the start of this entry in the message.</param>
+ <returns>The string name or a reference to the first occurence.</returns>
</member>
- <member name="M:NDns.Message.Records.Record.#ctor">
+ <member name="M:NDns.Message.DomainCoder.DecodeDomain(System.Byte[],System.UInt16,System.UInt16@)">
<summary>
- Creates a new DNS record.
+ Decodes the data to retrieve a string name.
</summary>
+ <param name="data">The data to process.</param>
+ <param name="start">The position to start processing from.</param>
+ <param name="length">The length of data read.</param>
+ <returns>The string decoded.</returns>
</member>
- <member name="P:NDns.Message.Records.Record.Type">
+ <member name="T:NDns.Message.Records.MXRecord">
<summary>
- Returns the type for this record.
+ A DNS Mail eXchanger record.
</summary>
</member>
- <member name="P:NDns.Message.Records.Record.Data">
+ <member name="F:NDns.Message.Records.MXRecord.preference">
<summary>
- The data associated with this record as a user readable string.
+ The preference associated with this MX record.
</summary>
</member>
- <member name="P:NDns.Message.Records.Record.TTL">
+ <member name="F:NDns.Message.Records.MXRecord.mxName">
<summary>
- Gets and sets the time to live for this record (in seconds).
+ The name of the MX server.
</summary>
</member>
- <member name="F:NDns.Message.Records.CNameRecord.cName">
+ <member name="M:NDns.Message.Records.MXRecord.#ctor(System.String,System.UInt16)">
<summary>
- The canonical name for this record.
+ Creates a MX record from the given string and preference.
</summary>
+ <param name="mxName">The string of the MX record.</param>
+ <param name="perference">The preference of the MX record.</param>
</member>
- <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.String)">
+ <member name="M:NDns.Message.Records.MXRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- Creates a CName record from the given domain.
+ Creates a MX record from the given byte data.
</summary>
- <param name="cName">The string of the canonical name.</param>
- </member>
- <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
- <summary>
- Creates a CName record from the given byte data.
- </summary>
- <param name="data">The data to create the CName record from.</param>
+ <param name="data">The data to create the MX record from.</param>
<param name="start">The position to start reading the byte array from.</param>
<param name="length">The number of bytes read from the byte array.</param>
<param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.Records.CNameRecord.CName">
+ <member name="M:NDns.Message.Records.MXRecord.CompareTo(System.Object)">
<summary>
- Returns the canonical name for this record.
+ Compares this MX record to another MX record, sorting by perference.
</summary>
+ <param name="obj">The other MX to compare to.</param>
+ <returns>-1 if this MX is perferable, 1 otherwise.</returns>
</member>
- <member name="P:NDns.Message.Records.CNameRecord.Data">
+ <member name="P:NDns.Message.Records.MXRecord.MX">
<summary>
+ Returns the MX string for this record.
+ </summary>
+ </member>
+ <member name="P:NDns.Message.Records.MXRecord.Preference">
+ <summary>
+ Returns the preference for this record.
+ </summary>
+ </member>
+ <member name="P:NDns.Message.Records.MXRecord.Data">
+ <summary>
The data associated with this record as a user readable string.
</summary>
</member>
- <member name="T:NDns.QueryFactory">
+ <member name="T:NDns.Message.ResponseCode">
<summary>
- A factory class for creating DNS query and response messages.
+ The response code is a 4 bit field is set as part of responses.
</summary>
</member>
- <member name="M:NDns.QueryFactory.CreateQuery(System.String,NDns.Message.QType)">
+ <member name="F:NDns.Message.ResponseCode.NoError">
<summary>
- Creates a new DNS query to look up the record for the query string and type.
+ No error condition.
</summary>
- <param name="queryString">The query string to pack.</param>
- <param name="queryType">The type of the query.</param>
- <returns>The DNS message.</returns>
</member>
- <member name="T:NDns.Message.Records.PTRRecord">
+ <member name="F:NDns.Message.ResponseCode.FormatError">
<summary>
- A DNS PTR record.
+ The name server was unable to interpret the query.
</summary>
</member>
- <member name="F:NDns.Message.Records.PTRRecord.name">
+ <member name="F:NDns.Message.ResponseCode.ServerFailure">
<summary>
- The name for this record.
+ The name server was unable to process this query due to a problem
+ with the name server.
</summary>
</member>
- <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.String)">
+ <member name="F:NDns.Message.ResponseCode.NameError">
<summary>
- Creates a PTR record from the given domain.
+ Meaningful only for responses from an authoritative name server,
+ this code signifies that the string name referenced in the query
+ does not exist.
</summary>
- <param name="name">The string of the name.</param>
</member>
- <member name="M:NDns.Message.Records.PTRRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="F:NDns.Message.ResponseCode.NotImplemented">
<summary>
- Creates a PTR record from the given byte data.
+ The name server does not support the requested kind of query.
</summary>
- <param name="data">The data to create the CName record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.Records.PTRRecord.Name">
+ <member name="F:NDns.Message.ResponseCode.Refused">
<summary>
- Returns the name for this record.
+ The name server refuses to perform the specified operation for
+ policy reasons.
</summary>
</member>
- <member name="P:NDns.Message.Records.PTRRecord.Data">
+ <member name="T:NDns.Message.QClass">
<summary>
- The data associated with this record as a user readable string.
+ The class of records.
</summary>
</member>
+ <member name="F:NDns.Message.QClass.IN">
+ <summary>
+ The Internet.
+ </summary>
+ </member>
<member name="T:NDns.DnsCache">
<summary>
Provides a cache for DNS information.
@@ -480,442 +498,424 @@
<param name="queryMessage">The query to send to the server.</param>
<returns>The response from the server.</returns>
</member>
- <member name="T:NDns.Message.ResponseCode">
+ <member name="T:NDns.Message.Records.NSRecord">
<summary>
- The response code is a 4 bit field is set as part of responses.
+ A DNS NS record.
</summary>
</member>
- <member name="F:NDns.Message.ResponseCode.NoError">
+ <member name="F:NDns.Message.Records.NSRecord.ns">
<summary>
- No error condition.
+ The name server name for this record.
</summary>
</member>
- <member name="F:NDns.Message.ResponseCode.FormatError">
+ <member name="M:NDns.Message.Records.NSRecord.#ctor(System.String)">
<summary>
- The name server was unable to interpret the query.
+ Creates a NS record from the given domain.
</summary>
+ <param name="ns">The string of the name server name.</param>
</member>
- <member name="F:NDns.Message.ResponseCode.ServerFailure">
+ <member name="M:NDns.Message.Records.NSRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- The name server was unable to process this query due to a problem
- with the name server.
+ Creates a NS record from the given byte data.
</summary>
+ <param name="data">The data to create the CName record from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="F:NDns.Message.ResponseCode.NameError">
+ <member name="P:NDns.Message.Records.NSRecord.NS">
<summary>
- Meaningful only for responses from an authoritative name server,
- this code signifies that the string name referenced in the query
- does not exist.
+ Returns the name server name for this record.
</summary>
</member>
- <member name="F:NDns.Message.ResponseCode.NotImplemented">
+ <member name="P:NDns.Message.Records.NSRecord.Data">
<summary>
- The name server does not support the requested kind of query.
+ The data associated with this record as a user readable string.
</summary>
</member>
- <member name="F:NDns.Message.ResponseCode.Refused">
+ <member name="T:NDns.Message.Header">
<summary>
- The name server refuses to perform the specified operation for
- policy reasons.
+ Represents the header component of a DNS message.
</summary>
</member>
- <member name="T:NDns.Message.Records.MXRecord">
+ <member name="F:NDns.Message.Header.id">
<summary>
- A DNS Mail eXchanger record.
+ A 16 bit Id number to identify this message.
</summary>
</member>
- <member name="F:NDns.Message.Records.MXRecord.preference">
+ <member name="F:NDns.Message.Header.response">
<summary>
- The preference associated with this MX record.
+ Was this message a query or a response?
</summary>
</member>
- <member name="F:NDns.Message.Records.MXRecord.mxName">
+ <member name="F:NDns.Message.Header.opcode">
<summary>
- The name of the MX server.
+ A four bit field that specifies query type in the message.
</summary>
</member>
- <member name="M:NDns.Message.Records.MXRecord.#ctor(System.String,System.UInt16)">
+ <member name="F:NDns.Message.Header.authoritative">
<summary>
- Creates a MX record from the given string and preference.
+ Is the answer authoritative?
</summary>
- <param name="mxName">The string of the MX record.</param>
- <param name="perference">The preference of the MX record.</param>
</member>
- <member name="M:NDns.Message.Records.MXRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="F:NDns.Message.Header.truncated">
<summary>
- Creates a MX record from the given byte data.
+ Was the message truncated due to size constraints?
</summary>
- <param name="data">The data to create the MX record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="M:NDns.Message.Records.MXRecord.CompareTo(System.Object)">
+ <member name="F:NDns.Message.Header.recursionDesired">
<summary>
- Compares this MX record to another MX record, sorting by perference.
+ Is recursion desired?
</summary>
- <param name="obj">The other MX to compare to.</param>
- <returns>-1 if this MX is perferable, 1 otherwise.</returns>
</member>
- <member name="P:NDns.Message.Records.MXRecord.MX">
+ <member name="F:NDns.Message.Header.recursionAvailable">
<summary>
- Returns the MX string for this record.
+ Is recursion available?
</summary>
</member>
- <member name="P:NDns.Message.Records.MXRecord.Preference">
+ <member name="F:NDns.Message.Header.rcode">
<summary>
- Returns the preference for this record.
+ The response code for this message.
</summary>
</member>
- <member name="P:NDns.Message.Records.MXRecord.Data">
+ <member name="F:NDns.Message.Header.questionEntries">
<summary>
- The data associated with this record as a user readable string.
+ An unsigned 16 bit integer specifying the number of entries in the
+ question section.
</summary>
</member>
- <member name="T:NDns.Message.QType">
+ <member name="F:NDns.Message.Header.answerEntries">
<summary>
- The DNS query type.
+ An unsigned 16 bit integer specifying the number of resource
+ records in the answer section.
</summary>
</member>
- <member name="F:NDns.Message.QType.A">
+ <member name="F:NDns.Message.Header.nameServerEntries">
<summary>
- A host address.
+ An unsigned 16 bit integer specifying the number of name server
+ resource records in the authority records section.
</summary>
</member>
- <member name="F:NDns.Message.QType.NS">
+ <member name="F:NDns.Message.Header.additionalEntries">
<summary>
- An authoritative name server.
+ An unsigned 16 bit integer specifying the number of resource records in
+ the additional records section.
</summary>
</member>
- <member name="F:NDns.Message.QType.CNAME">
+ <member name="F:NDns.Message.Header.lastId">
<summary>
- The canonical name for an alias.
+ The last Id number assigned to a DNS message.
</summary>
</member>
- <member name="F:NDns.Message.QType.SOA">
+ <member name="M:NDns.Message.Header.#ctor">
<summary>
- Marks the start of a zone of authority.
+ Creates a new DNS message header with a unique Id number.
</summary>
</member>
- <member name="F:NDns.Message.QType.PTR">
+ <member name="M:NDns.Message.Header.#ctor(System.Byte[],System.UInt16,System.UInt16@)">
<summary>
- A string name pointer.
+ Creates a new DNS message header using the given data. This data is
+ typically the response from a DNS server.
</summary>
+ <param name="data">The data to create the message header from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
</member>
- <member name="F:NDns.Message.QType.HINFO">
+ <member name="M:NDns.Message.Header.GetId">
<summary>
- Host information.
+ Gets the next available Id number.
</summary>
+ <returns>The Id number.</returns>
</member>
- <member name="F:NDns.Message.QType.MINFO">
+ <member name="M:NDns.Message.Header.ToByteArray">
<summary>
- Mailbox or mail list information.
+ Converts the header to a byte array ready to send in a DNS message.
</summary>
+ <returns>The header as a byte array.</returns>
</member>
- <member name="F:NDns.Message.QType.MX">
+ <member name="M:NDns.Message.Header.CreateOpCode(System.Byte)">
<summary>
- Mail exchange.
+ Creates the opcode that corresponds to the given byte.
</summary>
+ <param name="opcode">The data to create the opcode from.</param>
+ <returns>The opcode.</returns>
</member>
- <member name="F:NDns.Message.QType.TXT">
+ <member name="M:NDns.Message.Header.CreateResponseCode(System.Byte)">
<summary>
- Text strings.
+ Creates the response code that corresponds to the given byte.
</summary>
+ <param name="rcode">The data to create the response code from.</param>
+ <returns>The response code.</returns>
</member>
- <member name="T:NDns.Configuration.NDnsConfiguration">
+ <member name="P:NDns.Message.Header.Id">
<summary>
- Provides configuration settings for this package.
+ Gets the Id number for this header (and thus message).
</summary>
</member>
- <member name="M:NDns.Configuration.NDnsConfiguration.#ctor(System.Net.IPAddress[],System.Int32,System.Int32,System.Int32)">
+ <member name="T:NDns.Message.DNSMessage">
<summary>
- Creates a new NDns configuration from the arguments.
+ A DNS message used in DNS communications.
</summary>
- <param name="dnsServers">The list of DNS servers to query (in order).</param>
- <param name="maxMXCacheSize">The maximum number of MX records to the cache.</param>
- <param name="maxDomainCacheSize">The maximum number of domain records to the cache.</param>
- <param name="maxAddressCacheSize">The maximum number of address records to the cache.</param>
</member>
- <member name="P:NDns.Configuration.NDnsConfiguration.DnsServers">
+ <member name="F:NDns.Message.DNSMessage.header">
<summary>
- The list of DNS servers to query (in order of perference).
+ The header for this DNS message.
</summary>
</member>
- <member name="P:NDns.Configuration.NDnsConfiguration.MaximumMXCacheSize">
+ <member name="F:NDns.Message.DNSMessage.questionEntries">
<summary>
- Returns the maximum cache for MX records size in entries.
+ The question sections associated with this DNS message.
</summary>
</member>
- <member name="P:NDns.Configuration.NDnsConfiguration.MaximumDomainCacheSize">
+ <member name="F:NDns.Message.DNSMessage.answerEntries">
<summary>
- Returns the maximum cache for domain records size in entries.
+ The answer sections associated with the DNS message.
</summary>
</member>
- <member name="P:NDns.Configuration.NDnsConfiguration.MaximumAddressCacheSize">
+ <member name="M:NDns.Message.DNSMessage.#ctor">
<summary>
- Returns the maximum cache for address records size in entries.
+ Creates a new DNS message.
</summary>
</member>
- <member name="T:NDns.Message.Records.ARecord">
+ <member name="M:NDns.Message.DNSMessage.#ctor(System.Byte[])">
<summary>
- A DNS Address record.
+ Creates a new DNS message using the given data. This data is typically the
+ response from a DNS server.
</summary>
+ <param name="data">The data to create the message from.</param>
</member>
- <member name="F:NDns.Message.Records.ARecord.address">
+ <member name="M:NDns.Message.DNSMessage.ToByteArray">
<summary>
- The address for this record.
+ Converts the DNS message into a byte array.
</summary>
+ <returns>The DNS message as a byte array.</returns>
</member>
- <member name="M:NDns.Message.Records.ARecord.#ctor(System.Net.IPAddress)">
+ <member name="P:NDns.Message.DNSMessage.QuestionEntries">
<summary>
- Creates an address record using the address record.
+ Gets and sets the question section entries for this DNS message.
</summary>
- <param name="address">The address to create the record from.</param>
</member>
- <member name="M:NDns.Message.Records.ARecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="P:NDns.Message.DNSMessage.AnswerEntries">
<summary>
- Creates an Address record from the given byte data.
+ Gets and sets the answer section entries for this DNS message.
</summary>
- <param name="data">The data to create the Address record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.Records.ARecord.Address">
+ <member name="P:NDns.Message.DNSMessage.Id">
<summary>
- The address for this record.
+ Gets the Id for this DNS message.
</summary>
</member>
- <member name="P:NDns.Message.Records.ARecord.Data">
+ <member name="P:NDns.Message.DNSMessage.Response">
<summary>
- The data associated with this record as a user readable string.
+ Was this message a response or a query?
</summary>
</member>
- <member name="T:NDns.Message.Records.NSRecord">
+ <member name="P:NDns.Message.DNSMessage.Authoritative">
<summary>
- A DNS NS record.
+ Is the answer authoritative?
</summary>
</member>
- <member name="F:NDns.Message.Records.NSRecord.ns">
+ <member name="P:NDns.Message.DNSMessage.Truncated">
<summary>
- The name server name for this record.
+ Was the message truncated due to size constraints?
</summary>
</member>
- <member name="M:NDns.Message.Records.NSRecord.#ctor(System.String)">
+ <member name="P:NDns.Message.DNSMessage.Recursive">
<summary>
- Creates a NS record from the given domain.
+ Is recursion desired?
</summary>
- <param name="ns">The string of the name server name.</param>
</member>
- <member name="M:NDns.Message.Records.NSRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="P:NDns.Message.DNSMessage.RecursionAvailable">
<summary>
- Creates a NS record from the given byte data.
+ Is recursion available?
</summary>
- <param name="data">The data to create the CName record from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.Records.NSRecord.NS">
+ <member name="P:NDns.Message.DNSMessage.Opcode">
<summary>
- Returns the name server name for this record.
+ A four bit field that specifies query type in the message.
</summary>
</member>
- <member name="P:NDns.Message.Records.NSRecord.Data">
+ <member name="P:NDns.Message.DNSMessage.Rcode">
<summary>
- The data associated with this record as a user readable string.
+ The response code for this message.
</summary>
</member>
- <member name="T:NDns.Message.OpCode">
+ <member name="T:NDns.QueryFactory">
<summary>
- The opcode is a four bit field that specifies query type in the message.
- This value is set by the originator of a query and copied into the response.
+ A factory class for creating DNS query and response messages.
</summary>
</member>
- <member name="F:NDns.Message.OpCode.StandardQuery">
+ <member name="M:NDns.QueryFactory.CreateQuery(System.String,NDns.Message.QType)">
<summary>
- A standard query (QUERY).
+ Creates a new DNS query to look up the record for the query string and type.
</summary>
+ <param name="queryString">The query string to pack.</param>
+ <param name="queryType">The type of the query.</param>
+ <returns>The DNS message.</returns>
</member>
- <member name="F:NDns.Message.OpCode.InverseQuery">
+ <member name="T:NDns.Message.Records.CNameRecord">
<summary>
- An inverse query (IQUERY).
+ A DNS Canonical NAME record.
</summary>
</member>
- <member name="F:NDns.Message.OpCode.StatusRequest">
+ <member name="F:NDns.Message.Records.CNameRecord.cName">
<summary>
- A server status request (STATUS).
+ The canonical name for this record.
</summary>
</member>
- <member name="T:NDns.Message.DNSMessage">
+ <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.String)">
<summary>
- A DNS message used in DNS communications.
+ Creates a CName record from the given domain.
</summary>
+ <param name="cName">The string of the canonical name.</param>
</member>
- <member name="F:NDns.Message.DNSMessage.header">
+ <member name="M:NDns.Message.Records.CNameRecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- The header for this DNS message.
+ Creates a CName record from the given byte data.
</summary>
+ <param name="data">The data to create the CName record from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="F:NDns.Message.DNSMessage.questionEntries">
+ <member name="P:NDns.Message.Records.CNameRecord.CName">
<summary>
- The question sections associated with this DNS message.
+ Returns the canonical name for this record.
</summary>
</member>
- <member name="F:NDns.Message.DNSMessage.answerEntries">
+ <member name="P:NDns.Message.Records.CNameRecord.Data">
<summary>
- The answer sections associated with the DNS message.
+ The data associated with this record as a user readable string.
</summary>
</member>
- <member name="M:NDns.Message.DNSMessage.#ctor">
+ <member name="T:NDns.Message.Records.ARecord">
<summary>
- Creates a new DNS message.
+ A DNS Address record.
</summary>
</member>
- <member name="M:NDns.Message.DNSMessage.#ctor(System.Byte[])">
+ <member name="F:NDns.Message.Records.ARecord.address">
<summary>
- Creates a new DNS message using the given data. This data is typically the
- response from a DNS server.
+ The address for this record.
</summary>
- <param name="data">The data to create the message from.</param>
</member>
- <member name="M:NDns.Message.DNSMessage.ToByteArray">
+ <member name="M:NDns.Message.Records.ARecord.#ctor(System.Net.IPAddress)">
<summary>
- Converts the DNS message into a byte array.
+ Creates an address record using the address record.
</summary>
- <returns>The DNS message as a byte array.</returns>
+ <param name="address">The address to create the record from.</param>
</member>
- <member name="P:NDns.Message.DNSMessage.QuestionEntries">
+ <member name="M:NDns.Message.Records.ARecord.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- Gets and sets the question section entries for this DNS message.
+ Creates an Address record from the given byte data.
</summary>
+ <param name="data">The data to create the Address record from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="P:NDns.Message.DNSMessage.AnswerEntries">
+ <member name="P:NDns.Message.Records.ARecord.Address">
<summary>
- Gets and sets the answer section entries for this DNS message.
+ The address for this record.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Id">
+ <member name="P:NDns.Message.Records.ARecord.Data">
<summary>
- Gets the Id for this DNS message.
+ The data associated with this record as a user readable string.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Response">
+ <member name="T:NDns.Message.QType">
<summary>
- Was this message a response or a query?
+ The DNS query type.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Authoritative">
+ <member name="F:NDns.Message.QType.A">
<summary>
- Is the answer authoritative?
+ A host address.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Truncated">
+ <member name="F:NDns.Message.QType.NS">
<summary>
- Was the message truncated due to size constraints?
+ An authoritative name server.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Recursive">
+ <member name="F:NDns.Message.QType.CNAME">
<summary>
- Is recursion desired?
+ The canonical name for an alias.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.RecursionAvailable">
+ <member name="F:NDns.Message.QType.SOA">
<summary>
- Is recursion available?
+ Marks the start of a zone of authority.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Opcode">
+ <member name="F:NDns.Message.QType.PTR">
<summary>
- A four bit field that specifies query type in the message.
+ A string name pointer.
</summary>
</member>
- <member name="P:NDns.Message.DNSMessage.Rcode">
+ <member name="F:NDns.Message.QType.HINFO">
<summary>
- The response code for this message.
+ Host information.
</summary>
</member>
- <member name="T:NDns.Message.QuestionSection">
+ <member name="F:NDns.Message.QType.MINFO">
<summary>
- A question section entry in a DNS message.
+ Mailbox or mail list information.
</summary>
</member>
- <member name="F:NDns.Message.QuestionSection.queryName">
+ <member name="F:NDns.Message.QType.MX">
<summary>
- The string name being looked up.
+ Mail exchange.
</summary>
</member>
- <member name="F:NDns.Message.QuestionSection.queryType">
+ <member name="F:NDns.Message.QType.TXT">
<summary>
- The type of query being performed.
+ Text strings.
</summary>
</member>
- <member name="F:NDns.Message.QuestionSection.queryClass">
+ <member name="T:NDns.Message.AnswerSection">
<summary>
- The class of query.
+ A answer section entry in a DNS message.
</summary>
</member>
- <member name="M:NDns.Message.QuestionSection.#ctor(System.String,NDns.Message.QType)">
+ <member name="F:NDns.Message.AnswerSection.answerName">
<summary>
- Creates a new question section with the given string and type.
+ The string name in this answer.
</summary>
- <param name="queryName">The string to query.</param>
- <param name="queryType">The type of query to perform.</param>
</member>
- <member name="M:NDns.Message.QuestionSection.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
+ <member name="F:NDns.Message.AnswerSection.answerType">
<summary>
- Creates a question section from the given byte data.
+ The type of record.
</summary>
- <param name="data">The data to create the question section from.</param>
- <param name="start">The position to start reading the byte array from.</param>
- <param name="length">The number of bytes read from the byte array.</param>
- <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="M:NDns.Message.QuestionSection.ToByteArray(NDns.Message.DomainCoder,System.UInt16)">
+ <member name="F:NDns.Message.AnswerSection.answerClass">
<summary>
- Converts the question section into a byte array.
+ The query class.
</summary>
- <param name="coder">The string coder used to compress queries with.</param>
- <param name="reference">A reference to the location of this entry in the message.</param>
- <returns>The question section as a byte array.</returns>
</member>
- <member name="T:NDns.Message.QClass">
+ <member name="F:NDns.Message.AnswerSection.answerTTL">
<summary>
- The class of records.
+ The time to live for the answer.
</summary>
</member>
- <member name="F:NDns.Message.QClass.IN">
+ <member name="F:NDns.Message.AnswerSection.answerRecord">
<summary>
- The Internet.
+ The record data associated with this record.
</summary>
</member>
- <member name="T:NDns.Message.DomainCoder">
+ <member name="M:NDns.Message.AnswerSection.#ctor(System.Byte[],System.UInt16,System.UInt16@,NDns.Message.DomainCoder)">
<summary>
- This class encodes and decodes DNS string names in or for DNS messages.
+ Creates a answer section from the given byte data.
</summary>
+ <param name="data">The data to create the answer section from.</param>
+ <param name="start">The position to start reading the byte array from.</param>
+ <param name="length">The number of bytes read from the byte array.</param>
+ <param name="coder">The coder to use when parsing the data.</param>
</member>
- <member name="F:NDns.Message.DomainCoder.references">
+ <member name="P:NDns.Message.AnswerSection.Record">
<summary>
- A hash table of references indexed by string names.
+ The answer record associated with this answer entry.
</summary>
</member>
- <member name="M:NDns.Message.DomainCoder.EncodeDomain(System.String,System.UInt16)">
- <summary>
- Encodes a string entry or a reference to the string entry for the given
- domain.
- </summary>
- <param name="domainName">The string to create the entry for.</param>
- <param name="start">The reference to the start of this entry in the message.</param>
- <returns>The string name or a reference to the first occurence.</returns>
- </member>
- <member name="M:NDns.Message.DomainCoder.DecodeDomain(System.Byte[],System.UInt16,System.UInt16@)">
- <summary>
- Decodes the data to retrieve a string name.
- </summary>
- <param name="data">The data to process.</param>
- <param name="start">The position to start processing from.</param>
- <param name="length">The length of data read.</param>
- <returns>The string decoded.</returns>
- </member>
</members>
</doc>
Modified: NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs
===================================================================
--- NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs 2006-09-28 13:55:11 UTC (rev 64)
+++ NMail/branches/luke-dev/NMail/DataTypes/LocalStore/ILocalStore.cs 2006-10-19 11:08:29 UTC (rev 65)
@@ -412,41 +412,23 @@
/// <returns>The user's email addresses.</returns>
EmailAddress[] GetUserAddresses(IAuthenticationToken authToken, int userId);
- /// <summary>
- /// Adds the given address the to list of addresses for the user.
- /// </summary>
- /// <param name="authToken">The authentication credentials.</param>
- /// <param name="userId">The Id of the user to add the address for.</param>
- /// <param name="address">The address to add.</param>
- void AddUserAddress(IAuthenticationToken authToken, int userId, EmailAddress address);
+ ///// <summary>
+ ///// Adds the given address the to list of addresses for the user.
+ ///// </summary>
+ ///// <param name="authToken">The authentication credentials.</param>
+ ///// <param name="userId">The Id of the user to add the address for.</param>
+ ///// <param name="address">The address to add.</param>
+ //void AddUserAddress(IAuthenticationToken authToken, int userId, EmailAddress address);
- /// <summary>
- /// Removes the given address from the list of addresses for the user.
- /// </summary>
- /// <param name="authToken">The authentication credentials.</param>
- /// <param name="userId">The Id of the user to remove the address from.</param>
- /// <param name="address">The address to remove.</param>
- void RemoveUserAddress(IAuthenticationToken authToken, int use...
[truncated message content] |
|
From: <tmy...@us...> - 2006-07-19 13:15:17
|
Revision: 60 Author: tmyroadctfig Date: 2006-07-19 06:14:39 -0700 (Wed, 19 Jul 2006) ViewCVS: http://svn.sourceforge.net/nmailserver/?rev=60&view=rev Log Message: ----------- Further work on website and setup related projects. Modified Paths: -------------- NMail/branches/luke-dev/Installer/NMail-Installer.wxs NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/Default.skin NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/StyleSheet.css NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs NMail/branches/luke-dev/NMail.Administration.Web/ViewFolders.aspx NMail/branches/luke-dev/NMail.Administration.Web/ViewMailDomains.aspx NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs NMail/branches/luke-dev/NMail.build Added Paths: ----------- NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.build NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.build NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.Designer.cs NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.cs NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.resx Modified: NMail/branches/luke-dev/Installer/NMail-Installer.wxs =================================================================== --- NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/Installer/NMail-Installer.wxs 2006-07-19 13:14:39 UTC (rev 60) @@ -19,6 +19,7 @@ <UpgradeVersion /> </Upgrade> --> + <!-- == == Conditions @@ -72,7 +73,13 @@ <!-- Account="NetworkService" --> </Component> + <Component Id="C_NMail.SetupWizard.exe" Guid="EFAD461E-6D96-4b5b-B56C-77D39DF6B233"> + <File Id="NMail.SetupWizard.exe" Name="SetupWiz.exe" LongName="NMail.SetupWizard.exe" DiskId="1" Source="obj\NMail.SetupWizard.exe" Vital="yes"> + <Shortcut Id="startmenuNMailSetup" Directory="ProgramMenuDir" Name="SetupWiz" LongName="NMail Setup Wizard" WorkingDirectory="INSTALLDIR" /> + </File> + </Component> + <!-- == == Webpage @@ -192,12 +199,16 @@ </Directory> </Directory> </Directory> - - <Component Id="C_VirtualWebDir" Guid="45A1A00F-7CAB-462f-A361-18566149FEBF"> + + <!-- <Component Id="C_VirtualWebDir" Guid="45A1A00F-7CAB-462f-A361-18566149FEBF"> <WebVirtualDir Id="WebVirtualDir" Alias="NMailAdmin" Directory="D_NMail.Administration.Web" WebSite="DefaultWebSite"> <WebApplication Id="WebApplication" Name="NMailAdmin" /> </WebVirtualDir> - </Component> + + <WebSite Id="DefaultWebSite" Description="Default Web Site" > + <WebAddress Id="AllUnassigned" Port="443" Secure="yes"/> + </WebSite> + </Component> --> <!-- == @@ -336,12 +347,32 @@ </Directory> <Directory Id="DesktopFolder" Name="Desktop" /> + </Directory> - <WebSite Id="DefaultWebSite" Description="Default Web Site"> - <WebAddress Id="AllUnassigned" Port="443" Secure="yes"/> - </WebSite> + + <!-- + == + == Custom actions and related + == + --> + + <Binary Id="B_NMail.PostInstall.exe" SourceFile="obj\NMail.PostInstall.exe" /> + <CustomAction Id="CA_PostInstall" BinaryKey="B_NMail.PostInstall.exe" ExeCommand="" /> + <CustomAction Id="CA_SetupWizard" FileKey="NMail.SetupWizard.exe" ExeCommand="" Return="asyncNoWait"/> + + <InstallExecuteSequence> + <Custom Action="CA_PostInstall" After="InstallFinalize" /> + <Custom Action="CA_SetupWizard" After="InstallFinalize" /> + </InstallExecuteSequence> + + <!-- + == + == Feature tree + == + --> + <Feature Id="F_Base" Absent="disallow" Title="NMail" Level="1" ConfigurableDirectory="INSTALLDIR" Display="expand" Description="The components required in a NMail installation."> @@ -360,6 +391,7 @@ <ComponentRef Id="C_NMail.Server.Console.exe" /> <ComponentRef Id="C_NMail.Administration.Console.exe" /> <ComponentRef Id="C_NMail.Server.Service.exe" /> + <ComponentRef Id="C_NMail.SetupWizard.exe" /> <!-- NMail Server DLLs --> <ComponentRef Id="C_MonoPrivileges.dll" /> @@ -391,7 +423,10 @@ <Feature Id="F_AdminWebsite" Display="expand" Title="Administration Website" Level="1" Description="NMail's ASP.net administration website."> - <ComponentRef Id="C_VirtualWebDir"/> + <!-- <Feature Id="F_SetupIIS" Display="expand" Title="Setup IIS Virtual Directory" Level="1" + Description="Setups IIS to have a virtual directory for NMail's administration website. Requires IIS."> + <ComponentRef Id="C_VirtualWebDir"/> + </Feature> --> <!-- Admin website files --> <ComponentRef Id="component0"/> Modified: NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/Default.skin =================================================================== --- NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/Default.skin 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/Default.skin 2006-07-19 13:14:39 UTC (rev 60) @@ -3,23 +3,23 @@ <asp:LoginStatus runat="server" Font-Size="smaller" /> <asp:DetailsView runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"> - <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" /> - <EditRowStyle BackColor="#2461BF" /> - <RowStyle BackColor="#EFF3FB" /> + <CommandRowStyle BackColor="#aaaaaa" Font-Bold="True" /> + <EditRowStyle BackColor="#bbbbbb" /> + <RowStyle BackColor="#dddddd" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> - <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> + <HeaderStyle BackColor="#666666" Font-Bold="True" ForeColor="Black" /> <AlternatingRowStyle BackColor="White" /> </asp:DetailsView> <asp:GridView runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"> - <EditRowStyle BackColor="#2461BF" /> - <RowStyle BackColor="#EFF3FB" /> + <EditRowStyle BackColor="#bbbbbbb" /> + <RowStyle BackColor="#dddddd" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> - <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> + <HeaderStyle BackColor="#666666" Font-Bold="True" ForeColor="Black" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/StyleSheet.css =================================================================== --- NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/StyleSheet.css 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.Administration.Web/App_Themes/Default/StyleSheet.css 2006-07-19 13:14:39 UTC (rev 60) @@ -3,6 +3,16 @@ font-family: Sans-Serif; } +A:link +{ + color: Blue; +} + +A:visited +{ + color: #101070; +} + .title { font-size: 24pt; @@ -41,7 +51,7 @@ .side-bar { - background-color: #999999; + background-color: #cccccc; border-right: black thin solid; vertical-align: top; height: 100%; @@ -50,15 +60,15 @@ .header-style { - background-color: #507CD1; + background-color: #666666; font-weight: bold; - color: white; + color: black; padding: 4px; } .row-style { - background-color: #EFF3FB; + background-color: #dddddd; padding: 4px; } Modified: NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs =================================================================== --- NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.Administration.Web/Login.aspx.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -5,6 +5,7 @@ using System.Net.Security; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; +using System.Runtime.Remoting.Lifetime; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Web; @@ -38,6 +39,8 @@ Session["RemoteAdministration"] = ra; Session["LocalStore"] = ra.NMailServer.LocalStore; + SetupSponsorship(ra); + foreach (ServiceStartInfo service in ra.NMailServer.Services) { if (service.Service is ISpoolService) @@ -48,5 +51,17 @@ } } } + + protected void SetupSponsorship(MarshalByRefObject o) + { + ILease lease = o.InitializeLifetimeService() as ILease; + + if (lease != null && lease.CurrentState == LeaseState.Initial) + { + lease.InitialLeaseTime = TimeSpan.FromMinutes(Session.Timeout); + lease.SponsorshipTimeout = TimeSpan.FromMinutes(Session.Timeout); + lease.RenewOnCallTime = TimeSpan.FromMinutes(Session.Timeout); + } + } } } \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.Administration.Web/ViewFolders.aspx =================================================================== --- NMail/branches/luke-dev/NMail.Administration.Web/ViewFolders.aspx 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.Administration.Web/ViewFolders.aspx 2006-07-19 13:14:39 UTC (rev 60) @@ -1,4 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ViewFolders.aspx.cs" Inherits="ViewFolders" Title="NMail Administration - Folders" %> +<%@ Reference Control="~/TaskList.ascx" %> <asp:Content ID="MainContent" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server"> <h1>Folders</h1> <asp:GridView ID="FoldersGridView" runat="server" AutoGenerateColumns="False" DataSourceID="FoldersDataSource"> Modified: NMail/branches/luke-dev/NMail.Administration.Web/ViewMailDomains.aspx =================================================================== --- NMail/branches/luke-dev/NMail.Administration.Web/ViewMailDomains.aspx 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.Administration.Web/ViewMailDomains.aspx 2006-07-19 13:14:39 UTC (rev 60) @@ -1,4 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ViewMailDomains.aspx.cs" Inherits="ViewMailDomains" Title="NMail Administration -Mail Domains" %> +<%@ Reference Control="~/TaskList.ascx" %> <asp:Content ID="MainContent" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server"> <h1>Mail Domains</h1> <asp:ObjectDataSource ID="MailDomainDataSource" runat="server" SelectMethod="GetMailDomains" TypeName="NMail.Administration.Web.MailDomainDataSource"> Added: NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.build =================================================================== --- NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.build (rev 0) +++ NMail/branches/luke-dev/NMail.PostInstall/NMail.PostInstall.build 2006-07-19 13:14:39 UTC (rev 60) @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8" ?> +<project name="nant" default="build"> + <!-- default configuration --> + <property name="project.config" value="Debug" /> + <property name="current.build.defines" value="" /> + + <target name="Debug" description="Perform a 'debug' build"> + <property name="project.config" value="Debug" /> + <property name="build.debug" value="true" /> + <property name="build.dir" value="obj/${project.config}" /> + <property name="output.dir" value="bin/${project.config}" /> + </target> + + <target name="Release" description="Perform a 'release' build"> + <property name="project.config" value="Release" /> + <property name="build.debug" value="false" /> + <property name="build.dir" value="obj/${project.config}" /> + <property name="output.dir" value="bin/${project.config}" /> + </target> + + <target name="init" description="Initializes build properties"> + <call target="${project.config}" /> + </target> + + <target name="build" depends="init" description="Builds current configuration"> + <echo message="Build Directory is [${build.dir}]" /> + <echo message="Output Directory is [${output.dir}]" /> + <!-- prepare directories --> + <mkdir dir="${build.dir}" /> + <mkdir dir="${output.dir}" /> + + <!-- copy framework-neutral libraries --> + <copy todir="${build.dir}"> + <fileset basedir="../References/NMail/${project.config}"> + <include name="NMail.dll" /> + <include name="NMail.SmtpService.dll"/> + </fileset> + </copy> + + <!-- build main assembly --> + <csc target="exe" define="${current.build.defines}" debug="${build.debug}" output="${output.dir}/NMail.PostInstall.exe" doc="${build.dir}/NMail.PostInstall.xml"> + <sources> + <include name="**.cs"/> + </sources> + <references basedir="${build.dir}"> + <include name="NMail.dll" /> + <include name="NMail.SmtpService.dll"/> + </references> + </csc> + + <!-- copy completed build to output --> + <copy todir="${output.dir}"> + <fileset basedir="${build.dir}"> + <include name="*.dll" /> + <include name="*.xml" /> + <include name="*.pdb" /> + </fileset> + </copy> + </target> + + <target name="clean" depends="init" description="Deletes temporary files created in the build process"> + <echo message="Deleting files in build directory: ${build.dir}" /> + <delete failonerror="false"> + <fileset> + <include name="${build.dir}/*.dll" /> + <include name="${build.dir}/*.xml" /> + <include name="${build.dir}/*.pdb" /> + </fileset> + </delete> + </target> + + <target name="cleanall" depends="init,clean" description="Deletes all files created in the build process"> + <echo message="Deleting files in build directory: ${output.dir}" /> + <delete failonerror="false"> + <fileset> + <include name="${output.dir}/*.dll" /> + <include name="${output.dir}/*.xml" /> + <include name="${output.dir}/*.pdb" /> + </fileset> + </delete> + </target> +</project> Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs =================================================================== --- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.Designer.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -29,7 +29,8 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Dock = System.Windows.Forms.DockStyle.Top; + this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(141, 13); this.label1.TabIndex = 0; @@ -39,12 +40,13 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(251, 32); + this.ClientSize = new System.Drawing.Size(251, 17); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "PostInstallForm"; + this.ShowInTaskbar = false; this.Text = "NMail Setup"; this.ResumeLayout(false); this.PerformLayout(); Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs =================================================================== --- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -32,7 +32,7 @@ public PostInstallForm() { InitializeComponent(); - ThreadPool.QueueUserWorkItem(new WaitCallback(SetupSmtpServiceCounters())); + ThreadPool.QueueUserWorkItem(new WaitCallback(SetupSmtpServiceCounters), null); } private void SetupSmtpServiceCounters(object unused) { @@ -56,6 +56,12 @@ "Performance counters for NMail's SMTP service.", PerformanceCounterCategoryType.SingleInstance, ccdc); + + Application.Exit(); } + + protected override void OnClosing(CancelEventArgs e) { + e.Cancel = true; + } } } \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -43,6 +43,7 @@ protected override void OnPanelDisplayed() { this.taskMap.Clear(); + this.taskListView.Items.Clear(); // Re-populate the task list foreach (Task task in this.BaseForm.Tasks) { Added: NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.build =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.build (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.build 2006-07-19 13:14:39 UTC (rev 60) @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8" ?> +<project name="nant" default="build"> + <!-- default configuration --> + <property name="project.config" value="Debug" /> + <property name="current.build.defines" value="" /> + + <target name="Debug" description="Perform a 'debug' build"> + <property name="project.config" value="Debug" /> + <property name="build.debug" value="true" /> + <property name="build.dir" value="obj/${project.config}" /> + <property name="output.dir" value="bin/${project.config}" /> + </target> + + <target name="Release" description="Perform a 'release' build"> + <property name="project.config" value="Release" /> + <property name="build.debug" value="false" /> + <property name="build.dir" value="obj/${project.config}" /> + <property name="output.dir" value="bin/${project.config}" /> + </target> + + <target name="init" description="Initializes build properties"> + <call target="${project.config}" /> + </target> + + <target name="build" depends="init" description="Builds current configuration"> + <echo message="Build Directory is [${build.dir}]" /> + <echo message="Output Directory is [${output.dir}]" /> + <!-- prepare directories --> + <mkdir dir="${build.dir}" /> + <mkdir dir="${output.dir}" /> + + <!-- copy framework-neutral libraries --> + <copy todir="${build.dir}"> + <fileset basedir="../References/"> + <include name="MySql.Data.dll"/> + </fileset> + </copy> + <copy todir="${build.dir}"> + <fileset basedir="../References/NMail/${project.config}"> + <include name="NMail.dll" /> + <include name="NMail.DnsClient.dll"/> + <include name="NMail.MessageRouter.dll"/> + <include name="NMail.SmtpClient.dll"/> + <include name="NMail.SmtpService.dll"/> + <include name="NMail.SpoolData.MySql.dll"/> + <include name="NMail.SpoolFilter.dll"/> + <include name="NMail.SpoolService.dll"/> + </fileset> + </copy> + + <!-- build main assembly --> + <csc target="exe" define="${current.build.defines}" debug="${build.debug}" output="${output.dir}/NMail.SetupWizard.exe" doc="${build.dir}/NMail.SetupWizard.xml"> + <sources> + <include name="**.cs"/> + </sources> + <references basedir="${build.dir}"> + <include name="MySql.Data.dll"/> + <include name="NMail.dll"/> + <include name="NMail.DnsClient.dll"/> + <include name="NMail.MessageRouter.dll"/> + <include name="NMail.SmtpClient.dll"/> + <include name="NMail.SmtpService.dll"/> + <include name="NMail.SpoolData.MySql.dll"/> + <include name="NMail.SpoolFilter.dll"/> + <include name="NMail.SpoolService.dll"/> + </references> + </csc> + + <!-- copy completed build to output --> + <copy todir="${output.dir}"> + <fileset basedir="${build.dir}"> + <include name="*.dll" /> + <include name="*.xml" /> + <include name="*.pdb" /> + </fileset> + </copy> + </target> + + <target name="clean" depends="init" description="Deletes temporary files created in the build process"> + <echo message="Deleting files in build directory: ${build.dir}" /> + <delete failonerror="false"> + <fileset> + <include name="${build.dir}/*.dll" /> + <include name="${build.dir}/*.xml" /> + <include name="${build.dir}/*.pdb" /> + </fileset> + </delete> + </target> + + <target name="cleanall" depends="init,clean" description="Deletes all files created in the build process"> + <echo message="Deleting files in build directory: ${output.dir}" /> + <delete failonerror="false"> + <fileset> + <include name="${output.dir}/*.dll" /> + <include name="${output.dir}/*.xml" /> + <include name="${output.dir}/*.pdb" /> + </fileset> + </delete> + </target> +</project> Modified: NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-19 13:14:39 UTC (rev 60) @@ -28,11 +28,16 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\References\MySql.Data.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.configuration" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> + <Reference Include="System.ServiceProcess" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> @@ -61,6 +66,12 @@ <Compile Include="FinalConfigPanel.Designer.cs"> <DependentUpon>FinalConfigPanel.cs</DependentUpon> </Compile> + <Compile Include="ServiceConfigPanel.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ServiceConfigPanel.Designer.cs"> + <DependentUpon>ServiceConfigPanel.cs</DependentUpon> + </Compile> <Compile Include="SmtpSubSysConfigPanel.cs"> <SubType>UserControl</SubType> </Compile> @@ -90,6 +101,10 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="ServiceConfigPanel.resx"> + <SubType>Designer</SubType> + <DependentUpon>ServiceConfigPanel.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="SmtpSubSysConfigPanel.resx"> <SubType>Designer</SubType> <DependentUpon>SmtpSubSysConfigPanel.cs</DependentUpon> Added: NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.Designer.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.Designer.cs (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.Designer.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -0,0 +1,94 @@ +namespace NMail.SetupWizard { + partial class ServiceConfigPanel { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() { + this.systemStartCheckBox = new System.Windows.Forms.CheckBox(); + this.descriptionTextBox = new System.Windows.Forms.TextBox(); + this.startNowCheckBox = new System.Windows.Forms.CheckBox(); + this.mainPanel.SuspendLayout(); + this.SuspendLayout(); + // + // titleLabel + // + this.titleLabel.Size = new System.Drawing.Size(176, 29); + this.titleLabel.Text = "NMail Service"; + // + // mainPanel + // + this.mainPanel.Controls.Add(this.startNowCheckBox); + this.mainPanel.Controls.Add(this.descriptionTextBox); + this.mainPanel.Controls.Add(this.systemStartCheckBox); + // + // systemStartCheckBox + // + this.systemStartCheckBox.AutoSize = true; + this.systemStartCheckBox.Location = new System.Drawing.Point(35, 68); + this.systemStartCheckBox.Name = "systemStartCheckBox"; + this.systemStartCheckBox.Size = new System.Drawing.Size(200, 17); + this.systemStartCheckBox.TabIndex = 0; + this.systemStartCheckBox.Text = "Start NMail service at system startup."; + this.systemStartCheckBox.UseVisualStyleBackColor = true; + // + // descriptionTextBox + // + this.descriptionTextBox.BackColor = System.Drawing.Color.White; + this.descriptionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.descriptionTextBox.Location = new System.Drawing.Point(8, 8); + this.descriptionTextBox.Multiline = true; + this.descriptionTextBox.Name = "descriptionTextBox"; + this.descriptionTextBox.ReadOnly = true; + this.descriptionTextBox.Size = new System.Drawing.Size(343, 40); + this.descriptionTextBox.TabIndex = 2; + this.descriptionTextBox.TabStop = false; + this.descriptionTextBox.Text = "NMail has a Windows service that it runs in. Please configure the startup options" + + " for that service below."; + // + // startNowCheckBox + // + this.startNowCheckBox.AutoSize = true; + this.startNowCheckBox.Location = new System.Drawing.Point(35, 91); + this.startNowCheckBox.Name = "startNowCheckBox"; + this.startNowCheckBox.Size = new System.Drawing.Size(141, 17); + this.startNowCheckBox.TabIndex = 3; + this.startNowCheckBox.Text = "Start NMail service now."; + this.startNowCheckBox.UseVisualStyleBackColor = true; + // + // ServiceConfigPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "ServiceConfigPanel"; + this.mainPanel.ResumeLayout(false); + this.mainPanel.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.CheckBox systemStartCheckBox; + private System.Windows.Forms.TextBox descriptionTextBox; + private System.Windows.Forms.CheckBox startNowCheckBox; + } +} Added: NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.cs (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.ServiceProcess; +using System.Windows.Forms; + +using Microsoft.Win32; + +namespace NMail.SetupWizard { + public partial class ServiceConfigPanel : BasePanel { + public ServiceConfigPanel(BaseForm baseForm, BasePanel previous) : base(baseForm) { + InitializeComponent(); + + this.PreviousPanel = previous; + this.NextPanel = new FinalConfigPanel(this.BaseForm, this); + + // Setup the tasks for this panel + this.configServiceTask = new Task("Configure NMail service startup.", new TaskDelegate(configureServiceStartup)); + this.startNMailTask = new Task("Start the NMail service.", new TaskDelegate(startNMailNow)); + + // Find the NMail service controller + ServiceController[] services = ServiceController.GetServices(); + + foreach (ServiceController service in services) { + if (service.DisplayName == "NMail Server") { + this.nmailServiceController = service; + break; + } + } + } + + private ServiceController nmailServiceController; + + private Task startNMailTask; + + /// <summary> + /// The task delegate used to start the NMail service. + /// </summary> + /// <param name="message">An error message if any problems occur.</param> + /// <returns>The result of hte start attempt.</returns> + private TaskResult startNMailNow(out string message) { + try { + if (this.nmailServiceController.Status == ServiceControllerStatus.Stopped) { + this.nmailServiceController.Start(); + } + + message = null; + return TaskResult.Ok; + + } catch (Exception e) { + message = "Error starting NMail service: " + e.Message; + return TaskResult.Error; + } + } + + private Task configServiceTask; + + private TaskResult configureServiceStartup(out string message) { + try { + RegistryKey serviceKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Services\NMail.Server.Service.exe", true); + + if (serviceKey == null) { + message = "Can't find NMail service configured on this system."; + return TaskResult.Error; + } + + if (this.systemStartCheckBox.Checked) { + // Start at startup + serviceKey.SetValue("Start", 2); + + } else { + // Don't start at startup + serviceKey.SetValue("Start", 3); + } + + message = null; + return TaskResult.Ok; + + } catch (Exception e) { + message = "Error configuring NMail service: " + e.Message; + return TaskResult.Error; + } + } + + protected override void OnNextButtonClick() { + if (!this.BaseForm.Tasks.Contains(this.configServiceTask)) { + this.BaseForm.Tasks.Add(this.configServiceTask); + } + + if (this.startNowCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.startNMailTask)) { + this.BaseForm.Tasks.Add(this.startNMailTask); + } + + base.OnNextButtonClick(); + } + + protected override void OnBackButtonClick() { + this.BaseForm.Tasks.Remove(this.startNMailTask); + this.BaseForm.Tasks.Remove(this.configServiceTask); + + base.OnBackButtonClick(); + } + } +} Added: NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.resx =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.resx (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/ServiceConfigPanel.resx 2006-07-19 13:14:39 UTC (rev 60) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs 2006-07-19 13:14:39 UTC (rev 60) @@ -23,6 +23,8 @@ using System.Text; using System.Windows.Forms; +using MySql.Data.MySqlClient; + using NMail.Configuration; using NMail.DataTypes; using NMail.MessageRouter.Configuration; @@ -38,7 +40,7 @@ InitializeComponent(); this.PreviousPanel = previous; - this.NextPanel = new FinalConfigPanel(this.BaseForm, this); + this.NextPanel = new ServiceConfigPanel(this.BaseForm, this); // If any of these are present consider it all enabled if (SmtpClientConfiguration.ConfigurationPresent @@ -63,9 +65,41 @@ } else { this.relayList.Items.Add(new WildcardHost("localhost")); } + + this.makeTablesTask = new Task("Create tables for SMTP spool.", new TaskDelegate(makeSpoolTables)); } + private Task makeTablesTask; + /// <summary> + /// The code that attempts to create the tables needed for the SMTP spool. + /// </summary> + /// <param name="message">A message if an error occurs.</param> + /// <returns>The result of the attempt to create the tables.</returns> + private TaskResult makeSpoolTables(out string message) { + try { + MySqlConnection cnn = new MySqlConnection(); + cnn.ConnectionString = this.mySqlCnnStrTextBox.Text; + + while (cnn.State == ConnectionState.Closed) { + try { + cnn.Open(); + } catch (MySqlException ex) { + //if (ex.Number + message = ex.Number.ToString(); + } + } + + message = "Not implemented yet..."; + return TaskResult.Warning; + + } catch (Exception e) { + message = "Error creating SMTP spool tables: " + e.Message; + return TaskResult.Error; + } + } + + /// <summary> /// Stores the settings into the configuration objects. /// </summary> private void storeConfiguration() { @@ -93,9 +127,9 @@ // Save the relay hosts ssc.RelaySubnets.Clear(); - foreach (WildcardHost host in this.relayList.Items) { + foreach (string host in this.relayList.Items) { WildcardHostConfigurationElement element = new WildcardHostConfigurationElement(); - element.Match = host.ToString(); + element.Match = host; ssc.RelaySubnets.Add(element); } @@ -118,8 +152,8 @@ this.visibleHostTextBox.Text = ssc.VisibleHost.ToString(); this.mySqlCnnStrTextBox.Text = msdc.ConnectionString; - foreach (WildcardHostElementCollection host in ssc.RelaySubnets) { - this.relayList.Items.Add(host); + for (int i = 0; i < ssc.RelaySubnets.Count; i++) { + this.relayList.Items.Add(ssc.RelaySubnets[i].Match); } } @@ -159,7 +193,17 @@ return; } + if (this.regenDbCheckBox.Checked && !this.BaseForm.Tasks.Contains(this.makeTablesTask)) { + this.BaseForm.Tasks.Add(this.makeTablesTask); + } + base.OnNextButtonClick(); } + + protected override void OnBackButtonClick() { + this.BaseForm.Tasks.Remove(this.makeTablesTask); + + base.OnBackButtonClick(); + } } } \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.build =================================================================== --- NMail/branches/luke-dev/NMail.build 2006-07-15 12:15:25 UTC (rev 59) +++ NMail/branches/luke-dev/NMail.build 2006-07-19 13:14:39 UTC (rev 60) @@ -22,6 +22,8 @@ build-NMail.ImapService, build-NMail.DnsClient, build-NMail.Server.Service, + build-NMail.SetupWizard, + build-NMail.PostInstall, build-NMail.Administration.Console" /> <target name="init-build" description="Prepares the build directory"> @@ -40,7 +42,7 @@ </target> <target name="build-NMail.Server.Console" depends="init-build,build-MonoPrivileges,build-NMail,build-NMail.Server" description="Builds the NMail Console Server executable"> - <!-- build NMail.Server Server.Console --> + <!-- build NMail.Server.Console --> <nant buildfile="NMail.Server.Console/NMail.Server.Console.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="NMail.Server.Console/bin/${project.config}"> @@ -50,7 +52,7 @@ </target> <target name="build-MonoPrivileges" depends="init-build" description="Builds the Mono Privileges library"> - <!-- build NMail.Server MessageRouter --> + <!-- build NMail.MonoPrivileges--> <nant buildfile="MonoPrivileges/MonoPrivileges.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="MonoPrivileges/bin/${project.config}"> @@ -60,7 +62,7 @@ </target> <target name="build-NMail.MessageRouter" depends="init-build,build-NMail,build-NMail.SmtpClient,build-NMail.SmtpService" description="Builds the NMail Message Router library"> - <!-- build NMail.Server MessageRouter --> + <!-- build NMail.MessageRouter --> <nant buildfile="NMail.MessageRouter/NMail.MessageRouter.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="NMail.MessageRouter/bin/${project.config}"> @@ -130,7 +132,7 @@ </target> <target name="build-NMail.LocalStoreData.MySql" depends="init-build,build-NMail" description="Builds the NMail Local Store-data Mysql library"> - <!-- build NMail.LocalStore assembly --> + <!-- build NMail.LocalStoreData.MySql assembly --> <nant buildfile="NMail.LocalStoreData.MySql/NMail.LocalStoreData.MySql.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="NMail.LocalStoreData.MySql/bin/${project.config}"> @@ -190,7 +192,7 @@ </target> <target name="build-NMail.Server.Service" depends="init-build,build-NMail,build-NMail.Server" description="Builds the NMail Windows Service executable."> - <!-- build NMail Server Service assembly --> + <!-- build NMail.Server.Service assembly --> <nant buildfile="NMail.Server.Service/NMail.Server.Service.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="NMail.Server.Service/bin/${project.config}"> @@ -199,8 +201,39 @@ </copy> </target> + <target name="build-NMail.PostInstall" depends="init-build,build-NMail,build-NMail.SmtpService" description="Builds the NMail post install executable."> + <!-- build NMail.PostInstall assembly --> + <nant buildfile="NMail.PostInstall/NMail.PostInstall.build" target="build" /> + <copy todir="References/NMail/${project.config}"> + <fileset basedir="NMail.PostInstall/bin/${project.config}"> + <include name="NMail.PostInstall.exe" /> + </fileset> + </copy> + </target> + + <target name="build-NMail.SetupWizard" + description="Builds the NMail setup wizard executable." + depends="build-NMail.MessageRouter, + build-NMail.SmtpClient, + build-NMail.SmtpService, + build-NMail.SpoolData.MySql, + build-NMail.SpoolFilter, + build-NMail.SpoolService, + build-NMail.LocalStoreData.MySql, + build-NMail.LocalStore, + build-NMail.ImapService, + build-NMail.DnsClient"> + <!-- build NMail.SetupWizard assembly --> + <nant buildfile="NMail.SetupWizard/NMail.SetupWizard.build" target="build" /> + <copy todir="References/NMail/${project.config}"> + <fileset basedir="NMail.SetupWizard/bin/${project.config}"> + <include name="NMail.SetupWizard.exe" /> + </fileset> + </copy> + </target> + <target name="build-NMail.Administration.Console" depends="init-build,build-NMail,build-NMail.Server" description="Builds the NMail administration console executable."> - <!-- build NMail Administration Console assembly --> + <!-- build NMail.Administration.Console assembly --> <nant buildfile="NMail.Administration.Console/NMail.Administration.Console.build" target="build" /> <copy todir="References/NMail/${project.config}"> <fileset basedir="NMail.Administration.Console/bin/${project.config}"> @@ -212,7 +245,7 @@ <target name="build-NMail.Administration.Web" depends="init-build,build-NMail,build-NMail.Server" description="Builds the NMail administration web site."> <mkdir dir="NMail.Administration.Web.Compiled" /> - <!-- build NMail Administration Web site--> + <!-- build NMail.Administration.Web site--> <exec program="aspnet_compiler" verbose="true"> <arg value="-v" /> <arg value="/NMailAdmin" /> @@ -227,7 +260,7 @@ </target> <target name="build-Installer" depends="assemblies, build-NMail.Administration.Web" description="Builds the NMail Server installer."> - <!-- build NMail installer --> + <!-- build NMail.installer --> <nant buildfile="Installer/NMail-installer.build" target="package" /> </target> @@ -246,6 +279,8 @@ <nant buildfile="NMail.ImapService/NMail.ImapService.build" target="clean" /> <nant buildfile="NMail.DnsClient/NMail.DnsClient.build" target="clean" /> <nant buildfile="NMail.Server.Service/NMail.Server.Service.build" target="clean" /> + <nant buildfile="NMail.PostInstall/NMail.PostInstall.build" target="clean" /> + <nant buildfile="NMail.SetupWizard/NMail.SetupWizard.build" target="clean" /> <nant buildfile="NMail.Administration.Console/NMail.Administration.Console.build" target="clean" /> <delete dir="NMail.Administration.Web.Compiled" /> </target> @@ -264,6 +299,8 @@ <nant buildfile="NMail.LocalStore/NMail.LocalStore.build" target="cleanall" /> <nant buildfile="NMail.ImapService/NMail.ImapService.build" target="cleanall" /> <nant buildfile="NMail.DnsClient/NMail.DnsClient.build" target="cleanall" /> + <nant buildfile="NMail.PostInstall/NMail.PostInstall.build" target="cleanall" /> + <nant buildfile="NMail.SetupWizard/NMail.SetupWizard.build" target="cleanall" /> <nant buildfile="NMail.Server.Service/NMail.Server.Service.build" target="cleanall" /> <nant buildfile="NMail.Administration.Console/NMail.Administration.Console.build" target="cleanall" /> <delete dir="NMail.Administration.Web.Compiled" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <tmy...@us...> - 2006-07-15 12:16:30
|
Revision: 59 Author: tmyroadctfig Date: 2006-07-15 05:15:25 -0700 (Sat, 15 Jul 2006) ViewCVS: http://svn.sourceforge.net/nmailserver/?rev=59&view=rev Log Message: ----------- Work on setup wizard. Modified Paths: -------------- NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs NMail/branches/luke-dev/NMail/DataTypes/Domain.cs NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs NMail/branches/luke-dev/NMail/NMail.csproj NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs NMail/branches/luke-dev/NMail.PostInstall/Program.cs NMail/branches/luke-dev/NMail.Server.Console/NMail.config NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj NMail/branches/luke-dev/NMail.SetupWizard/Program.cs NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs NMail/branches/luke-dev/NMail.SetupWizard/WelcomePanel.cs NMail/branches/luke-dev/NMail.SmtpClient/Configuration/SmtpClientConfiguration.cs NMail/branches/luke-dev/NMail.SmtpService/Configuration/SmtpServiceConfiguration.cs NMail/branches/luke-dev/NMail.SpoolData.MySql/Configuration/MySqlSpoolDataConfiguration.cs NMail/branches/luke-dev/NMail.SpoolFilter/Configuration/SpoolFilterConfiguration.cs NMail/branches/luke-dev/NMail.SpoolService/Configuration/SpoolServiceConfiguration.cs Added Paths: ----------- NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx NMail/branches/luke-dev/NMail.SetupWizard/Resources/ NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png NMail/branches/luke-dev/NMail.SetupWizard/Resources/ok.png NMail/branches/luke-dev/NMail.SetupWizard/Resources/pending.png NMail/branches/luke-dev/NMail.SetupWizard/Resources/warning.png NMail/branches/luke-dev/NMail.SetupWizard/Task.cs Added: NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs =================================================================== --- NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs (rev 0) +++ NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Text; + +namespace NMail.Configuration { + public class NMailConfigFile { + /// <summary> + /// Opens the configuration files and sets up the shared instance of this config. + /// </summary> + static NMailConfigFile() { + current = OpenConfig("NMail.config"); + } + + private static System.Configuration.Configuration current; + + public static System.Configuration.Configuration Current { + get { + return current; + } + set { + current = value; + } + } + + public static System.Configuration.Configuration OpenConfig(string configFilename) { + ExeConfigurationFileMap cfm = new ExeConfigurationFileMap(); + cfm.ExeConfigFilename = configFilename; + return ConfigurationManager.OpenMappedExeConfiguration(cfm, ConfigurationUserLevel.None); + } + } +} Modified: NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs =================================================================== --- NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -31,38 +31,37 @@ /// The global NMail configuration. /// </summary> public class NMailConfiguration : ConfigurationSection { - /// <summary> - /// Opens the configuration files and sets up the shared instance of this config. + /// Adds a NMail configuration section to the current config file. /// </summary> - static NMailConfiguration() { - ExeConfigurationFileMap cfm = new ExeConfigurationFileMap(); - cfm.ExeConfigFilename = "NMail.config"; - configFile = ConfigurationManager.OpenMappedExeConfiguration(cfm, ConfigurationUserLevel.None); - current = (NMailConfiguration) configFile.GetSection("NMail"); + public static void AddToConfigFile() { + if (NMailConfigFile.Current.Sections["NMail"] == null) { + NMailConfigFile.Current.Sections.Add("NMail", new NMailConfiguration()); + } } - private static System.Configuration.Configuration configFile; - /// <summary> - /// Gets the configuration section for the given section name. + /// Returns true if a NMail configuration section exists in the current + /// configuration. /// </summary> - /// <param name="sectionName">The section name to lookup.</param> - /// <returns>The configuration section.</returns> - public static ConfigurationSection GetSection(string sectionName) { - return configFile.GetSection(sectionName); + public static bool ConfigurationPresent { + get { + return (NMailConfigFile.Current.Sections["NMail"] != null); + } } - private static NMailConfiguration current; - /// <summary> /// Returns the current NMail configuration. /// </summary> public static NMailConfiguration Current { get { + NMailConfiguration current; + current = (NMailConfiguration) NMailConfigFile.Current.GetSection("NMail"); + if (current == null) { throw new ConfigurationErrorsException("NMail configuration is missing"); } + return current; } } Modified: NMail/branches/luke-dev/NMail/DataTypes/Domain.cs =================================================================== --- NMail/branches/luke-dev/NMail/DataTypes/Domain.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail/DataTypes/Domain.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -210,6 +210,11 @@ /// <summary> /// The "localhost" domain. /// </summary> - public static readonly Domain LocalHost = new Domain("localhost"); + public static readonly Domain LocalHost = new Domain(LocalHostString); + + /// <summary> + /// The "localhost" string. + /// </summary> + public const string LocalHostString = "localhost"; } } Modified: NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs =================================================================== --- NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,3 +1,20 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.Text; Modified: NMail/branches/luke-dev/NMail/NMail.csproj =================================================================== --- NMail/branches/luke-dev/NMail/NMail.csproj 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail/NMail.csproj 2006-07-15 12:15:25 UTC (rev 59) @@ -117,6 +117,7 @@ <Compile Include="Configuration\NMailConfiguration.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Configuration\NMailConfigFile.cs" /> <Compile Include="Configuration\ObjectConfigurationElement.cs" /> <Compile Include="Configuration\ObjectConfigurationElementCollection.cs" /> <Compile Include="Configuration\WildcardHostElementCollection.cs" /> Modified: NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs =================================================================== --- NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -28,17 +28,33 @@ /// DNS client configuration. /// </summary> public class DnsClientConfiguration : ConfigurationSection { - private static DnsClientConfiguration current; + /// <summary> + /// Adds a DNS client configuration section to the current config file. + /// </summary> + public static void AddToConfigFile() { + if (NMailConfigFile.Current.Sections["NMail.DnsClient"] == null) { + NMailConfigFile.Current.Sections.Add("NMail.DnsClient", new DnsClientConfiguration()); + } + } - static DnsClientConfiguration() { - current = (DnsClientConfiguration) NMailConfiguration.GetSection("NMail.DnsClient"); + /// <summary> + /// Returns true if a DNS client configuration section exists in the current + /// configuration. + /// </summary> + public static bool ConfigurationPresent { + get { + return (NMailConfigFile.Current.Sections["NMail.DnsClient"] != null); + } } /// <summary> - /// Returns the current NMail configuration. + /// Returns the current DNS client configuration. /// </summary> public static DnsClientConfiguration Current { get { + DnsClientConfiguration current; + current = (DnsClientConfiguration) NMailConfigFile.Current.GetSection("NMail.DnsClient"); + if (current == null) { throw new ConfigurationErrorsException("NMail DNS Client configuration is missing"); } Modified: NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs =================================================================== --- NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -33,7 +33,7 @@ private static ImapServiceConfiguration current; static ImapServiceConfiguration() { - current = (ImapServiceConfiguration) NMailConfiguration.GetSection("NMail.ImapService"); + current = (ImapServiceConfiguration) NMailConfigFile.Current.GetSection("NMail.ImapService"); } /// <summary> Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs =================================================================== --- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -32,7 +32,7 @@ private static MySqlLocalStoreDataConfiguration current; static MySqlLocalStoreDataConfiguration() { - current = (MySqlLocalStoreDataConfiguration) NMailConfiguration.GetSection("NMail.LocalStoreData.MySql"); + current = (MySqlLocalStoreDataConfiguration) NMailConfigFile.Current.GetSection("NMail.LocalStoreData.MySql"); } public static MySqlLocalStoreDataConfiguration Current { Modified: NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs =================================================================== --- NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -29,15 +29,22 @@ /// </summary> public class MessageRouterConfiguration : ConfigurationSection { /// <summary> - /// The current configuration in use. + /// Adds a message router configuration section to the current config file. /// </summary> - private static MessageRouterConfiguration current; + public static void AddToConfigFile() { + if (NMailConfigFile.Current.Sections["NMail.MessageRouter"] == null) { + NMailConfigFile.Current.Sections.Add("NMail.MessageRouter", new MessageRouterConfiguration()); + } + } /// <summary> - /// Sets up the current configuration. + /// Returns true if a message router configuration section exists in the current + /// configuration. /// </summary> - static MessageRouterConfiguration() { - current = (MessageRouterConfiguration) NMailConfiguration.GetSection("NMail.MessageRouter"); + public static bool ConfigurationPresent { + get { + return (NMailConfigFile.Current.Sections["NMail.MessageRouter"] != null); + } } /// <summary> @@ -45,6 +52,9 @@ /// </summary> public static MessageRouterConfiguration Current { get { + MessageRouterConfiguration current; + current = (MessageRouterConfiguration) NMailConfigFile.Current.GetSection("NMail.MessageRouter"); + if (current == null) { throw new ConfigurationErrorsException("NMail Message Router configuration is missing"); } Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs =================================================================== --- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,3 +1,20 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.ComponentModel; @@ -5,6 +22,7 @@ using System.Diagnostics; using System.Drawing; using System.Text; +using System.Threading; using System.Windows.Forms; using NMail.SmtpService; @@ -14,10 +32,10 @@ public PostInstallForm() { InitializeComponent(); - SetupSmtpServiceCounters(); + ThreadPool.QueueUserWorkItem(new WaitCallback(SetupSmtpServiceCounters())); } - private void SetupSmtpServiceCounters() { + private void SetupSmtpServiceCounters(object unused) { if (PerformanceCounterCategory.Exists(SmtpService.SmtpService.PerfCounterCategory)) { // Remove any old performance counters if they are present PerformanceCounterCategory.Delete(SmtpService.SmtpService.PerfCounterCategory); Modified: NMail/branches/luke-dev/NMail.PostInstall/Program.cs =================================================================== --- NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,3 +1,20 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.Windows.Forms; Modified: NMail/branches/luke-dev/NMail.Server.Console/NMail.config =================================================================== --- NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-07-15 12:15:25 UTC (rev 59) @@ -81,51 +81,6 @@ <NMail.SpoolFilterService> <Filter Type="NMail.SpoolFilter.NoActionFilter, NMail.SpoolFilter" /> </NMail.SpoolFilterService> - - <NMail.LocalStore> - <DeliveryActions> - <DeliveryAction Name="virusScan" Type="NMail.LocalStore.DeliveryActions.ClamAvScanner, NMail.LocalStore" /> - <DeliveryAction Name="manageWhiteList" Type="NMail.LocalStore.DeliveryActions.ManageWhiteList, NMail.LocalStore" /> - </DeliveryActions> - - <!--<DefaultValidator Name="onWhiteList" Type="NMail.LocalStore.Validators.OnWhiteList, NMail.LocalStore">--> - - <!--<FailValidator Name="sender" Type="NMail.LocalStore.Validators.AddressSender, NMail.LocalStore">--> - - <!-- <failValidator name="date" type="NMail.LocalStore.Validators.AddressDate, NMail.LocalStore"> - - <failValidator name="keyword" type="NMail.LocalStore.Validators.AddressKeyword, NMail.LocalStore"> - - <failValidator name="blackList" type="NMail.LocalStore.Validators.OrdbBlackList, NMail.LocalStore"> - <settings server="relays.ordb.org"/> - </failValidator> - </failValidator> - </failValidator>--> - <!--</FailValidator>--> - <!--</DefaultValidator>--> - - <AcceptCases> - <AcceptCase> - <AcceptHosts> - <Accept Match="localhost" /> - <!-- <Accept Match="mydomain.local" /> --> - </AcceptHosts> - - <AllowedDeliveryActions> - <DeliveryAction Name="mv" Type="NMail.LocalStore.DeliveryActions.Move, NMail.LocalStore" /> - <DeliveryAction Name="cp" Type="NMail.LocalStore.DeliveryActions.Copy, NMail.LocalStore" /> - </AllowedDeliveryActions> - - <AllowedRecipientValidators> - <RecipientValidator Name="blackList" Type="NMail.LocalStore.Validators.OrdbBlackList, NMail.LocalStore"/> - </AllowedRecipientValidators> - - <MailboxMappings> - <MailboxMapping Type="NMail.LocalStoreData.MySql.MySqlLocalStoreData, NMail.LocalStoreData.MySql" /> - </MailboxMappings> - </AcceptCase> - </AcceptCases> - </NMail.LocalStore> <NMail.SpoolData.MySql ConnectionString="Database=NMailSpool;Uid=NMail;Password=moo" /> Modified: NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,11 +1,32 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.ComponentModel; +using System.Configuration; using System.Data; using System.Drawing; using System.Text; +using System.Threading; using System.Windows.Forms; +using NMail.Configuration; + namespace NMail.SetupWizard { public partial class BaseForm : Form { public BaseForm() { @@ -18,5 +39,13 @@ panel.Dock = DockStyle.Fill; this.Controls.Add(panel); } + + private List<Task> taskList = new List<Task>(); + + public List<Task> Tasks { + get { + return this.taskList; + } + } } } \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -43,7 +43,7 @@ this.nextButton.TabIndex = 2; this.nextButton.Text = "Next >"; this.nextButton.UseVisualStyleBackColor = true; - this.nextButton.Click += new System.EventHandler(this.OnNextButtonClick); + this.nextButton.Click += new System.EventHandler(this.NextButton_Click); // // titleLabel // @@ -81,7 +81,7 @@ this.backButton.TabIndex = 1; this.backButton.Text = "< Back"; this.backButton.UseVisualStyleBackColor = true; - this.backButton.Click += new System.EventHandler(this.OnBackButtonClick); + this.backButton.Click += new System.EventHandler(this.BackButton_Click); // // cancelButton // @@ -91,7 +91,7 @@ this.cancelButton.TabIndex = 0; this.cancelButton.Text = "Cancel"; this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.OnCancelButtonClick); + this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); // // leftPanel // Modified: NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,3 +1,20 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.ComponentModel; @@ -49,20 +66,39 @@ } } - protected virtual void OnCancelButtonClick(object sender, EventArgs e) { + #region Private Event Handlers + + private void CancelButton_Click(object sender, EventArgs e) { + OnCancelButtonClick(); + } + + private void BackButton_Click(object sender, EventArgs e) { + OnBackButtonClick(); + } + + private void NextButton_Click(object sender, EventArgs e) { + OnNextButtonClick(); + } + #endregion + + protected virtual void OnCancelButtonClick() { this.BaseForm.Close(); } - protected virtual void OnBackButtonClick(object sender, EventArgs e) { + protected virtual void OnBackButtonClick() { if (this.PreviousPanel != null) { this.BaseForm.SetPanel(this.PreviousPanel); + this.PreviousPanel.OnPanelDisplayed(); } } - protected virtual void OnNextButtonClick(object sender, EventArgs e) { + protected virtual void OnNextButtonClick() { if (this.NextPanel != null) { this.BaseForm.SetPanel(this.NextPanel); + this.NextPanel.OnPanelDisplayed(); } } + + protected virtual void OnPanelDisplayed() { } } } Modified: NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,3 +1,20 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; using System.ComponentModel; @@ -7,14 +24,37 @@ using System.Text; using System.Windows.Forms; +using NMail.Configuration; +using NMail.DnsClient.Configuration; + namespace NMail.SetupWizard { public partial class DnsConfigPanel : BasePanel { + + private DnsClientConfiguration config; + public DnsConfigPanel(BaseForm baseForm, BasePanel previous) : base(baseForm) { InitializeComponent(); this.PreviousPanel = previous; - this.dnsList.Items.Add(IPAddress.Loopback); this.NextPanel = new SmtpSubSysConfigPanel(this.BaseForm, this); + + // Ensure the config has a dns client section + if (!DnsClientConfiguration.ConfigurationPresent) { + DnsClientConfiguration.AddToConfigFile(); + } + + config = DnsClientConfiguration.Current; + + if (config.DnsServers.Count > 0) { + // Add any DNS servers from the current config + for (int i = 0; i < this.config.DnsServers.Count; i++) { + this.dnsList.Items.Add(this.config.DnsServers[i].Address); + } + + } else { + // If there were non configured, add localhost + this.dnsList.Items.Add(IPAddress.Loopback); + } } private void addBtn_Click(object sender, EventArgs e) { @@ -39,5 +79,19 @@ this.dnsList.Items.RemoveAt(this.dnsList.SelectedIndex); } } + + protected override void OnNextButtonClick() { + // Clear the list of DNS servers + DnsClientConfiguration.Current.DnsServers.Clear(); + + // Add the list of configured DNS servers + foreach (IPAddress server in this.dnsList.Items) { + IPAddressElement element = new IPAddressElement(); + element.Address = server; + DnsClientConfiguration.Current.DnsServers.Add(element); + } + + base.OnNextButtonClick(); + } } } Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -0,0 +1,100 @@ +namespace NMail.SetupWizard { + partial class FinalConfigPanel { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.taskListView = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.imageList = new System.Windows.Forms.ImageList(this.components); + this.descriptionTextBox = new System.Windows.Forms.TextBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.mainPanel.SuspendLayout(); + this.SuspendLayout(); + // + // titleLabel + // + this.titleLabel.Size = new System.Drawing.Size(145, 29); + this.titleLabel.Text = "Final Steps"; + // + // mainPanel + // + this.mainPanel.Controls.Add(this.descriptionTextBox); + this.mainPanel.Controls.Add(this.taskListView); + // + // taskListView + // + this.taskListView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.taskListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1}); + this.taskListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.taskListView.Location = new System.Drawing.Point(65, 63); + this.taskListView.MultiSelect = false; + this.taskListView.Name = "taskListView"; + this.taskListView.Size = new System.Drawing.Size(232, 211); + this.taskListView.SmallImageList = this.imageList; + this.taskListView.TabIndex = 0; + this.taskListView.UseCompatibleStateImageBehavior = false; + this.taskListView.View = System.Windows.Forms.View.Details; + // + // imageList + // + this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.imageList.ImageSize = new System.Drawing.Size(16, 16); + this.imageList.TransparentColor = System.Drawing.Color.Transparent; + // + // descriptionTextBox + // + this.descriptionTextBox.BackColor = System.Drawing.Color.White; + this.descriptionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.descriptionTextBox.Location = new System.Drawing.Point(8, 8); + this.descriptionTextBox.Multiline = true; + this.descriptionTextBox.Name = "descriptionTextBox"; + this.descriptionTextBox.ReadOnly = true; + this.descriptionTextBox.Size = new System.Drawing.Size(343, 40); + this.descriptionTextBox.TabIndex = 2; + this.descriptionTextBox.TabStop = false; + this.descriptionTextBox.Text = "The NMail setup is almost complete. Below are a list of actions that will be perf" + + "ormed, click \"Next\" to continue."; + // + // FinalConfigPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "FinalConfigPanel"; + this.mainPanel.ResumeLayout(false); + this.mainPanel.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView taskListView; + private System.Windows.Forms.TextBox descriptionTextBox; + private System.Windows.Forms.ImageList imageList; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ToolTip toolTip; + + } +} Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -0,0 +1,113 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +namespace NMail.SetupWizard { + public partial class FinalConfigPanel : BasePanel { + public FinalConfigPanel(BaseForm baseForm, BasePanel previous) : base(baseForm) { + InitializeComponent(); + + this.PreviousPanel = previous; + + this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.pending); + this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.ok); + this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.warning); + this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.error); + + this.taskListView.Columns[0].Width = this.taskListView.Width; + } + + private Dictionary<Task, ListViewItem> taskMap = new Dictionary<Task, ListViewItem>(); + + protected override void OnPanelDisplayed() { + this.taskMap.Clear(); + + // Re-populate the task list + foreach (Task task in this.BaseForm.Tasks) { + ListViewItem item = new ListViewItem(task.Description, 0); + item.Tag = task; + this.taskMap.Add(task, item); + this.taskListView.Items.Add(item); + } + } + + private bool tasksRun = false; + + protected override void OnNextButtonClick() { + lock (this) { + if (!this.tasksRun) { + // Disable the buttons and start running the tasks + this.tasksRun = true; + this.nextButton.Enabled = false; + this.backButton.Enabled = false; + this.cancelButton.Enabled = false; + + ThreadPool.QueueUserWorkItem(new WaitCallback(processTasks)); + + } else { + this.BaseForm.Close(); + } + } + } + + private void processTasks(object unused) { + foreach (Task task in this.BaseForm.Tasks) { + string message; + + TaskResult result = task.TaskProcessing(out message); + + // Update the task list with the result from this task + object[] updateArgs = { task, result, message }; + this.Invoke(new updateTaskDelegate(updateTask), updateArgs); + } + + object[] args = { null }; + this.BeginInvoke(new WaitCallback(enableFinishButton), args); + } + + delegate void updateTaskDelegate(Task task, TaskResult result, string message); + + public void updateTask(Task task, TaskResult result, string message) { + ListViewItem item = this.taskMap[task]; + + if (result == TaskResult.Error) { + item.ImageIndex = 3; + item.ToolTipText = message; + } else if (result == TaskResult.Warning) { + item.ImageIndex = 2; + item.ToolTipText = message; + } else { + item.ImageIndex = 1; + } + } + + public void enableFinishButton(object o) { + this.nextButton.Text = "Finish"; + this.nextButton.Enabled = true; + this.backButton.Enabled = false; + this.cancelButton.Enabled = false; + } + } +} Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx (rev 0) +++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx 2006-07-15 12:15:25 UTC (rev 59) @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>116, 17</value> + </metadata> +</root> \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-15 12:15:25 UTC (rev 59) @@ -29,6 +29,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.configuration" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> @@ -54,6 +55,12 @@ <Compile Include="DnsConfigPanel.Designer.cs"> <DependentUpon>DnsConfigPanel.cs</DependentUpon> </Compile> + <Compile Include="FinalConfigPanel.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="FinalConfigPanel.Designer.cs"> + <DependentUpon>FinalConfigPanel.cs</DependentUpon> + </Compile> <Compile Include="SmtpSubSysConfigPanel.cs"> <SubType>UserControl</SubType> </Compile> @@ -74,6 +81,10 @@ <SubType>Designer</SubType> <DependentUpon>DnsConfigPanel.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="FinalConfigPanel.resx"> + <SubType>Designer</SubType> + <DependentUpon>FinalConfigPanel.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> @@ -90,6 +101,7 @@ <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> + <DesignTime>True</DesignTime> </Compile> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> @@ -100,6 +112,7 @@ <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> + <Compile Include="Task.cs" /> <Compile Include="WelcomePanel.cs"> <SubType>UserControl</SubType> </Compile> @@ -108,11 +121,51 @@ </Compile> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\NMail.DnsClient\NMail.DnsClient.csproj"> + <Project>{103510D8-6042-4556-98A2-9FD10D215454}</Project> + <Name>NMail.DnsClient</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.MessageRouter\NMail.MessageRouter.csproj"> + <Project>{0AB0E8BA-8CAE-479E-AC85-8255103A107C}</Project> + <Name>NMail.MessageRouter</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.SmtpClient\NMail.SmtpClient.csproj"> + <Project>{8CDAF015-FF14-4960-BC91-6F2618A6FED3}</Project> + <Name>NMail.SmtpClient</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.SmtpService\NMail.SmtpService.csproj"> + <Project>{AEFF4DA8-7243-44C2-8223-69035380B042}</Project> + <Name>NMail.SmtpService</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.SpoolData.MySql\NMail.SpoolData.MySql.csproj"> + <Project>{68D6D57F-02CC-419F-8D69-3B479A1BFBED}</Project> + <Name>NMail.SpoolData.MySql</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.SpoolFilter\NMail.SpoolFilter.csproj"> + <Project>{1C585C54-6FE4-47F5-9A1F-8437F412DCF5}</Project> + <Name>NMail.SpoolFilter</Name> + </ProjectReference> + <ProjectReference Include="..\NMail.SpoolService\NMail.SpoolService.csproj"> + <Project>{81EA6856-1AA7-4278-B0CC-1F851B987DA0}</Project> + <Name>NMail.SpoolService</Name> + </ProjectReference> <ProjectReference Include="..\NMail\NMail.csproj"> <Project>{5A5A5012-B157-49B1-A35F-67EC9680112A}</Project> <Name>NMail</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <None Include="Resources\warning.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\error.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\ok.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\pending.png" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: NMail/branches/luke-dev/NMail.SetupWizard/Program.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/Program.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/Program.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,7 +1,28 @@ +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; using System.Collections.Generic; +using System.Configuration; +using System.IO; using System.Windows.Forms; +using NMail.Configuration; + namespace NMail.SetupWizard { static class Program { /// <summary> @@ -12,9 +33,59 @@ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); + // Ensure the config file has an NMail section + NMailConfiguration.AddToConfigFile(); + NMailConfiguration configuration = NMailConfiguration.Current; + BaseForm baseForm = new BaseForm(); baseForm.SetPanel(new WelcomePanel(baseForm)); + + // Setup any tasks + Task task; + + if (NMailConfigFile.Current.HasFile) { + task = new Task("Backup NMail configuration", new TaskDelegate(backupNMailConfig)); + baseForm.Tasks.Add(task); + } + + task = new Task("Save NMail configuration", new TaskDelegate(saveNMailConfig)); + baseForm.Tasks.Add(task); + Application.Run(baseForm); } + + private static TaskResult backupNMailConfig(out string message) { + try { + string file = NMailConfigFile.Current.FilePath; + string backupFile = file + ".backup"; + + // Remove any previous backup + if (File.Exists(backupFile)) { + File.Delete(backupFile); + } + + // Make a copy of the file + File.Copy(file, backupFile); + + message = null; + return TaskResult.Ok; + + } catch (Exception e) { + message = "Error backing up NMail configuration: " + e.Message; + return TaskResult.Error; + } + } + + private static TaskResult saveNMailConfig(out string message) { + try { + NMailConfigFile.Current.Save(ConfigurationSaveMode.Minimal, true); + message = null; + return TaskResult.Ok; + + } catch (Exception e) { + message = "Error saving NMail configuration: " + e.Message; + return TaskResult.Error; + } + } } } \ No newline at end of file Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -1,4 +1,21 @@ -using System.Reflection; +/* + * Copyright 2004-2006 Luke Quinane + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -6,7 +23,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("NMail.SetupWizard")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("A wizard for setting up NMail installations.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NMail.SetupWizard")] Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs 2006-07-15 12:15:25 UTC (rev 59) @@ -9,54 +9,83 @@ //------------------------------------------------------------------------------ namespace NMail.SetupWizard.Properties { - - - /// <summary> - /// A strongly-typed resource class, for looking up localized strings, etc. - /// </summary> - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// <summary> - /// Returns the cached ResourceManager instance used by this class. - /// </summary> - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NMail.SetupWizard.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// <summary> - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// </summary> - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NMail.SetupWizard.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap error { + get { + object obj = ResourceManager.GetObject("error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ok { + get { + object obj = ResourceManager.GetObject("ok", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap pending { + get { + object obj = ResourceManager.GetObject("pending", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap warning { + get { + object obj = ResourceManager.GetObject("warning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } } Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx =================================================================== --- NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx 2006-07-11 12:25:54 UTC (rev 58) +++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx 2006-07-15 12:15:25 UTC (rev 59) @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> @@ -68,9 +69,10 @@ <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> @@ -85,9 +87,10 @@ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> @@ -114,4 +117,17 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="error" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="ok" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\ok.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="pending" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\pending.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file Added: NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png =================================================================== (Binary files differ) Property changes on: NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added... [truncated message content] |