Skip to content

Commit

Permalink
Bumped version to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Apr 16, 2023
1 parent 27c4821 commit 504b796
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 69 deletions.
2 changes: 1 addition & 1 deletion MailKit/MailKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>An Open Source cross-platform .NET mail-client library that is based on MimeKit and optimized for mobile devices.</Description>
<AssemblyTitle>MailKit</AssemblyTitle>
<VersionPrefix>3.6.0</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>
<Authors>Jeffrey Stedfast</Authors>
<LangVersion>9</LangVersion>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net47;net48;net6.0</TargetFrameworks>
Expand Down
4 changes: 2 additions & 2 deletions MailKit/MailKitLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<Description>An Open Source cross-platform .NET mail-client library that is based on MimeKit and optimized for mobile devices.</Description>
<AssemblyTitle>MailKit</AssemblyTitle>
<VersionPrefix>3.6.0</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>
<Authors>Jeffrey Stedfast</Authors>
<LangVersion>8</LangVersion>
<LangVersion>9</LangVersion>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net47;net48;net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Expand Down
12 changes: 7 additions & 5 deletions MailKit/MailService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ internal static bool IsKnownMailServerCertificate (X509Certificate2 certificate)
|| (serial == "00F525194DBA81A0BC12DBDFD903F44F0D" && fingerprint == "75F1EB098EEC6BB570485A402459B846B3052C11") // Expires 5/25/2023 12:22:22 AM
|| (serial == "00FEE43FD6309636060A4AD4B318B8C16C" && fingerprint == "066B11204F056D87E98F360BF8C6EB40E0DE330A") // Expires 5/29/2023 4:18:40 AM
|| (serial == "009FC10C683787F097120487B0ABA44DDB" && fingerprint == "ED4584589E119A0E0DD0AD316B64447AAA30230A") // Expires 6/5/2023 4:24:27 AM
|| (serial == "3908DE525CAE808512B5BBCAFDE7EE1A" && fingerprint == "682C6386DC5B328504FE1AB4B8F9B7638C351CD7"); // Expires 6/12/2023 4:25:47 AM
|| (serial == "3908DE525CAE808512B5BBCAFDE7EE1A" && fingerprint == "682C6386DC5B328504FE1AB4B8F9B7638C351CD7") // Expires 6/12/2023 4:25:47 AM
|| (serial == "009C2FA24B2248CA4E12111C82945B97FB" && fingerprint == "CDE96ED6A335F76B3B5DB8C06A1D2E71F80A9F48"); // Expires 6/20/2023 12:53:58 PM
default:
return false;
}
Expand All @@ -448,7 +449,8 @@ internal static bool IsKnownMailServerCertificate (X509Certificate2 certificate)
return (serial == "00946E3F84703BE4690A12491232CD7DF9" && fingerprint == "5C1376C19F1A6FB6DAAE4393D2919134573CADDE") // Expires 5/3/2023 12:35:52 AM
|| (serial == "0BFA6B98977EA55912F4440ADE1B9320" && fingerprint == "20B6444B3A195C499B2BD27FB1C1BE01814D1A01") // Expires 5/25/2023 12:22:22 AM
|| (serial == "0080AFBC7CE1AA7E3A0AE5E74E9932198A" && fingerprint == "4671CBEE08E4EC02ADAB1612E9E2399C8AD6BDE7") // Expires 6/5/2023 4:24:27 AM
|| (serial == "7E15A8232FA0B7C812A8481356EF83CB" && fingerprint == "BC39E3D6C9E030EBC31BD27F44417EC9C7D9D2B2"); // Expires 6/12/2023 4:25:18 AM
|| (serial == "7E15A8232FA0B7C812A8481356EF83CB" && fingerprint == "BC39E3D6C9E030EBC31BD27F44417EC9C7D9D2B2") // Expires 6/12/2023 4:25:18 AM
|| (serial == "008E5AE1833351846C0A34C8E1E8966E69" && fingerprint == "B9AC49FA9584B92245C586AA2B4585F3EA014CFC"); // Expires 6/20/2023 12:54:02 PM
default:
return false;
}
Expand All @@ -459,7 +461,8 @@ internal static bool IsKnownMailServerCertificate (X509Certificate2 certificate)
|| (serial == "00BB686207476F3BA30AAA3FE14DF58FAC" && fingerprint == "B3FBFA39091768512BC42B9C0C71809E3309553B") // Expires 5/25/2023 12:22:23 AM
|| (serial == "00C77F6452EE58300D0A7B26762C25E8D9" && fingerprint == "D0CCFF4213BB7400D5A2B7B184B6F49D6BB62073") // Expires 5/29/2023 4:18:41 AM
|| (serial == "398C567803CB133012472B8BF7B40BF8" && fingerprint == "75C1109F345A53DE907205D19F25C32DB7826CAC") // Expires 6/5/2023 4:25:01 AM
|| (serial == "00CD3052AB7BC0657A0A59F086E51DEB86" && fingerprint == "45DCA54E4F370C4DDB2D1197E6FB3F26B85921DB"); // Expires 6/12/2023 4:25:16 AM
|| (serial == "00CD3052AB7BC0657A0A59F086E51DEB86" && fingerprint == "45DCA54E4F370C4DDB2D1197E6FB3F26B85921DB") // Expires 6/12/2023 4:25:16 AM
|| (serial == "00A84EDB0CB75CDA80121FA83AB54AB9E2" && fingerprint == "C8DF63F7DACBC795F8484FA2A7B7A41793CC8B8B"); // Expires 6/20/2023 12:54:01 PM
default:
return false;
}
Expand Down Expand Up @@ -502,8 +505,7 @@ internal static bool IsKnownMailServerCertificate (X509Certificate2 certificate)
case "legacy.pop.mail.yahoo.com":
switch (issuer) {
case YahooCertificateIssuer:
return (serial == "0844D3A0F6F69200C2E63268DADC58EE" && fingerprint == "6D26CDE4E416E6B7EA65F58206E0332D57DE5F62") // Expires 3/8/2023 6:59:59 PM
|| (serial == "01D722E4DFC71F6742BF762893BC67D0" && fingerprint == "407CF8B5518E5FF5219B6931995C31EEA856C8FC"); // Expires 8/2/2023 7:59:59 PM
return (serial == "01D722E4DFC71F6742BF762893BC67D0" && fingerprint == "407CF8B5518E5FF5219B6931995C31EEA856C8FC"); // Expires 8/2/2023 7:59:59 PM
default:
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions MailKit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
//
// If there have only been bug fixes, bump the Micro Version and/or the Build Number
// in the AssemblyFileVersion attribute.
[assembly: AssemblyInformationalVersion ("3.6.0.0")]
[assembly: AssemblyFileVersion ("3.6.0.0")]
[assembly: AssemblyVersion ("3.6.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
[assembly: AssemblyVersion ("4.0.0.0")]
6 changes: 6 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## MailKit 4.0.0 (2023-04-15)

* Marked the AccessRight and UniqueId structs as readonly.
* Fixed POP3 client logic to calculate the needed bytes before converting commands into into the output buffer.
* Ported to MimeKit v4.0 and BouncyCastle v2.1.1.

## MailKit 3.6.0 (2023-03-04)

* Decrement ImapFolder.Count when ImapClient receives an untagged EXPUNGE notification and emit a CountChanged event.
Expand Down
20 changes: 10 additions & 10 deletions nuget/MailKit.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>MailKit</id>
<version>3.6.0</version>
<version>4.0.0</version>
<title>MailKit</title>
<authors>Jeffrey Stedfast</authors>
<owners>Jeffrey Stedfast</owners>
Expand All @@ -26,9 +26,9 @@ Features include:
</description>
<summary>An Open Source .NET mail-client library for Windows, Mac, Linux, and mobile platforms such as iOS and Android.</summary>
<releaseNotes>
* Decrement ImapFolder.Count when ImapClient receives an untagged EXPUNGE notification and emit a CountChanged event. (issue #1509)
* Avoid using the NAMESPACE command for Exchange 2003. (issue #1512)
* Added support for rfc8970 (IMAP4 Extension: Message Preview Generation).
* Marked the AccessRight and UniqueId structs as readonly.
* Fixed POP3 client logic to calculate the needed bytes before converting commands into into the output buffer.
* Ported to MimeKit v4.0 and BouncyCastle v2.1.1.
</releaseNotes>
<copyright>.NET Foundation and Contributors</copyright>
<language>en-US</language>
Expand Down Expand Up @@ -62,25 +62,25 @@ Features include:
<dependencies>
<group targetFramework="net462">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
<group targetFramework="net47">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
<group targetFramework="net48">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
<group targetFramework="net6.0">
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="MimeKit" version="3.6.0" />
<dependency id="MimeKit" version="4.0.0" />
</group>
</dependencies>
</metadata>
Expand Down
20 changes: 10 additions & 10 deletions nuget/MailKitLite.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>MailKitLite</id>
<version>3.6.0</version>
<version>4.0.0</version>
<title>MailKit</title>
<authors>Jeffrey Stedfast</authors>
<owners>Jeffrey Stedfast</owners>
Expand All @@ -26,9 +26,9 @@ Features include:
</description>
<summary>An Open Source .NET mail-client library for Windows, Mac, Linux, and mobile platforms such as iOS and Android.</summary>
<releaseNotes>
* Decrement ImapFolder.Count when ImapClient receives an untagged EXPUNGE notification and emit a CountChanged event. (issue #1509)
* Avoid using the NAMESPACE command for Exchange 2003. (issue #1512)
* Added support for rfc8970 (IMAP4 Extension: Message Preview Generation).
* Marked the AccessRight and UniqueId structs as readonly.
* Fixed POP3 client logic to calculate the needed bytes before converting commands into into the output buffer.
* Ported to MimeKit v4.0 and BouncyCastle v2.1.1.
</releaseNotes>
<copyright>.NET Foundation and Contributors</copyright>
<language>en-US</language>
Expand Down Expand Up @@ -58,25 +58,25 @@ Features include:
<dependencies>
<group targetFramework="net462">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
<group targetFramework="net47">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
<group targetFramework="net48">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
<group targetFramework="net6.0">
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="MimeKitLite" version="3.6.0" />
<dependency id="MimeKitLite" version="4.0.0" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<AndroidApplication>True</AndroidApplication>
<AssemblyName>ImapClientDemo.Android</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v12.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
Expand All @@ -27,17 +27,17 @@
<ConsolePause>false</ConsolePause>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
<DebugSymbols>true</DebugSymbols>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -48,7 +48,7 @@
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="3.6.0" />
<PackageReference Include="MailKit" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down Expand Up @@ -82,4 +82,4 @@
<AndroidResource Include="Resources\values\themes.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="ImapClientDemo.Android">
<uses-sdk android:targetSdkVersion="26" />
<uses-sdk android:targetSdkVersion="32" />
<application android:theme="@style/AppTheme" android:label="Imap Demo" android:icon="@drawable/icon"></application>
</manifest>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RootNamespace>ImapClientDemo.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>ImapClientDemoiOS</AssemblyName>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -72,7 +73,7 @@
<Reference Include="MonoTouch.Dialog-1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="3.6.0" />
<PackageReference Include="MailKit" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json">
Expand Down
2 changes: 1 addition & 1 deletion samples/ImapClientDemo.iOS/ImapClientDemo.iOS/Mail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static Mail ()

public static void MessageBox (string title, string message)
{
var av = new UIAlertView (title, message, null, "OK");
var av = new UIAlertView (title, message, (IUIAlertViewDelegate) null, "OK");
av.Show ();
}
}
Expand Down
4 changes: 2 additions & 2 deletions samples/ImapClientDemo.iOS/ImapClientDemo.iOS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Author: Jeffrey Stedfast <[email protected]>
//
// Copyright (c) 2013-2022 Xamarin Inc. (www.xamarin.com)
// Copyright (c) 2013-2023 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,7 +40,7 @@ static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
UIApplication.Main (args, null, typeof (AppDelegate));
}
}
}
8 changes: 5 additions & 3 deletions samples/ImapClientDemo/ImapClientDemo/FolderTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ TreeNode CreateFolderNode (ClientConnection<ImapClient> connection, IMailFolder
{
Debug.Assert (SynchronizationContext.Current == Program.GuiContext);

var node = new TreeNode (folder.Name) { Tag = folder, ToolTipText = folder.FullName };

node.NodeFont = new Font (Font, FontStyle.Regular);
var node = new TreeNode (folder.Name) {
NodeFont = new Font (Font, FontStyle.Regular),
ToolTipText = folder.FullName,
Tag = folder
};

if (folder == connection.Client.Inbox)
node.SelectedImageKey = node.ImageKey = "inbox";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="3.6.0" />
<PackageReference Include="MailKit" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="AuthenticationFailedEventArgs.cs" />
Expand Down
14 changes: 4 additions & 10 deletions samples/ImapClientDemo/ImapClientDemo/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ public RenderMessageCommand (ClientConnection<ImapClient> connection, IMailFolde
void RenderMultipartRelated (MultipartRelated related)
{
var root = related.Root;
var multipart = root as Multipart;
var text = root as TextPart;

if (multipart != null) {
if (root is Multipart multipart) {
// Note: the root document can sometimes be a multipart/alternative.
// A multipart/alternative is just a collection of alternate views.
// The last part is the format that most closely matches what the
// user saw in his or her email client's WYSIWYG editor.
for (int i = multipart.Count; i > 0; i--) {
var body = multipart[i - 1] as TextPart;

if (body == null)
if (!(multipart[i - 1] is TextPart body))
continue;

// our preferred mime-type is text/html
Expand All @@ -61,8 +58,7 @@ void RenderMultipartRelated (MultipartRelated related)
break;
}

if (text == null)
text = body;
text ??= body;
}
}

Expand Down Expand Up @@ -143,9 +139,7 @@ void DownloadBodyPart (IMailFolder folder, UniqueId uid, BodyPart body, Cancella
// The last part is the format that most closely matches what the
// user saw in his or her email client's WYSIWYG editor.
for (int i = multipart.BodyParts.Count; i > 0; i--) {
var multi = multipart.BodyParts[i - 1] as BodyPartMultipart;

if (multi != null && multi.ContentType.IsMimeType ("multipart", "related")) {
if (multipart.BodyParts[i - 1] is BodyPartMultipart multi && multi.ContentType.IsMimeType ("multipart", "related")) {
if (multi.BodyParts.Count == 0)
continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public void HtmlTagCallback (HtmlTagContext ctx, HtmlWriter htmlWriter)

// locate the index of the attachment within the multipart/related (if it exists)
if ((index = related.IndexOf (uri)) != -1) {
var attachment = related[index] as MimePart;

if (attachment == null) {
if (!(related[index] is MimePart attachment)) {
// the body part is not a basic leaf part (IOW it's a multipart or message-part)
htmlWriter.WriteAttribute (attribute);
continue;
Expand Down
Loading

0 comments on commit 504b796

Please sign in to comment.