Skip to content

Commit b610d58

Browse files
gtrmitch_cpgtrmitch_cp
authored andcommitted
fixed + command issue with IMAP fetch when email body had a + sign, changed message bytes to UTF8 (and ASCII conversion where applicable) to allow for international characters, and added an IsHtml property to Message to allow for easier switching
1 parent 540071f commit b610d58

16 files changed

Lines changed: 1735 additions & 1688 deletions

‎Class Library/ActiveUp.Net.Common/Message.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ public bool HasSmimeDetachedSignature
177177
}
178178
}
179179

180+
/// <summary>
181+
/// Indicates whether the message is in HTML format or not
182+
/// </summary>
183+
public bool IsHtml { get; set; }
184+
180185
/// <summary>
181186
/// Indicates whether the message has been encrypted using S/MIME.
182187
/// </summary>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ private static void DispatchPart(MimePart part, ref Message message)
199199
}
200200
else if (part.ContentType.SubType.Equals("html"))
201201
{
202+
message.IsHtml = true;
202203
message.BodyHtml.Charset = part.Charset;
203204
message.BodyHtml.Text = part.TextContent;
204205
}
@@ -720,7 +721,7 @@ public static Message ParseMessage(byte[] data)
720721
{
721722
//string msg = System.Text.Encoding.ASCII.GetString(data);
722723
#if !PocketPC
723-
string msg = System.Text.Encoding.GetEncoding("iso-8859-1").GetString(data,0,data.Length);
724+
string msg = System.Text.Encoding.UTF8.GetString(data,0,data.Length);
724725
#else
725726
string msg = Pop3Client.PPCEncode.GetString(data, 0, data.Length);
726727
#endif

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<OldToolsVersion>3.5</OldToolsVersion>
2626
<UpgradeBackupLocation>
2727
</UpgradeBackupLocation>
28-
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
28+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
2929
<PublishUrl>publish\</PublishUrl>
3030
<Install>true</Install>
3131
<InstallFrom>Disk</InstallFrom>
@@ -41,6 +41,7 @@
4141
<IsWebBootstrapper>false</IsWebBootstrapper>
4242
<UseApplicationTrust>false</UseApplicationTrust>
4343
<BootstrapperEnabled>true</BootstrapperEnabled>
44+
<TargetFrameworkProfile />
4445
</PropertyGroup>
4546
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4647
<DebugSymbols>true</DebugSymbols>
@@ -99,6 +100,7 @@
99100
<Reference Include="System.Xml" />
100101
</ItemGroup>
101102
<ItemGroup>
103+
<Compile Include="CommandOptions.cs" />
102104
<Compile Include="Fetch.cs" />
103105
<Compile Include="Flag.cs" />
104106
<Compile Include="FlagCollection.cs" />

‎Class Library/ActiveUp.Net.Imap4/Fetch.cs‎

Lines changed: 80 additions & 68 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)