Skip to content

Commit a5d7fc9

Browse files
author
Andrea Corti
committed
Updated to FX 4.6 - Performance Improvements
Update all projects to FX 4.6 Removed the parsing of all folders on login Corrected two exceptions on parsing Added parameters to avoid SubFolders on GetMessage
1 parent 161e654 commit a5d7fc9

46 files changed

Lines changed: 941 additions & 50 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ActiveUp.Net.sln

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.1.32319.34
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Class Library", "Class Library", "{629D406B-F46A-4A9D-A31F-C5956E0AB157}"
77
EndProject
@@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveUp.Net.Tests", "Class
5757
EndProject
5858
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveUp.Net", "Class Library\ActiveUp.Net\ActiveUp.Net.csproj", "{25DA9502-B959-4E81-9368-471AE231BCC0}"
5959
EndProject
60+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}"
61+
EndProject
6062
Global
6163
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6264
Debug|.NET = Debug|.NET
@@ -606,6 +608,36 @@ Global
606608
{25DA9502-B959-4E81-9368-471AE231BCC0}.Trial|Any CPU.Build.0 = Trial|Any CPU
607609
{25DA9502-B959-4E81-9368-471AE231BCC0}.Trial|Mixed Platforms.ActiveCfg = Trial|Any CPU
608610
{25DA9502-B959-4E81-9368-471AE231BCC0}.Trial|Mixed Platforms.Build.0 = Trial|Any CPU
611+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|.NET.ActiveCfg = Debug|Any CPU
612+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|.NET.Build.0 = Debug|Any CPU
613+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
614+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
615+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
616+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
617+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|.NET.ActiveCfg = Debug|Any CPU
618+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|.NET.Build.0 = Debug|Any CPU
619+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|Any CPU.ActiveCfg = Debug|Any CPU
620+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|Any CPU.Build.0 = Debug|Any CPU
621+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|Mixed Platforms.ActiveCfg = Debug|Any CPU
622+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.MailSystem Dev|Mixed Platforms.Build.0 = Debug|Any CPU
623+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|.NET.ActiveCfg = Release|Any CPU
624+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|.NET.Build.0 = Release|Any CPU
625+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
626+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|Any CPU.Build.0 = Release|Any CPU
627+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
628+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
629+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|.NET.ActiveCfg = Release|Any CPU
630+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|.NET.Build.0 = Release|Any CPU
631+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|Any CPU.ActiveCfg = Release|Any CPU
632+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|Any CPU.Build.0 = Release|Any CPU
633+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|Mixed Platforms.ActiveCfg = Release|Any CPU
634+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Retail|Mixed Platforms.Build.0 = Release|Any CPU
635+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|.NET.ActiveCfg = Debug|Any CPU
636+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|.NET.Build.0 = Debug|Any CPU
637+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|Any CPU.ActiveCfg = Debug|Any CPU
638+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|Any CPU.Build.0 = Debug|Any CPU
639+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|Mixed Platforms.ActiveCfg = Debug|Any CPU
640+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F}.Trial|Mixed Platforms.Build.0 = Debug|Any CPU
609641
EndGlobalSection
610642
GlobalSection(SolutionProperties) = preSolution
611643
HideSolutionNode = FALSE
@@ -632,5 +664,9 @@ Global
632664
{D9BCD15E-A438-4554-89D3-1CF122167FDD} = {629D406B-F46A-4A9D-A31F-C5956E0AB157}
633665
{5AD3438E-9024-4908-BA15-92726159C4FB} = {33BAFFED-FB5D-48EF-85D9-CDE2EB2CFA64}
634666
{25DA9502-B959-4E81-9368-471AE231BCC0} = {629D406B-F46A-4A9D-A31F-C5956E0AB157}
667+
{B1ACA405-9EF9-4D7F-8CEA-44AD36D35A2F} = {33BAFFED-FB5D-48EF-85D9-CDE2EB2CFA64}
668+
EndGlobalSection
669+
GlobalSection(ExtensibilityGlobals) = postSolution
670+
SolutionGuid = {CFB097AB-7158-4A40-90C3-C54C646BF177}
635671
EndGlobalSection
636672
EndGlobal

