Skip to content

sscctech/MimeKit

 
 

Repository files navigation

MimeKit

What is MimeKit?

MimeKit is a C# library which may be used for the creation and parsing of messages using the Multipurpose Internet Mail Extension (MIME), as defined by the following RFCs:

  • 0822: Standard for the Format of Arpa Internet Text Messages
  • 1341: MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies
  • 1342: Representation of Non-ASCII Text in Internet Message Headers
  • 1521: MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies (Obsoletes rfc1341)
  • 1522: MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text (Obsoletes rfc1342)
  • 1544: The Content-MD5 Header Field
  • 1847: Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
  • 1864: The Content-MD5 Header Field (Obsoletes rfc1544)
  • 2015: MIME Security with Pretty Good Privacy (PGP)
  • 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
  • 2046: Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types
  • 2047: Multipurpose Internet Mail Extensions (MIME) Part Three: Message Header Extensions for Non-ASCII Text
  • 2048: Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures
  • 2049: Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples
  • 2183: Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field
  • 2184: MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations
  • 2231: MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations (Obsoletes rfc2184)
  • 2311: S/MIME Version 2 Message Specification
  • 2312: S/MIME Version 2 Certificate Handling
  • 2424: Content Duration MIME Header Definition
  • 2630: Cryptographic Message Syntax
  • 2632: S/MIME Version 3 Certificate Handling
  • 2633: S/MIME Version 3 Message Specification
  • 2634: Enhanced Security Services for S/MIME
  • 2822: Internet Message Format (Obsoletes rfc0822)
  • 3156: MIME Security with OpenPGP (Updates rfc2015)
  • 3850: S/MIME Version 3.1 Certificate Handling (Obsoletes rfc2632)
  • 3851: S/MIME Version 3.1 Message Specification (Obsoletes rfc2633)
  • 5322: Internet Message Format (Obsoletes rfc2822)

Other RFCs of interest:

  • 1523: The text/enriched MIME Content-type
  • 1872: The MIME Multipart/Related Content-type
  • 1927: Suggested Additional MIME Types for Associating Documents
  • 2110: MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)
  • 2111: Content-ID and Message-ID Uniform Resource Locators
  • 2112: The MIME Multipart/Related Content-type (Obsoletes rfc1872)
  • 2387: The MIME Multipart/Related Content-type (Obsoletes rfc2112)

Cryptography related RFCs (needed by S/MIME)

  • 2268: A Description of the RC2(r) Encryption Algorithm
  • 2313: PKCS #1: RSA Encryption
  • 2314: PKCS #10: Certification Request Syntax
  • 2315: PKCS #7: Cryptographic Message Syntax
  • 2631: Diffie-Hellman Key Agreement Method

License Information

MimeKit is Copyright (C) 2012, 2013 Jeffrey Stedfast and is licensed under the MIT/X11 license:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

History

As a developer and user of Electronic Mail clients, I had come to realize that the vast majority of E-Mail client (and server) software had less-than-satisfactory MIME implementations. More often than not these E-Mail clients created broken MIME messages and/or would incorrectly try to parse a MIME message thus subtracting from the full benefits that MIME was meant to provide. MimeKit is meant to address this issue by following the MIME specification as closely as possible while also providing programmers with an extremely easy to use high-level API.

This led me, at first, to implement another MIME parser library called GMime which is implemented in C and later added a C# binding called GMime-Sharp.

Now that I typically find myself working in C# rather than lower level languages like C, I decided to begin writing a new parser in C# which would not depend on GMime. This would also allow me to have more flexibility in that I'd be able use Generics and create a more .NET-compliant API.

Building

First, you'll need to clone MimeKit and Bouncy Castle from my GitHub repository:

git clone https://github.com/jstedfast/MimeKit.git
git clone https://github.com/jstedfast/bc-csharp.git

Currently, MimeKit depends on the visual-studio-2010 branch of bc-csharp for the Visual Studio 2010 project files that I've added (to replace the Visual Studio 2003 project files). To switch to that branch,

cd bc-csharp
git checkout -b visual-studio-2010 origin/visual-studio-2010

In the top-level MimeKit source directory, there are two solution files: MimeKitDesktopOnly.sln and MimeKit.sln.

MimeKitDesktopOnly.sln just includes the .NET Framework 4.0 C# project (MimeKit/MimeKit.csproj) and the UnitTests project (UnitTests/UnitTests.csproj).

MimeKit.sln includes everything that is in the MimeKitDesktopOnly solution as well as the projects for Xamarin.Android, Xamarin.iOS, and Xamarin.Mac.

If you don't have the Xamarin products, you'll probably want to open the MimeKitDesktopOnly.sln instead of MimeKit.sln.

Once you've opened the appropriate MimeKit solution file in either Xamarin Studio or Visual Studio 2010+ (either will work), you can simply choose the Debug or Release build configuration and then build.

Note: The Release build will generate the xml API documentation, but the Debug build will not.

Contributing

The first thing you'll need to do is fork MimeKit to your own GitHub repository. Once you do that,

git clone git@github.com/<your-account>/MimeKit.git

Once you've got some changes that you'd like to submit upstream to the official MimeKit repository, simply send me a Pull Request and I will try to review your changes in a timely manner.

Reporting Bugs

Have a bug or a feature request? Please open a new issue.

Before opening a new issue, please search for existing issues to avoid submitting duplicates.

Documentation

API documentation can be found in the docs/ directory.

About

A C# MIME creation and parser library with support for S/MIME, PGP and Unix mbox spools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published