Permalink
Browse files

2.5.4: Fixed handling of case-sensitive boundary names and messages w…

…ith "UID" in their subjects.
  • Loading branch information...
bertjohnson committed May 20, 2017
1 parent f2fd60c commit 819518243dce6fb82e0c0d88cf8b06b772c62571
View
@@ -1,5 +1,9 @@
### Changelog ###
2.5.4 - 2017-05-19
* Fixed processing of messages with the string "UID" in their subjects.
* Fixed handling of case-sensitive boundary names.
2.5.3 - 2017-03-30
* Ensured that the last text/html MIME part is considered the body (in the case of multiple text/html MIME parts).
@@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]
@@ -49,10 +49,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IMAP\ImapProxy.cs" />
<Compile Include="Imap\ImapProxy.cs" />
<Compile Include="ProxyBase.cs" />
<Compile Include="POP3\Pop3Proxy.cs" />
<Compile Include="SMTP\SmtpProxy.cs" />
<Compile Include="Pop3\Pop3Proxy.cs" />
<Compile Include="Smtp\SmtpProxy.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProxyFunctions.cs" />
<Compile Include="EnumsAndStructs.cs" />
@@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]
@@ -46,5 +46,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]
@@ -46,5 +46,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]
@@ -46,5 +46,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]
View
@@ -38,7 +38,7 @@ PROJECT_NAME = "OpaqueMail"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2.5.3
PROJECT_NUMBER = 2.5.4
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
View
@@ -231,6 +231,7 @@ public static string DecodeMailHeader(string header)
StringBuilder headerBuilder = new StringBuilder(Constants.TINYSBSIZE);
int cursor = 0, lastCursor = 0;
int headerLength = header.Length;
while (cursor > -1)
{
lastCursor = cursor;
@@ -241,7 +242,7 @@ public static string DecodeMailHeader(string header)
int middleCursor = header.IndexOf("?", cursor + 2, StringComparison.Ordinal);
if (middleCursor > -1 && middleCursor < header.Length - 2)
if (middleCursor > -1 && middleCursor < headerLength - 2)
{
int endCursor = header.IndexOf("?=", middleCursor + 3, StringComparison.Ordinal);
if (endCursor > -1 && endCursor > middleCursor + 1)
@@ -571,7 +572,7 @@ public static string EscapeMailboxName(string mailboxName)
/// <returns>Extracted MIME parameter, properly formatted.</returns>
public static string ExtractMimeParameter(string mimeHeader, string mimeParameter)
{
int parameterPos = mimeHeader.IndexOf(mimeParameter);
int parameterPos = mimeHeader.IndexOf(mimeParameter, StringComparison.OrdinalIgnoreCase);
if (parameterPos > -1)
{
int asteriskPos = mimeHeader.IndexOf("*", parameterPos + mimeParameter.Length);
@@ -2376,8 +2376,14 @@ private async Task<MessagePartialHelper> GetMessagePartialHelper(string mailboxN
{
// Read the message's UID and flags.
int uid = 0;
if (!int.TryParse(Functions.ReturnBetween(response, "UID ", " "), out uid))
int.TryParse(Functions.ReturnBetween(response, "UID ", ")"), out uid);
if (!int.TryParse(Functions.ReturnBetween(response, "\r\n UID ", " "), out uid))
{
int.TryParse(Functions.ReturnBetween(response, "\r\n UID ", ")"), out uid);
}
else if (!int.TryParse(Functions.ReturnBetween(response, "\r\nUID ", " "), out uid))
{
int.TryParse(Functions.ReturnBetween(response, "\r\nUID ", ")"), out uid);
}
string flagsString = Functions.ReturnBetween(response, "FLAGS (", ")");
// Strip IMAP response padding.
@@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3")]
[assembly: AssemblyFileVersion("2.5.3")]
[assembly: AssemblyVersion("2.5.4")]
[assembly: AssemblyFileVersion("2.5.4")]

0 comments on commit 8195182

Please sign in to comment.