Class Library/ActiveUp.Net.Common/ActiveUp.Net.Common.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -25,7 +25,7 @@
2525
<OldToolsVersion>3.5</OldToolsVersion>
2626
<UpgradeBackupLocation>
2727
</UpgradeBackupLocation>
28-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
28+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
2929
<PublishUrl>publish\</PublishUrl>
3030
<Install>true</Install>
3131
<InstallFrom>Disk</InstallFrom>
@@ -53,6 +53,7 @@
5353
<WarningLevel>4</WarningLevel>
5454
<DocumentationFile>..\Bin\Debug\ActiveUp.Net.Common.XML</DocumentationFile>
5555
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
56+
<Prefer32Bit>false</Prefer32Bit>
5657
</PropertyGroup>
5758
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5859
<DebugType>pdbonly</DebugType>
@@ -63,6 +64,7 @@
6364
<WarningLevel>4</WarningLevel>
6465
<DocumentationFile>..\Bin\Release\ActiveUp.Net.Common.XML</DocumentationFile>
6566
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
67+
<Prefer32Bit>false</Prefer32Bit>
6668
</PropertyGroup>
6769
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Trial|AnyCPU' ">
6870
<OutputPath>bin\Trial\</OutputPath>
@@ -73,6 +75,7 @@
7375
<ErrorReport>prompt</ErrorReport>
7476
<DocumentationFile>../Obfuscation/Trial/ActiveUp.Net.Common.xml</DocumentationFile>
7577
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
78+
<Prefer32Bit>false</Prefer32Bit>
7679
</PropertyGroup>
7780
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Retail|AnyCPU' ">
7881
<OutputPath>..\Bin\Retail\</OutputPath>
@@ -83,6 +86,7 @@
8386
<ErrorReport>prompt</ErrorReport>
8487
<DocumentationFile>..\Bin\Retail\ActiveUp.Net.Common.xml</DocumentationFile>
8588
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
89+
<Prefer32Bit>false</Prefer32Bit>
8690
</PropertyGroup>
8791
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MailSystem Dev|AnyCPU' ">
8892
<OutputPath>bin\MailSystem Dev\</OutputPath>
@@ -93,6 +97,7 @@
9397
<PlatformTarget>AnyCPU</PlatformTarget>
9498
<ErrorReport>prompt</ErrorReport>
9599
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
100+
<Prefer32Bit>false</Prefer32Bit>
96101
</PropertyGroup>
97102
<ItemGroup>
98103
<Reference Include="mscorlib" />

Class Library/ActiveUp.Net.Common/Parser.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,9 +1118,16 @@ public static DateTime ParseAsUniversalDateTime(string input)
11181118
string[] dateParts = parts[3].Split(':');
11191119
int hour = Convert.ToInt32(dateParts[0]);
11201120
int minute = Convert.ToInt32(dateParts[1]);
1121+
11211122
int second = 0;
11221123
if (dateParts.Length > 2)
1123-
second = Convert.ToInt32(dateParts[2]);
1124+
{
1125+
if(dateParts[2].Contains("."))
1126+
second = Convert.ToInt32(dateParts[2].Substring(0, dateParts[2].IndexOf(".")));
1127+
else
1128+
second = Convert.ToInt32(dateParts[2]);
1129+
}
1130+
11241131
int offset_hours = Convert.ToInt32(parts[4].Substring(0, 3));
11251132
int offset_minutes = Convert.ToInt32(parts[4].Substring(3, 2));
11261133
DateTime date = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc);

