NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #217 most downloaded on NuGet
MailKit is an Open Source cross-platform .NET mail-client library that is based on MimeKit and optimized for mobile devices. Features include: * HTTP, Socks4, Socks4a and Socks5 proxy support. * SASL Authentication via ANONYMOUS, CRAM-MD5, DIGEST-MD5, LOGIN, NTLM, OAUTHBEARER, PLAIN, SCRAM-SHA-1, SCRAM-SHA-256, SCRAM-SHA-512 and XOAUTH2. * A fully-cancellable SmtpClient with support for STARTTLS, 8BITMIME, BINARYMIME, ENHANCEDSTATUSCODES, SIZE, DSN, PIPELINING and SMTPUTF8. * A fully-cancellable Pop3Client with support for STLS, UIDL, APOP, PIPELINING, UTF8, and LANG. * A fully-cancellable ImapClient with support for ACL, QUOTA, LITERAL+, IDLE, NAMESPACE, ID, CHILDREN, LOGINDISABLED, STARTTLS, MULTIAPPEND, UNSELECT, UIDPLUS, CONDSTORE, ESEARCH, SASL-IR, COMPRESS, WITHIN, ENABLE, QRESYNC, SORT, THREAD, ANNOTATE, LIST-EXTENDED, ESORT, METADATA / METADATA-SERVER, NOTIFY, FILTERS, LIST-STATUS, SORT=DISPLAY, SPECIAL-USE / CREATE-SPECIAL-USE, SEARCH=FUZZY, MOVE, UTF8=ACCEPT / UTF8=ONLY, LITERAL-, APPENDLIMIT, STATUS=SIZE, OBJECTID, REPLACE, SAVEDATE, XLIST, and X-GM-EXT1. * Client-side sorting and threading of messages (the Ordinal Subject and the Jamie Zawinski threading algorithms are supported). * Asynchronous versions of all methods that hit the network. * S/MIME, OpenPGP, DKIM and ARC support via MimeKit.Cryptography. * Microsoft TNEF support via MimeKit.
Latest stable
5.0.0
Last release 12 days ago
10 Nov 2026
Release timing varies
gaps range from 2 weeks to 4 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
106 versions withdrawn
withdrawn after publishing
127 years old
194 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
MailKit 5.0 is a major release containing a number of breaking changes. See https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md for the c…
MailKit 5.0 is a major release containing a number of breaking changes. See https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md for the complete list of changes and https://github.com/jstedfast/MailKit/blob/master/PortingGuide.md for migration notes.
MailKit 5.0 is a major release containing a number of breaking changes. The headline change is that
MailKit no longer depends on BouncyCastle, allowing it to depend on the new MimeKit.Core package
rather than the full MimeKit cryptography stack.
See PortingGuide.md for step-by-step instructions on porting a project from MailKit
4.x. The guide is also included in the NuGet package (docs/PortingGuide.md).
MailKitLite has been retired. Now that MailKit no longer depends on BouncyCastle, MailKitLite was
functionally identical to MailKit. Projects referencing MailKitLite should reference MailKit
instead.
MailKit now depends on MimeKit.Core (MimeKit 5.0) instead of MimeKit. See the
MimeKit 5.0.0 release notes
for details on the MimeKit changes.
MimeKit.Cryptography package (or the MimeKit meta-package) and call
CryptographyModule.Initialize () during startup.Replaced BouncyCastle's Zlib implementation with System.IO.Compression.DeflateStream for the IMAP
COMPRESS=DEFLATE extension. BouncyCastle's Zlib was the last remaining use of BouncyCastle in
MailKit.
DeflateStream.Flush () is a no-op on .NET Framework and .NET Standard, which makes it unusable
for an interactive protocol. As a result, IMAP COMPRESS is now only supported on .NET 8.0 and
later, and the IImapClient.Compress () and CompressAsync () methods (and their ImapClient
implementations) have been removed from the .NET Framework and .NET Standard builds of MailKit.Z_SYNC_FLUSH rather than Z_FULL_FLUSH, which means
that the compression dictionary is no longer reset after each command. This results in better
compression.Moved DeliveryStatusNotificationType from the MailKit.Net.Smtp namespace to the MailKit
namespace. Add a using MailKit; directive if you get a compile error.
Message sizes, line counts, byte offsets and byte counts are now 64-bit (long) values. RFC 3501
defines these as 32-bit unsigned integers, so messages larger than 2 GB could overflow MailKit's
int APIs, and IMAP4rev2 (RFC 9051) widens them to 63 bits. None of the new values will ever be
negative. The affected APIs are:
IMailFolder.GetStream () and GetStreamAsync () overloads that take offset and count
arguments now take long instead of int. This also applies to MailFolder and ImapFolder.offset and length arguments of ImapFolder.CreateStream () and ImapFolder.CommitStream ()
are now long.IMessageSummary.Size and MessageSummary.Size are now long? instead of uint?.IMailFolder.Size and MailFolder.Size are now long? instead of ulong?.BodyPartText.Lines and BodyPartMessage.Lines are now long instead of uint.SearchQuery.LargerThan () and SearchQuery.SmallerThan () now take long instead of int.IMailSpool.GetMessageSize () and GetMessageSizeAsync () now return long instead of int,
and GetMessageSizes () and GetMessageSizesAsync () now return IList<long> instead of
IList<int>. This also applies to MailSpool and Pop3Client.ISmtpClient.MaxSize and SmtpClient.MaxSize are now long instead of uint. RFC 1870 allows
SIZE values of up to 20 digits, so a value larger than long.MaxValue is clamped to
long.MaxValue.FolderQuota.MessageLimit, StorageLimit, CurrentMessageCount and CurrentStorageSize
are now long? instead of uint?, and the messageLimit and storageLimit arguments of
IMailFolder.SetQuota () and SetQuotaAsync () are now long? instead of uint?. This also
applies to MailFolder and ImapFolder. Negative limits throw ArgumentOutOfRangeException.SaslMechanism.Create () now returns a non-nullable SaslMechanism and throws
NotSupportedException if the requested mechanism is not supported, rather than returning null.
Code that checked the result of Create () for null should be updated to use the new
SaslMechanism.TryCreate () methods instead.
Removed previously obsoleted APIs:
BodyPart, BodyPartBasic, BodyPartMessage, BodyPartMultipart and
BodyPartText constructors. Use the (ContentType, string) constructors instead.MailFolder constructor. Use
MailFolder (string fullName, char directorySeparator, FolderAttributes attributes) instead.ImapFolderConstructorArgs.Name property.SslCipherAlgorithm, SslCipherStrength, SslHashAlgorithm, SslHashStrength,
SslKeyExchangeAlgorithm and SslKeyExchangeStrength properties on IMailService,
MailService, SmtpClient, ImapClient and Pop3Client have been removed from the .NET 10.0
build of MailKit, where the underlying SslStream APIs are obsolete. Use SslCipherSuite
instead. They remain available on .NET Framework, .NET Standard and .NET 8.0.Removed legacy exception serialization support from all of MailKit's exceptions on .NET
Framework: the [Serializable] attribute, the protected (SerializationInfo, StreamingContext)
constructors and the GetObjectData () overrides. These APIs are obsolete
(SYSLIB0051)
and BinaryFormatter-based serialization is
insecure.
Exception subclasses that chained to the serialization constructors must remove them.
The AnnotationAttribute (string) constructor now validates the specifier according to
rfc5257 section 3.2 and throws ArgumentException if it
contains empty components (e.g. a leading or trailing . or ..), NUL or non-ASCII characters,
or priv/shared components other than the trailing scope suffix (e.g. value.priv.priv).
Previously, only * and % were rejected. Attribute specifiers parsed from IMAP server responses
are not validated.
Replaced ImapClient.EnableQuickResync (), ImapClient.EnableUTF8 () (and their Async variants) with
new ImapClient.Enable (ImapFeatures) and EnableAsync (ImapFeatures) methods. ImapFeatures is a flags
enum, so multiple features can be enabled with a single ENABLE command, e.g.
client.Enable (ImapFeatures.QuickResync | ImapFeatures.UTF8Accept). EnableUTF8 () has also been removed
from IImapClient, and EnableQuickResync () has been removed from IMailStore and MailStore.
Added IMailFolder.DeletedCount and DeletedStorageSize properties and DeletedCountChanged and
DeletedStorageSizeChanged events. Custom IMailFolder implementations that do not derive from
MailFolder will need to implement them.
ImapFolder.SetQuota () and SetQuotaAsync () now throw NotSupportedException if the server
advertises rfc9208 quota resources (QUOTA=RES-*) but not the QUOTASET capability, since such servers
do not support the SETQUOTA command.
SmtpClient now throws the new SmtpServiceNotAuthenticatedException (which derives from
ServiceNotAuthenticatedException) when the server responds with 530 Authentication required.
Code that catches ServiceNotAuthenticatedException is unaffected, but code that checks for the exact
type will need to be updated.
The message of an SmtpProtocolException thrown due to an unexpected disconnect no longer includes the
response text from a previous command. The last response received for the current command is now
available via the new SmtpProtocolException.LastResponse property instead.
(issue #1748)
Multi-line SMTP responses are now joined using \r\n rather than \n, matching the line endings used
on the wire. This affects SmtpResponse.ResponseText as well as the new SmtpCommandException.ResponseText
and SmtpProtocolException.LastResponse properties. Code that splits multi-line responses on '\n'
should be updated to split on "\r\n" (or trim the trailing '\r' from each line).
The error.type values reported by MailKit's metrics are now more specific. See
Telemetry changes below.
Simplified the IMailFolder.Store () and StoreAsync () methods for annotations to take a new
IStoreAnnotationsRequest parameter (implemented by the new StoreAnnotationsRequest class), matching
the existing flags and labels APIs. The previous overloads that took an IList<Annotation> (with or
without a modseq) are now extension methods in IMailFolderExtensions, so most calling code should
continue to compile unchanged. Classes that implement IMailFolder (or subclass MailFolder) will
need to implement the new request-based methods instead. The UID and index-based Store () overloads
now return the UIDs/indexes of the messages that were not updated, and the single-message overloads
return a bool.
Simplified the IMailFolder.CopyTo (), MoveTo () and Expunge (IList<UniqueId>) APIs (and their
Async variants) to take new ICopyRequest, IMoveRequest and IExpungeRequest parameters. The
previous overloads that took an IMailFolder destination (or no request) are now extension methods
in IMailFolderExtensions, so most calling code should continue to compile unchanged. Classes that
implement IMailFolder (or subclass MailFolder) will need to implement the new request-based
methods instead.
Added OnStarted () and OnCompleted () methods to the IStoreRequest and IAppendRequest
interfaces (and therefore IStoreFlagsRequest, IStoreLabelsRequest and IReplaceRequest).
Custom implementations of these interfaces will need to implement the new methods. The built-in
StoreFlagsRequest, StoreLabelsRequest, AppendRequest and ReplaceRequest classes implement
them as virtual no-ops.
Added OnStarted (), OnCompleted () and OnProgress () methods to the IFetchRequest interface and
an OnProgress () method to the IStoreRequest interface. Custom implementations of these interfaces
will need to implement the new methods. The built-in FetchRequest, StoreFlagsRequest,
StoreLabelsRequest and StoreAnnotationsRequest classes implement them as virtual no-ops.
Removed the IMessageSummary.Folder property and the MessageSummary (IMailFolder, int) constructor.
Summaries no longer hold a reference to the folder they were fetched from, which makes it possible to
cache, serialize and rehydrate them independently of a live IMailFolder instance. Applications that
need to know which folder a summary came from should track that themselves (e.g. alongside the
collection returned by Fetch ()).
Replaced the [Flags] capability enums with capability-set classes. The 64-bit ImapCapabilities
enum was almost out of room for new IMAP extensions, and none of the enums could represent extensions
that MailKit does not know about.
ImapCapabilities, SmtpCapabilities and Pop3Capabilities enums have been renamed to
ImapCapability, SmtpCapability and Pop3Capability. They are no longer [Flags] enums and
no longer have a None value.ImapCapabilities, SmtpCapabilities and Pop3Capabilities are now sealed classes that
implement IReadOnlyCollection<T> of the corresponding enum. Replace
client.Capabilities.HasFlag (ImapCapabilities.Idle) with
client.Capabilities.Contains (ImapCapability.Idle).Capabilities properties of ImapClient, SmtpClient and Pop3Client (and their
interfaces) are now read-only. Replace client.Capabilities &= ~ImapCapabilities.Compress with
client.Capabilities.Disable (ImapCapability.Compress) to prevent MailKit from using an extension.Names property, Contains (string) and GetValues (string) methods expose the raw
capabilities advertised by the server, including ones that MailKit does not know about (e.g.
client.Capabilities.GetValues ("AUTH")). Disable () does not affect the raw names.Renamed SmtpResponse.Response to SmtpResponse.ResponseText for consistency with
SmtpCommandException.ResponseText and SendResult.ResponseText.
Reworked the IMailTransport send API around request objects
(ISendRequest/SendRequest and ISmtpSendRequest/SmtpSendRequest):
IMailTransport and MailTransport now only declare Send ()/SendAsync () methods that take an
ISendRequest (with or without FormatOptions). The previous Send (MimeMessage, ...) and
Send (MimeMessage, MailboxAddress, IEnumerable<MailboxAddress>, ...) overloads are now extension
methods in the MailKit namespace, so existing calls continue to compile as long as there is a
using MailKit; directive.Send () and SendAsync () methods now return a SendResult instead of a string. The
server's final response text is available via SendResult.ResponseText. SmtpClient returns an
SmtpSendResult (cast the result to access its StatusCode).SmtpClient.OnSenderAccepted (), OnSenderNotAccepted (),
OnRecipientAccepted (), OnRecipientNotAccepted (), OnNoRecipientsAccepted (),
GetEnvelopeId () and GetDeliveryStatusNotifications () virtual methods. Rather than subclassing
SmtpClient, subclass SmtpSendRequest and override the equivalent methods, or set its
EnvelopeId and DeliveryStatusNotifications properties.SmtpClient.DeliveryStatusNotificationType and
ISmtpClient.DeliveryStatusNotificationType properties. Use
SmtpSendRequest.DeliveryStatusNotificationType instead.MessageSentEventArgs constructor now takes an ISendRequest and a SendResult, and the
event args expose new Request and Result properties. MessageSentEventArgs.Response has
been renamed to ResponseText.IMailService now extends IAsyncDisposable. Custom implementations of IMailService (or
IMailStore, IMailTransport and IMailSpool) that do not derive from MailService must implement
DisposeAsync (). On .NET Framework and .NET Standard 2.0, MailKit now depends on
Microsoft.Bcl.AsyncInterfaces.
AccessControlList no longer derives from List<AccessControl>. It now implements
IList<AccessControl> and IReadOnlyList<AccessControl> (and keeps AddRange ()), and its methods throw
ArgumentNullException when given a null access control. Use LINQ in place
of List<T>-only methods such as Find (), Sort () or ForEach ().
IImapClient has a new CreateIdleSession () method. Custom implementations of IImapClient must
implement it.
Replaced the Windows Forms IMAP demo with a .NET 10 WPF sample featuring asynchronous, serialized IMAP access, paged message lists, text-only previews, live folder updates, and opt-in Google and Microsoft 365 OAuth sign-in using your own app registrations.
MailService (and therefore ImapClient, Pop3Client and SmtpClient) now implements
IAsyncDisposable, so clients can be used with await using. Like Dispose (), DisposeAsync ()
does not send LOGOUT/QUIT; call DisconnectAsync (true) first to disconnect cleanly. Subclasses
can override the new protected DisposeAsyncCore () method to release resources asynchronously.
Added ISendRequest/SendRequest and ISmtpSendRequest/SmtpSendRequest, which bundle a message
with its envelope sender, recipients, transfer progress and (for SMTP) DSN options, making it
possible to customize a single send operation without subclassing SmtpClient.
OnStarted () is called once the server is ready to receive the message data and
OnCompleted () is called after the server has accepted the message.SmtpSendRequest also has virtual OnSenderAccepted (), OnSenderNotAccepted (),
OnRecipientAccepted (), OnRecipientNotAccepted () and OnNoRecipientsAccepted () callbacks.
Overriding OnRecipientNotAccepted () to not throw allows a message to be delivered to the
remaining recipients.Added SendResult (and the SMTP-specific SmtpSendResult), which reports the server's final
response along with the lists of accepted and rejected recipients.
Added request callbacks that make it possible to observe exactly which changes the IMAP server has applied, laying the groundwork for an offline/sync layer (issue #2023):
ICopyRequest/CopyRequest, IMoveRequest/MoveRequest,
IExpungeRequest/ExpungeRequest and IStoreAnnotationsRequest/StoreAnnotationsRequest types.IFetchRequest now has OnStarted () and OnCompleted () callbacks that report the UIDs or indexes
of the messages fetched by each FETCH command.OnStarted () is called immediately before each command is sent to the server, and OnCompleted ()
is called only after the server has successfully completed that command. Large operations may be
split into multiple commands, in which case the callbacks are called once per subset of messages.UNCHANGEDSINCE, Append and
Replace callbacks report the UID of the new message (if available) and Copy/Move callbacks report
the UniqueIdMap of the copied/moved messages.ImapFolder emulates an operation the server does not natively support (e.g. MOVE without
the MOVE extension or MULTIAPPEND), the callbacks are still invoked once per logical operation.Added a ProtocolErrorType enum and a ProtocolException.ErrorType property that classifies why a
protocol error occurred (UnexpectedDisconnect, InvalidResponse, ServerDisconnected or
ResponseTooLarge). ImapProtocolException, Pop3ProtocolException and SmtpProtocolException
have new constructors that take a ProtocolErrorType.
Added a CommandErrorType enum and a CommandException.ErrorType property that classifies why the
server rejected a command (Rejected, InvalidCommand, NotSupported, PermissionDenied,
NotFound, AlreadyExists, QuotaExceeded, LimitExceeded, InUse, TemporaryFailure or
ServerError), along with a CommandException.IsTransient convenience property that is true for
TemporaryFailure and InUse errors.
ImapCommandException.ErrorType is derived from the IMAP response codes (RFC 5530 and others),
exposed via the new ImapCommandException.ResponseCodes property.Pop3CommandException.ErrorType is derived from the POP3 extended response code (RFC 2449/3206),
exposed via the new Pop3CommandException.ResponseCode property.SmtpCommandException.ErrorType is derived from the SMTP status code.Added an ImapCommandException.ResponseCodes property, a read-only list of every error response code
(e.g. [NONEXISTENT], [OVERQUOTA] or [BADURL ...]) received for the failed command, in the order
they were received. New ImapCommandException constructors take an IEnumerable<ImapResponseCode>.
Made ImapResponseCode, ImapResponseCodeType and all of the ImapResponseCode subclasses (such as
AppendUidResponseCode, CopyUidResponseCode, BadUrlResponseCode, UndefinedFilterResponseCode,
WebAlertResponseCode and MaxConvertResponseCode) public. They have public constructors so that
ImapCommandException instances can be created in unit tests.
Added ImapCapability values for more IMAP extensions, and ImapClient now detects them:
URLAUTH (rfc4467), URLAUTH=BINARY (rfc5524), URL-PARTIAL (rfc5550), IMAPSIEVE (rfc6785),
QUOTASET and QUOTA=RES-* (rfc9208), INPROGRESS (rfc9585), UIDONLY (rfc9586),
LIST-METADATA (rfc9590), JMAPACCESS (rfc9698), MESSAGELIMIT and SAVELIMIT (rfc9738)
and UIDBATCHES (rfc10022). Other than INPROGRESS, MailKit doesn't use these extensions itself
yet. Advertised values, such as the MESSAGELIMIT limit, can be read with client.Capabilities.GetValues ("MESSAGELIMIT").
Added support for the IMAP INPROGRESS extension (rfc9585), which allows servers to report the progress
of long-running commands. Progress is reported via the new OnProgress () callback on the fetch, store,
copy, move and expunge request types:
processed and total are reported as-is from the server and may be null if the server does not
know them. If both are null, the server has only indicated that the command is still in progress.ImapResponseCodeType.InProgress and InProgressResponseCode. INPROGRESS response codes are
not included in ImapCommandException.ResponseCodes.Added ImapIdleSession, created with ImapClient.CreateIdleSession (), which waits for changes to the
selected folder without having to manage the IDLE command manually:
WaitForChanges ()/WaitForChangesAsync () return an ImapIdleChanges batch of events
(CountChangedIdleEvent, MessageExpungedIdleEvent, MessagesVanishedIdleEvent,
MessageChangedIdleEvent and FolderStatusChangedIdleEvent), and ReadChangesAsync () returns
the batches as an IAsyncEnumerable<ImapIdleChanges>.IDLE command is automatically re-issued before servers time it out, and bursts of events are
coalesced into a single batch. If the server does not support IDLE, the session polls with NOOP.CancellationToken ends the IDLE command gracefully, so the client stays connected
and usable.ImapIdleOptions controls the refresh interval, the polling interval and the coalescing delay.Added ImapFeatures.IMAP4rev2 which can be used with ImapClient.Enable () to enable IMAP4rev2 semantics
on servers that advertise both IMAP4rev1 and IMAP4rev2 (rfc9051 Appendix A). Once enabled, ImapClient
uses UTF-8 mailbox names and assumes the extensions implied by IMAP4rev2.
Added StatusItems.Deleted, which updates the new IMailFolder.DeletedCount property (and emits the
DeletedCountChanged event) with the number of messages marked \Deleted. This is only supported when
IMAP4rev2 is in use or when the server advertises QUOTA=RES-MESSAGE.
Added StatusItems.DeletedStorage, which updates the new IMailFolder.DeletedStorageSize property (and
emits the DeletedStorageSizeChanged event) with the amount of storage, in kilobytes, that expunging the
folder would reclaim. This is only supported when the server advertises QUOTA=RES-STORAGE (rfc9208).
Added support for the rfc9208 MAILBOX and ANNOTATION-STORAGE quota resources via the new
FolderQuota.MailboxLimit, CurrentMailboxCount, AnnotationStorageLimit and
CurrentAnnotationStorageSize properties. All quota resources reported by the server (including
unrecognized ones) are also available via the new FolderQuota.Resources dictionary of
FolderQuotaResource values.
Added ProxyProtocolException (string, ProtocolErrorType) and
ProxyProtocolException (string, ProtocolErrorType, Exception) constructors.
Added more context to SMTP exceptions to make it easier to diagnose why sending a message failed (issue #1748):
SmtpCommand enum identifying the SMTP command (e.g. MailFrom, RcptTo, Data)
that was being processed when an error occurred.SmtpCommandException.Command and SmtpCommandException.ResponseText properties, along
with new constructors that take an SmtpCommand and SmtpResponse.SmtpProtocolException.Command and SmtpProtocolException.LastResponse properties. When
commands are pipelined, LastResponse can be used to determine which of the queued commands the
server responded to before the error occurred.SmtpServiceNotAuthenticatedException with Command, StatusCode and ResponseText
properties.SmtpClient now validates the sender and recipient addresses with MimeKit's
SmtpUtf8AddressValidator whenever a message is sent using the SMTPUTF8 extension. If an address
is not valid, the new SmtpUtf8AddressException (which derives from ArgumentException) is thrown
before any commands are sent. The exception's Mailbox and Error properties identify the address
and why it was rejected. Only internationalized addresses are validated; ASCII addresses (including
IDN-encoded xn-- domains, the null reverse-path and Postmaster) are sent as-is.
When sending with SMTPUTF8, SmtpClient now sends addresses exactly as parsed or set (IDN-encoded
domains are no longer decoded). Without SMTPUTF8, domains are IDN-encoded. The RCPT TO and
ORCPT addresses now follow the same per-message decision as MAIL FROM, and duplicate recipients
are detected by comparing their IDN-encoded forms.
The error.type attribute reported by the mailkit.net.*.client.* metrics is now more specific for
protocol and command errors. Dashboards or alerts that match on protocol_error or command_error
should be updated to also match the new values. SMTP command errors continue to report the numeric
SMTP status code (e.g. 550), and all socket, cancellation and TLS values are unchanged.
| Old value | New value | Condition |
|---|---|---|
protocol_error |
response_ended |
The server unexpectedly closed the connection. |
protocol_error |
invalid_response |
The server sent a response that could not be parsed. |
protocol_error |
server_disconnected |
The server explicitly closed the connection (e.g. IMAP BYE). |
protocol_error |
response_too_large |
The server sent a response that exceeded the client's limits. |
protocol_error |
protocol_error |
Any other protocol error. |
command_error |
rejected |
The server rejected the command (e.g. IMAP NO, POP3 -ERR). |
command_error |
invalid_command |
The command was invalid or malformed (e.g. IMAP BAD). |
command_error |
not_supported |
The command or a parameter is not supported. |
command_error |
permission_denied |
The client lacks permission to perform the operation. |
command_error |
not_found |
The requested folder, message or other resource does not exist. |
command_error |
already_exists |
The resource being created already exists. |
command_error |
quota_exceeded |
The operation would exceed a storage quota. |
command_error |
limit_exceeded |
The operation would exceed a server-imposed limit. |
command_error |
in_use |
The resource is in use or locked by another session. |
command_error |
temporary_failure |
The server reported a temporary failure. |
command_error |
server_error |
The server encountered an internal error. |
command_error |
command_error |
Any other command error. |
See Telemetry.md for the full list of error.type values.
MessageThreader pruning and result construction non-recursive to prevent
stack overflows from deeply nested message reference chains.THREAD parsing and MessageSummary body lookup and enumeration non-recursive
to prevent stack overflows from deeply nested server responses.Envelope.TryParse () or Envelope.ToString (), avoiding recursive group
notifications and serialization.application/octet-stream, using
text/plain for text parts and multipart/mixed for multipart containers, while retaining
parseable parameters.BODY and BODYSTRUCTURE parsing non-recursive to prevent stack overflows from
deeply nested multipart bodies, embedded messages, and body-extension lists.
BodyPart.TryParse () and BodyPart.ToString () also use non-recursive parsing and serialization
for built-in body structures.ImapStream.Flush () to always flush the underlying stream when data had been written to it.
Previously, if Write () had drained its internal buffer directly to the underlying stream,
Flush () would return without flushing the underlying stream, which could deadlock when the
underlying stream did its own buffering.SaslMechanismDigestMd5 to verify that the server supports the "auth" quality of protection
before responding with qop="auth". If the server's qop list does not include "auth", authentication
now fails with a SaslException (SaslErrorCode.InvalidChallenge). The qop list is now also parsed
case-insensitively and tolerates whitespace around commas, as allowed by RFC 2831.ImapFolder.Append (IList<IAppendRequest>) to report aggregate progress when the server does not
support MULTIAPPEND. The first request's TransferProgress now reports the progress of the entire
batch, consistent with the MULTIAPPEND code path. Previously, each request's TransferProgress was
used to report the progress of its own message.ImapClient.Notify () to throw InvalidOperationException if an ImapMailboxFilter.Mailboxes or
ImapMailboxFilter.Subtree filter contains folders that belong to a different ImapClient.FullName. Previously, folders with names using raw 8-bit
characters, non-canonical modified UTF-7, or invalid modified UTF-7 could end up with a phantom
\NonExistent parent folder instead of the real (cached) parent folder.ImapClient to use UTF-8 mailbox names (instead of modified UTF-7) when connected to an IMAP server
that only advertises IMAP4rev2 (i.e. not IMAP4rev1), as required by rfc9051. ImapClient now also sends
non-ASCII strings as UTF-8 quoted strings and omits CHARSET UTF-8 from SEARCH commands when connected to
such servers.ImapClient to assume STATUS=SIZE support when connected to an IMAP4rev2-only server (since rfc9051
folded it into the base protocol), allowing StatusItems.Size to be queried.ImapFolder.Check () to send NOOP instead of CHECK when IMAP4rev2 is in use
since rfc9051 removed the CHECK command.Socks4Client and Socks5Client to throw a ProxyProtocolException (with an ErrorType of
ProtocolErrorType.UnexpectedDisconnect) if the proxy server disconnects in the middle of a reply.
Previously, Connect () and ConnectAsync () would spin in an infinite loop.ImapFolder.GetQuota () to preserve IMAP quota values larger than 32 bits (such as those
reported by Gmail). Previously, these values were silently truncated to their lower 32 bits. Values
larger than long.MaxValue are now clamped to long.MaxValue.ImapFolder.SetQuota (null, null) to send SETQUOTA <root> () (which removes all limits).
Previously, it sent a malformed SETQUOTA <root> ) command.ImapFolder to correctly parse QUOTA responses with an empty list of resources.Envelope.ToString () and Envelope.TryParse () so that envelopes reliably round-trip:
Date values with fractional seconds, or with years earlier than 1000, are now serialized using the
ISO 8601 round-trip format. Previously, the fractional seconds were lost and a year of 0001
became 2001.MessageId and InReplyTo values are now preserved exactly. This includes values that are
already wrapped in angle brackets, values that contain spaces or multiple msg-ids, and <>.fejj) are now serialized with an empty domain instead of
"localhost". As a result, an address such as root@localhost now round-trips correctly.
Note: a "localhost" domain in strings serialized by older versions of MailKit is now
parsed literally, so a domain-less address that was serialized by an older version
deserializes as user@localhost.BodyPart.ToString () and BodyPart.TryParse () so that body structures reliably round-trip:
ContentLocation is now serialized using Uri.OriginalString. Previously, Uri.ToString ()
unescaped values such as a%20b.png, so they were dropped when parsed.ContentLanguage array is now preserved instead of becoming null.BodyPartBasic, BodyPartText or BodyPartMessage) now
matches the serialized part, regardless of its MIME type. For example, a BodyPartBasic with a
text/* type, or a BodyPartMessage with a message/global type, now round-trips.BodyPart.TryParse () now returns false for invalid input instead of throwing an
ArgumentException. Examples of invalid input are an invalid or duplicate parameter name, an
invalid disposition, or a number that overflows.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Bumped MimeKit dependency to 4.18.2.
Fixed telemetry duration histograms being 100x too large on Linux/macOS. (issue #2020)
Fixed SaslMechanismNativeNtlm on systems that need a multi-stage auth. (issue #2007)
Updated nullability of ImapClient.Inbox (which will never return null). (issue #1996)
SECURITY: Fixed protocol streams to reset internal buffers after upgrading to SSL/TLS.
SECURITY: Bumped MimeKit to 4.15.1 for a security fix that prevents mailbox addresses from being allowed to contain CRLF sequences which can be used t…
MAIL FROM or RCPT TO commands.Default the SmtpClient/Pop3Client/ImapClient.SslProtocols to the ServicePointManager.SecurityProtocol value in .NET Framework (net4x). (issue #1952)
Re-added NTLM to the list of mechanisms to try by default. (issue #1953)
Updated MailService::GetSslClientAuthenticationOptions to be protected virtual. (issue #1931)
Fixed tokenization of IMAP atom tokens that start with '+'. (issue #1914)
Fixed authentication bugs introduced into 4.12.0 related to adding GSSAPI and native NTLM auth support which causes problems on Linux/Mac. (issue #191
Added support for native NTLM auth (using .NET Core's NegotiateAuthentication API). This new class is called SaslMechanismNtlmNative and is the defaul
Default MailService.SslProtocols to SslProtocols.None which is what the dotnet SslStream team recommends. (As weird as it may seem, SslProtocols.None
Work around a QQMail/Yandex IMAP BODYSTRUCTURE response for empty multipart. (issue #1861)
Added an IMAP work-around for mail.ru which sometimes sends integer tokens as decimals in its responses. (issue #1838)
("ALTERNATIVE")). (issue #1841)Added a UniqueIdRange.SortOrder property.
Fixed ImapClient and Pop3Client.Connect/Async() when OTEL is enabled. (issue #1765)
Added Activity/Metrics for Imap/Pop3/SmtpClient. (issue #1499)
Swallow SMTP RSET exceptions. These obscure other Send/SendAsync exceptions. Fixes a regression introduced in 4.4.0. (issue #1748)
Added a new SmtpClient.RequireTLS property to fix sending mail via Strato.de. (issue #1737)
Split more sync/async logic to reduce allocations made by async state machines when calling the synchronous public APIs instead of the async APIs. (is
Fixed an ArgumentOutOfRangeException error in Fetch(int min, int max, ...) where min and max were greater than folder.Count. (issue #1640)
Fixed a bug where the HttpProxyClient and HttpsProxyClient could end up reading the mail server greeting, causing a connection failure for the ImapCli
List<IMessageSummary> capacity estimation for Fetch (IList<UniqueId>, ...).Fixed queueing logic for pipelining SMTP and POP3 commands. (issue #1568)
Marked the AccessRight and UniqueId structs as readonly.
Decrement ImapFolder.Count when ImapClient receives an untagged EXPUNGE notification and emit a CountChanged event. (issue #1509)
Fixed bitmasking logic in SmtpClient.cs for deciding whether to use the BDAT command.
(NIL NIL "" "localhost")
(issue #1471)Fixed potential memory leaks in Pop3Client.
Fixed fetching of MessageSummaryItems.PreviewText if the octet count of the message body is 0. (issue #1430)
Reverted the socket connection change to allow Socket.Connect() to do DNS lookups for us. Turns out, Socket.Connect() doesn't iterate over all returne
Fixed a bug that caused ImapFolder.Fetch/FetchAsync to throw TaskCanceledException instead of allowing the correct exception to bubble up. (issue #141
Added work-around for IMAP BODYSTRUCTURE responses that have a NIL multipart body. (issue #1393)
Do not use ApplicationProtocols with SSL. (issue #1352)
Reduced string allocations in Pop3Engine's capability parser.
Fixed NTLM to always prefer the supplied domain over the TargetName or TargetInfo.DomainName. (issue #582)
Removed APIs marked as \[Obsolete\] in 2.x.
Nothing published for this version
Use DebugType=full for .NET Framework v4.x. (issue #1239)
Added support for logging timestamps in the ProtocolLogger (see the LogTimestamps and TimestampFormat properties on ProtocolLogger).
ProtocolLogger (see the LogTimestamps and TimestampFormat
properties on ProtocolLogger).ProtocolLogger.RedactSecrets property to true. (issue #1174)Added new properties to all clients to get SSL cipher/hash/protocol/key-exchange info. (issue #1175)
Fixed the .NET 5.0 build to include .NET 5.0-specific features. Previous releases incorrectly used
Added work-around for IMAP servers that do not correctly handle the ESEARCH RETURN () syntax the same as RETURN (ALL). (issue #1177)
RETURN () syntax
the same as RETURN (ALL). (issue #1177)Handle BAD responses to the NAMESPACE command for Exchange. (issue #1135)
A few NTLM improvements that I hope are correct.
Don't enable support for TLS v1.1 by default anymore. (issue #1077)
Refactored Connect/ConnectAsync() logic to set timeouts *before* calling SslStream.AuthenticateAsClient() when connecting to an SSL-wrapped service. (
Make sure to use the InvariantCulture when converting port values to a string. (issue #1040)
Added a MessageSummary.Folder property and MessageThread.Message property to allow developers to thread messages from multiple IMAP folders and be abl
MAIL FROM and RCPT TO commands even if a options.International is not
explicitly set to true if any of the mailbox addresses are international
addresses.
(issue #1026)Properly handle connection drops in SmtpClient.NoOp() and NoOpAsync() methods.
Added work-around for ENVELOPE responses with a NIL address token in an address-list. (issue #991)
Fixed the IMAP ENVELOPE parser to have a more lenient fallback if it fails to be able to parse the Message-Id token value. (issue #976)
-1 as a line count or octet count in the
BODYSTRUCTURE response.Ignore NIL tokens in the body-fld-lang token list. (issue #953)
<CR><LF> in untagged FETCH responses.
(issue #954)Note: Developers using ImapFolder.GetStreamsAsync() will need to update their code as this release breaks API/ABI.
Don't use PublicSign on non-Windows NT machines when building.
() as a message/rfc822 body token.
(issue #944)Added work-around for IMAP ENVELOPE responses that do not include an In-Reply-To token. (issue #932)
* BYE.
(issue #938)Fixed trimming delimiters from the end of IMAP folder names.
Fixed SmtpClient.Send*() to make sure never to add an extra CRLF sequence to the end of messages when sending via the DATA command. (issue #895)
Improved the default SSL/TLS certificate validation logic.
Optimized MailKit's logic for breaking apart long IMAP commands for GMail, Dovecot, and Yahoo! Mail.
Bumped the System.Net.Security dependency for security fixes (CVE-2017-0249).
One column per quarter.