NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #1991 most downloaded on pub.dev
enough_mail - IMAP, POP3, SMTP email library with high/low-level APIs and MIME parsing
Latest stable
3.0.0
Last release 27 days ago
26 Oct 2026
Ships unpredictably
gaps range from 8 days to 1.7 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
64 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
STARTTLS is now enforced. With SocketType.starttls or plain, IMAP and SMTP used to send credentials in clear text if the server did not advertise STAR
SocketType.starttls or plain, IMAP and SMTP used to send credentials in clear text if the server did not advertise STARTTLS, so a man-in-the-middle only had to strip that capability. The client now refuses to authenticate unless plainNoStartTls was explicitly chosen. Capabilities from before the TLS upgrade are discarded, and the certificate is checked against the configured host name.event_bus. Events are now delivered through Dart streams instead of the event_bus package.A security review in September 2026 (#296) fixed several serious problems. Upgrading is strongly recommended.
SocketType.starttls or plain, IMAP and SMTP used to send credentials in clear text if the server did not advertise STARTTLS, so a man-in-the-middle only had to strip that capability. The client now refuses to authenticate unless plainNoStartTls was explicitly chosen. Capabilities from before the TLS upgrade are discarded, and the certificate is checked against the configured host name..NET also no longer lose their leading period.", \, non-ASCII characters or line breaks previously produced malformed or injectable commands.Bcc: is left alone.toString() of MailAccount, MailServerConfig and OauthToken now hides passwords and tokens. toJson() is unchanged.ClientConfig.isFromInsecureSource.Random.secure() where available.ad+min@example.com is no longer treated as admin@example.com.event_bus. Events are now delivered through Dart streams instead of the event_bus package.ImapClient.namespace() returns the personal, other users' and shared namespaces. Contributed by Dmitry Protasov (#295).BODY[] can be appended without corruption through the new appendMessageBytes. Contributed by David Hobley (#292).ImapClient, SmtpClient and ClientBase accept an optional SecurityContext for client certificate authentication. This change also fixes a missing onBadCertificate when upgrading to SSL. Contributed by icd360sevofficial (#273).idleStart(waitForContinuation: true). The returned future waits until the server confirms IDLE (RFC 2177), which is useful when handing the connection off to another process. It fails if the connection is lost first. Contributed by BrLumen (#274).FetchParser now understands X-GM-THRID, X-GM-MSGID and X-GM-LABELS. Contributed by dev10m-adv (#275).PopClient.authenticateWithOAuth2() uses AUTH XOAUTH2. PopClient also accepts a SecurityContext.deleteMessages() and the move/trash fallbacks used a plain STORE for UID sequences, so a different message could be flagged and permanently removed. They now use UID STORE and, where available, UID EXPUNGE limited to the affected messages. Where supported, UNSELECT replaces CLOSE, so messages deleted with canUndo are no longer expunged as a side effect.RSET, the connection stays usable, and the call fails with the rejecting reply.SmtpException, so MailClient.sendMessage fails with a MailException instead of an uncaught ArgumentError.store() were broken. A failed retrieve no longer makes the next poll skip the remaining new messages.=25PDF=2D1=2E7 instead of %PDF-1.7). They are now decoded to their bytes. Contributed by David Hobley (#287).BODY[] literal is now normalised on the raw bytes, without corrupting non-UTF-8 charsets. Contributed by David Hobley (#293).MailClient.reconnect() and resume() could hang forever and disconnect() could not abort them. The retry interval now grows exponentially, and an aborted reconnect no longer drops events permanently.250<CRLF> no longer throw and hang the pending command. Contributed by BrLumen (#285).errorsAreFatal. Contributed by BrLumen (#302).LIST/UIDL on an empty POP3 mailbox now completes.INBOX.Financial.Audit(s) work in extended LIST responses and in commands. Contributed by David Hobley (#289).NO [TRYCREATE]. Contributed by BrLumen (#298).UTF8=ACCEPT is enabled. selectMailboxByPath() encodes names in modified UTF-7, and UTF-8 is only sent once UTF8=ACCEPT has been enabled (RFC 6855). Gmail otherwise answers BAD Could not parse command. Contributed by BrLumen (#300).-03-30, and UTC as -0000. Two- and three-digit years now follow RFC 5322.UTF-8.UsernameType.emailLocalPart now returns the local part instead of the domain, and forceSslConnection also updates the generic preferred servers.MailCodec.wrapText(). Contributed by nogringo (#276).dart analyze issues (nogringo).| Contributor | Contributions |
|---|---|
| Robert Virkus | Security review, reliability and codec fixes, event streams, maintenance |
| David Hobley | APPEND with INTERNALDATE and raw bytes, Bcc leak fix, six IMAP, codec and parsing fixes |
| BrLumen | idleStart continuation flag, mailbox path encoding fixes, SMTP bare reply codes, IDLE error leak |
| nogringo | Header folding fixes, bare LF tolerance, wrapText() performance, analyzer cleanup |
| Dmitry Protasov | IMAP NAMESPACE extension |
| icd360sevofficial | mTLS SecurityContext support |
| dev10m-adv | Gmail extension fields in FetchParser |
Your coding agent can read these notes before it upgrades. Set up the MCP server →
chore: Update plugin and dependencies versions - thanks to Dr-Usman!
Fix: Fix serialization of ServerConfig - thanks to RobinJespersen!
Fix: Ensure compatibility with Flutter 3.16 - thanks to Tzanou123!
Fix: use refreshed OAUTH tokens when using the high level MailClient API.
FETCH responses.Fix: Apply correct mailbox path separator - thanks nruzzu!
Fix: RangeError when a Mailbox name contains a parentheses - thanks nruzzu
Loosened dependency restrictions a bit upon suggestion from hpoul
The MailClient.deleteMessages() / undoDeleteMessages() as well as the moveMessages() and undoMoveMessages() calls will now update the given messages U
MailClient.deleteMessages() / undoDeleteMessages() as well as the moveMessages() and undoMoveMessages() calls
will now update the given messages UIDs automatically, when they have been specified.multipart/alternative message or message part by adding the option plainText and htmlText parameters
in MessageBuilder.prepareMultipartAlternativeMessage() and addMultipartAlternative().Thanks to yarsort resolved various POP3 bugs.
Thanks to matthiasn the date parsing/generation on west of greenwich timezones now works properly.
Improvements and fixes:
MimeMessage:
MimePart? getAlternativePart(MediaSubtype subtype).List<MailAddress> get recipients getter.binary transfer-encoding for text message parts.guid / global unique IDs which are set automatically when using the high-level MailClient.refresh and onConfigChanged callback methods when connecting to a mail service using MailClient.MailClient with Future<DeleteResult> deleteMessages( MessageSequence sequence, {bool expunge = false}).
OauthAuthentication now contains a complete OauthToken.
mainMessageBuilder: Access also text-attachments in the attachments getter.STARTTLS when the IMAP service supports it.Breaking changes:
import 'package:enough_mail/enough_mail.dart'; or one of the specializes sub-packages codecs.dart,discover.dart, highlevel.dart, imap.dart, mime.dart, pop.dart or smtp.dart.Authentication.passwordCleartext is renamed to Authentication.passwordClearTextMailbox API has changed specifically when creating mailboxes yourself.Other:
Fix generating messages with several recipients in MessageBuilder. Previously semicolons were used that were not accepted by all mail providers.
MessageBuilder. Previously semicolons were used that were not accepted by all mail providers.Add bool Function(X509Certificate)? onBadCertificate callback to handle invalid certificates #167
bool Function(X509Certificate)? onBadCertificate callback to handle invalid certificates #167MailClientIDLE requests when already in idle mode in ImapClientFix some IMAP mailbox commands when there is no mailbox selected: #160 #164 #165
Add easier method to setup a MailAccount with manual settings by calling MailAccount.fromManualSettings() or MailAccount.fromManualSettingsWithAuth().
MailAccount with manual settings by calling MailAccount.fromManualSettings()
or MailAccount.fromManualSettingsWithAuth(). This is useful when settings cannot or should not be auto-discovered, for example.Fix login for IMAP servers that do not define capabilities in their AUTH/LOGIN response #159
AUTH/LOGIN response #159Always quote user name and password in IMAP login, #158
SmtpExceptions now contain the full error descriptionCheck if a message contains a read receipt request with MimeMessage.isReadReceiptRequested
MimeMessage.isReadReceiptRequestedMessageBuilder.buildReadReceipt()MessageBuilder.addMessagePart() #153BODYSTRUCTURE with MimeMessage.body.allLeafPartsfetchId #141 #143 - Thanks to A.Zulli again!utf-8 rather than utf8 to reduce problems #144 - Thanks to gmalakov{0} response #145Assume 8bit encoding when no content-transfer-encoding is specified in a MIME message.
8bit encoding when no content-transfer-encoding is specified in a MIME message.MessageBuilder.1 correctly.ImapClient.idleStart() throws an error when no mailbox is selected.MailClient.fetchMessageContents() allows you to specify which media types you want to include with the includedInlineTypes parameter, e.g. final mime = await mailClient.fetchMessageContents(envelopeMime, includedInlineTypes: [MediaToptype.image]);.MailboxFlag.sent with MailClient.selectMailboxByFlag(MailboxFlag) method.MailAddress.hasPersonalName getter.Handle raw data in parameter values of IMAP FETCH responses.
FETCH responses.Thanks to KevinBLT mime messages will now always have a valid date header.
Thanks to A.Zulli the UNSELECT IMAP command of rfc3691 is now supported with ImapClient.unselectMailbox().
UNSELECT IMAP command of rfc3691 is now supported with ImapClient.unselectMailbox().ImapClient.threadMessages() and uidThreadMessage() as well as the high level API MailClient.fetchThreads() and fetchThreadData(), the latter can set the MimeMessage.threadSequence automatically. #44message/rfc822 messages using mimePart.decodeContentMessage(). #138SearchQueryType.toOrFrom to easily search for recipients or senders of a message.MailClient API.MailAccount.fromDiscoveredSettingsWithAuth() for easy setup. #137MessageBuilder prepareFromDraft(MimeMessage draft).MailClient.searchMessagesNextPage(MailSearchResult).MessageSequence.isEmpty and isNotEmpty are now getters and not methods anymore. So instead of if (sequence.isEmpty()) please now use if (sequence.isEmpty), etc.mimeMessage.decodeDate().toLocal() now just call mimeMessage.decodeDate().MailSearchResult has been refactored to use PagedMessageSequence.enough_mail is now null safe #127
enough_mail is now null safe #127zulu timezone in date decoding #132MailClient loses a connection or reconnects, it will now fire corresponding MailConnectionLost and MailConnectionReEstablished events.MailClient reconnects, it will fetch new messages automatically and notify about them using MailLoadEvent.v0.3:
MessageBuilder.encoding is renamed to MessageBuilder.transferEncoding and the enum previously called MessageEncoding is now called TransferEncoding. All optional parameters previously called encoding are now also named transferEncoding.MetaDataEntry.entry has been renamed to MetaDataEntry.name.ImapClient.setQuota() and getQuota() methods use named parameters.null parameters do not accept null as input anymore.final to ensure consistency.Fix for handling PARTIAL IMAP responses - thanks to A.Zulli
PARTIAL IMAP responses - thanks to A.ZulliFETCH IMAP responses that are spread across several response lines for a single message - #131KevinBLT contributed the following improvements and features:
QuotedPrintable encoding.ImapClient.sortMessages(...) SORT - and also use the extended sort mechanism with specifying returnOptions on servers with ESORT.ImapClient.searchMessages(...) now accepts List<ReturnOption> parameter for extending the search according to the ESEARCH standard.PARTIAL responses according to the CONTEXT IMAP extension.POP3 so that you can now use the PopClient as intended.BDAT command using SmtpClient.sendChunkedMessage() / sendChunkedMessageData() / sendChunkedMessageText().MimeMessage to send any more when you send messages either via SmtpClient.sendMessageData() or SmtpClient.sendMessageText().MessageBuilder.prepareForwardMessage().insert to true when calling addPart().null-safety challenge.GBK and GB-2312ENVELOPE information when a new mail is detected in high level APIMessageBuilder.replyToMessage is renamed to MessageBuilder.originalMessageAllow to specify connectionTimeout for all low level clients
connectionTimeout for all low level clientsImapClientnoop when resuming MailClient when server does not support IDLESmtpClient.login() is deprecated, please use the better named SmtpClient.authenticate() instead, e.g.: await smtpClient.authenticate(userName, passwor…
StreamSink is bound to a stream exception when accessing ImapClient from several threads.MailClient.appendMessage(...) / .appendMessageToFlag(...) and MailClient.saveDraftMessage(...)MailClient.search(MailSearch) and SearchQueryBuilder- #109MailClient.sentMessage(...) call unless setting the appendToSent parameter to false.SearchQueryBuilder and conduct common searches with MailClient.search(MailSearch)CRAM-MD5 authentication support for SMTP - #108XOAUTH2 authentication support for SMTP - #107MessageSequence.fromMessages(List<MimeMessage>)MailClient.supports8BitEncoding() and set the preferred encoding with MailClient.buildMimeMessageWithRecommendedTextEncoding(MessageBuilder).MessageBuilder now can recommend text encodings with MessageBuilder.setRecommendedTextEncoding(bool supports8Bit) and sets content types automatically depending on attachments.MessageBuilder.attachments field and the AttachmentInfo class.MessageBuilder instance instead of a MimeMessage with MailClient.sendMessageBuilder(...).SmtpClient.login() is deprecated, please use the better named SmtpClient.authenticate() instead, e.g.:
await smtpClient.authenticate(userName, password, AuthMechanism.login)BodyPart.id is renamed to BodyPart.cid to make the meaning clearer.Moving from response based to exceptions, compare the migration guide for details compare the migration guide in Readme.md and #101 for details - spec
ImapClient.search(...) now returns a MessageSequence instead just a list of integersMailClient.moveMessages(...) and MailClient.undoMoveMessages() methodsMailClient.deleteMessages(...) and MailClient.undoDeleteMessages() methodsRemove spaces between two encoded words in headers
Future<MailResponse<DeleteResult>> deleteMessages(
MessageSequence sequence, Mailbox trashMailbox)Future<MailResponse<DeleteResult>> deleteAllMessages(Mailbox mailbox,
{bool expunge})\Trash folder, when possible.markAsSeen parameter to true when fetching messages or message contents
using the high level API, e.g. MailClient.fetchMessageContents(message, markAsSeen: true);Ignoring malformed UT8 when logging thanks to Tienisto.
enough_convert package for previously missing character encodings. MimeMessage.parseFromText(String text) helper method.MediaSubtype.applicationPgpSignature to known media types.Fix handling of VANISHED (EARLIER) responses in edge cases thanks to Andrea.
VANISHED (EARLIER) responses in edge cases thanks to Andrea.MimeMessage.getPartWithContentId(String cid) helper method.MimeMessage.allPartsFlat getter.UTF8 8-bit decoded answers.MailClient.fetchMessageContents(MimeMessage message, {int maxSize}) fetches all parts apart from attachments when the message size is bigger than the one specified in bytes in maxSize.Support IMAP QUOTA Extension thanks to azulli.
MailClient.selectedMailbox.fetchPreference in highlevel API when fetching messages, for example to only fetch ENVELOPEs first.MessageBuilder.prepareMailtoBasedMessage().AUTH LOGIN authentication by specying the authMechanism parameter in SmtpClient.login().MailClient.flagMessage().easier to retrieve and set common message flags such as \Seen, \Answered and $Forwarded
\Seen, \Answered and $ForwardedMimeMessage.isSeen, .isAnswered, .isForwarded to query the corresponding flagsMimeMessage.hasAttachments() or MimeMessage.hasAttachmentsOrInlineNonTextualParts() to determine if the message contains attachment parts.Mime: List all message parts with a specfic Content-Disposition with MimeMessage.findContentInfo(ContenDisposition disposition).
MimeMessage.findContentInfo(ContenDisposition disposition).MimeMessage.getPart(String fetchId)BODY[1.2] now works.MailClient.fetchMessagePart(MimeMessage message, String fetchId).MailClient instance, so that apps can differentiate between accounts.MessageBuilder.prepareReplyToMessage()MailboxFlag.inbox.Thanks to hpoul the XML library now works with both beta and stable flutter channels.
Add discconect() method to high level MailClient API
discconect() method to high level MailClient APIHigh level MailClient API supports IMAP IDLE, POP and SMTP.
MailClient API supports IMAP IDLE, POP and SMTP.Downgraded crypto dependency to be compatible with flutter_test ons stable flutter channel again
Added high level MailClient API
MailClient APIImapClient's eventBus registration when this is specified outside of ImapClient.Add support to discover email settings using the Discover class.
Discover class.Improve parsing of IMAP BODYSTRUCTURE responses to FETCH commands.
BODYSTRUCTURE responses to FETCH commands.Provide POP3 support
Provide POP3 support
Breaking change: use MessageSequence for defining message ID or UID ranges instead of integer-based IDs
FetchImapResult instead of List<MimeMessage>ImapFetchEvent now contains a full MimeMessage instead of just the sequence ID and flagsImapVanishedEvent that is called instead of ImapExpungeEvent when QRESYNC has been enabledMessageSequence for defining message ID or UID ranges instead of integer-based IDsAdded support for ISO 8859-15 / latin9 encoding - based on UTF-8
Breaking change: use MessageSequence for defining message ID or UID ranges instead of integer-based IDs
MessageSequence for defining message ID or UID ranges instead of integer-based IDsFix for fetching recent messages when the chunksize is larger than the existing messages - thanks to studiozocaro!
Breaking API changes: MimeMessage.body API, get and set text/plain and text/html parts in MimeMessage
Supports parsing BODYSTRUCTURE responses when fetching message data
Adding 'name' parameter with quotes to 'Content-Type' header when adding a file
Adding 'name' parameter to 'Content-Type' header when adding a file
This release provides the complete command support of the IMAP 4 Revision 1 standard.
This release provides the complete command support of the IMAP 4 Revision 1 standard.
Download as usual from https://pub.dev/packages/enough_mail
Forward complex messages with MessageBuilder.prepareForwardMessage(), too (issue #24)
MessageBuilder.prepareForwardMessage(), too (issue #24)Forward messages with MessageBuilder.prepareForwardMessage()
MessageBuilder.prepareForwardMessage()Adding simple reply generation with MessageBuilder.prepareReplyToMessage() (issue #25)
MessageBuilder.prepareReplyToMessage() (issue #25)A bug in the SMTP sending command resulted in mails not being sent out.
A bug in the SMTP sending command resulted in mails not being sent out.
Releases are available here: https://pub.dev/packages/enough_mail/versions How to install: https://pub.dev/packages/enough_mail#-installing-tab-
Introducing MessageBuilder for easy mime message creation
Ease access to text contents of a mime message
Parse MIME messages using MimeMessage.parse()
Supporting ASCII character character encodings and padding BASE64 headers if required
Addressed health and syntax recommendations
One column per quarter.