Class Library/ActiveUp.Net.Common/SslHandShake.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public SslHandShake(string hostName, System.Security.Authentication.SslProtocols
4848
{
4949

5050
}
51-
public SslHandShake(string hostName) : this(hostName, System.Security.Authentication.SslProtocols.None, null, null, null, false)
51+
public SslHandShake(string hostName) : this(hostName, System.Security.Authentication.SslProtocols.Default, null, null, null, false)
5252
{
5353

5454
}

Class Library/ActiveUp.Net.Dns/ActiveUp.Net.Dns.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -25,7 +25,7 @@
2525
<OldToolsVersion>3.5</OldToolsVersion>
2626
<UpgradeBackupLocation>
2727
</UpgradeBackupLocation>
28-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
28+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
2929
<PublishUrl>publish\</PublishUrl>
3030
<Install>true</Install>
3131
<InstallFrom>Disk</InstallFrom>
@@ -53,6 +53,7 @@
5353
<WarningLevel>4</WarningLevel>
5454
<DocumentationFile>..\Bin\Debug\ActiveUp.Net.Dns.XML</DocumentationFile>
5555
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
56+
<Prefer32Bit>false</Prefer32Bit>
5657
</PropertyGroup>
5758
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5859
<DebugType>pdbonly</DebugType>
@@ -63,6 +64,7 @@
6364
<WarningLevel>4</WarningLevel>
6465
<DocumentationFile>..\Bin\Release\ActiveUp.Net.Dns.XML</DocumentationFile>
6566
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
67+
<Prefer32Bit>false</Prefer32Bit>
6668
</PropertyGroup>
6769
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Trial|AnyCPU' ">
6870
<OutputPath>bin\Trial\</OutputPath>
@@ -73,6 +75,7 @@
7375
<ErrorReport>prompt</ErrorReport>
7476
<DocumentationFile>../Obfuscation/Trial/ActiveUp.Net.Dns.xml</DocumentationFile>
7577
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
78+
<Prefer32Bit>false</Prefer32Bit>
7679
</PropertyGroup>
7780
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Retail|AnyCPU' ">
7881
<OutputPath>..\Bin\Retail\</OutputPath>
@@ -83,6 +86,7 @@
8386
<ErrorReport>prompt</ErrorReport>
8487
<DocumentationFile>..\Bin\Retail\ActiveUp.Net.Dns.xml</DocumentationFile>
8588
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
89+
<Prefer32Bit>false</Prefer32Bit>
8690
</PropertyGroup>
8791
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MailSystem Dev|AnyCPU' ">
8892
<OutputPath>bin\MailSystem Dev\</OutputPath>
@@ -93,6 +97,7 @@
9397
<PlatformTarget>AnyCPU</PlatformTarget>
9498
<ErrorReport>prompt</ErrorReport>
9599
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
100+
<Prefer32Bit>false</Prefer32Bit>
96101
</PropertyGroup>
97102
<ItemGroup>
98103
<Reference Include="System" />

Class Library/ActiveUp.Net.Groupware/ActiveUp.Net.Groupware.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -25,7 +25,7 @@
2525
<OldToolsVersion>3.5</OldToolsVersion>
2626
<UpgradeBackupLocation>
2727
</UpgradeBackupLocation>
28-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
28+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
2929
<PublishUrl>publish\</PublishUrl>
3030
<Install>true</Install>
3131
<InstallFrom>Disk</InstallFrom>
@@ -53,6 +53,7 @@
5353
<WarningLevel>4</WarningLevel>
5454
<DocumentationFile>..\Bin\Debug\ActiveUp.Net.PDI.XML</DocumentationFile>
5555
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
56+
<Prefer32Bit>false</Prefer32Bit>
5657
</PropertyGroup>
5758
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5859
<DebugType>pdbonly</DebugType>
@@ -63,6 +64,7 @@
6364
<WarningLevel>4</WarningLevel>
6465
<DocumentationFile>..\Bin\Release\ActiveUp.Net.PDI.XML</DocumentationFile>
6566
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
67+
<Prefer32Bit>false</Prefer32Bit>
6668
</PropertyGroup>
6769
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Trial|AnyCPU' ">
6870
<OutputPath>bin\Trial\</OutputPath>
@@ -73,6 +75,7 @@
7375
<PlatformTarget>AnyCPU</PlatformTarget>
7476
<ErrorReport>prompt</ErrorReport>
7577
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
78+
<Prefer32Bit>false</Prefer32Bit>
7679
</PropertyGroup>
7780
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Retail|AnyCPU' ">
7881
<OutputPath>..\Bin\Retail\</OutputPath>
@@ -83,6 +86,7 @@
8386
<PlatformTarget>AnyCPU</PlatformTarget>
8487
<ErrorReport>prompt</ErrorReport>
8588
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
89+
<Prefer32Bit>false</Prefer32Bit>
8690
</PropertyGroup>
8791
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MailSystem Dev|AnyCPU' ">
8892
<OutputPath>bin\MailSystem Dev\</OutputPath>
@@ -93,6 +97,7 @@
9397
<PlatformTarget>AnyCPU</PlatformTarget>
9498
<ErrorReport>prompt</ErrorReport>
9599
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
100+
<Prefer32Bit>false</Prefer32Bit>
96101
</PropertyGroup>
97102
<ItemGroup>
98103
<Reference Include="System" />

Class Library/ActiveUp.Net.Imap4/ActiveUp.Net.Imap4.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -21,7 +21,7 @@
2121
<OldToolsVersion>3.5</OldToolsVersion>
2222
<UpgradeBackupLocation>
2323
</UpgradeBackupLocation>
24-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
24+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
2525
<PublishUrl>publish\</PublishUrl>
2626
<Install>true</Install>
2727
<InstallFrom>Disk</InstallFrom>
@@ -49,6 +49,7 @@
4949
<WarningLevel>4</WarningLevel>
5050
<DocumentationFile>..\Bin\Debug\ActiveUp.Net.Imap4.XML</DocumentationFile>
5151
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
52+
<Prefer32Bit>false</Prefer32Bit>
5253
</PropertyGroup>
5354
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5455
<DebugType>pdbonly</DebugType>
@@ -59,6 +60,7 @@
5960
<WarningLevel>4</WarningLevel>
6061
<DocumentationFile>..\Bin\Release\ActiveUp.Net.Imap4.XML</DocumentationFile>
6162
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
63+
<Prefer32Bit>false</Prefer32Bit>
6264
</PropertyGroup>
6365
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Trial|AnyCPU' ">
6466
<OutputPath>bin\Trial\</OutputPath>
@@ -69,6 +71,7 @@
6971
<ErrorReport>prompt</ErrorReport>
7072
<DocumentationFile>../Obfuscation/Trial/ActiveUp.Net.Imap4.xml</DocumentationFile>
7173
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
74+
<Prefer32Bit>false</Prefer32Bit>
7275
</PropertyGroup>
7376
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Retail|AnyCPU' ">
7477
<OutputPath>..\Bin\Retail\</OutputPath>
@@ -79,6 +82,7 @@
7982
<ErrorReport>prompt</ErrorReport>
8083
<DocumentationFile>..\Bin\Retail\ActiveUp.Net.Imap4.xml</DocumentationFile>
8184
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
85+
<Prefer32Bit>false</Prefer32Bit>
8286
</PropertyGroup>
8387
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MailSystem Dev|AnyCPU' ">
8488
<OutputPath>bin\MailSystem Dev\</OutputPath>
@@ -89,6 +93,7 @@
8993
<PlatformTarget>AnyCPU</PlatformTarget>
9094
<ErrorReport>prompt</ErrorReport>
9195
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
96+
<Prefer32Bit>false</Prefer32Bit>
9297
</PropertyGroup>
9398
<ItemGroup>
9499
<Reference Include="System" />

Class Library/ActiveUp.Net.Imap4/Imap4Client.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ public string Login(string username, string password)
899899
OnAuthenticating(new AuthenticatingEventArgs(username, password, host));
900900
string response = Command("login " + username + " " + password);
901901
OnAuthenticated(new AuthenticatedEventArgs(username, password, host, response));
902-
LoadMailboxes();
902+
//LoadMailboxes();
903903
return response;
904904
}
905905
public IAsyncResult BeginLogin(string username, string password, AsyncCallback callback)
@@ -1042,6 +1042,7 @@ public byte[] CommandBinary(string command, CommandOptions options = null)
10421042

10431043
public byte[] CommandBinary(string command, string stamp, CommandOptions options = null)
10441044
{
1045+
System.Diagnostics.Debug.WriteLine(command);
10451046
if (options == null)
10461047
options = new CommandOptions();
10471048

@@ -1872,7 +1873,7 @@ public void EndUnsubscribeMailbox(IAsyncResult result)
18721873
{
18731874
_delegateMailboxOperationReturnsString.EndInvoke(result);
18741875
}
1875-
1876+
public bool SubFolders = true;
18761877
/// <summary>
18771878
/// Selects a mailbox on the server.
18781879
/// </summary>
@@ -1919,7 +1920,10 @@ public Mailbox SelectMailbox(string mailboxName)
19191920
mailboxName = renderSafeParam(mailboxName);
19201921

19211922
Mailbox mailbox = new Mailbox();
1923+
1924+
if(SubFolders)
19221925
mailbox.SubMailboxes = GetMailboxes(mailboxName, "*");
1926+
19231927
string response = Command("select \"" + mailboxName + "\"");
19241928
string[] lines = System.Text.RegularExpressions.Regex.Split(response, "\r\n");
19251929

@@ -1945,7 +1949,9 @@ public Mailbox SelectMailbox(string mailboxName)
19451949
int unseen = 0;
19461950
try
19471951
{
1948-
unseen = Convert.ToInt32(FindLine(lines, "[UNSEEN ").Split(' ')[3].TrimEnd(']'));
1952+
string line = FindLine(lines, "[UNSEEN ");
1953+
if(!String.IsNullOrEmpty(line))
1954+
unseen = Convert.ToInt32(line.Split(' ')[3].TrimEnd(']'));
19491955
}
19501956
catch (Exception) { }
19511957
mailbox.FirstUnseen = (response.ToLower().IndexOf("[unseen") != -1) ? unseen : 0;

0 commit comments

Comments
 (0)