RecursiveAI.OneMail.Client 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package RecursiveAI.OneMail.Client --version 1.0.0
                    
NuGet\Install-Package RecursiveAI.OneMail.Client -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RecursiveAI.OneMail.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RecursiveAI.OneMail.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RecursiveAI.OneMail.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RecursiveAI.OneMail.Client --version 1.0.0
                    
#r "nuget: RecursiveAI.OneMail.Client, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RecursiveAI.OneMail.Client@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RecursiveAI.OneMail.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RecursiveAI.OneMail.Client&version=1.0.0
                    
Install as a Cake Tool

OneMail.Client

The raw protocol layer under the IMAP, SMTP and POP3 clients of OneMail: connections with implicit TLS, STARTTLS and COMPRESS=DEFLATE, command writers, response readers that turn every line into a typed tree, SASL, and a protocol trace with credentials redacted. It is for tools that need to drive a server by hand, including extensions no typed client knows.

Native platforms only (not browser WebAssembly). Checked against Dovecot, Postfix, Stalwart and Cyrus, and against Gmail over SMTP, IMAP and POP3; Outlook.com and arm64 protocol rows have not been run yet (https://github.com/recursive-ai-oss/onemail-csharp/blob/v1.0.0/docs/compatibility.md). The typed ImapClient, Pop3Client and SmtpClient, Mail.SendAsync and the SASL mechanisms (SCRAM, OAuth, NTLM, GSSAPI and more) are on top of it.

using RecursiveAI.OneMail.Client.Imap.Protocol;
using RecursiveAI.OneMail.Client.Protocol;
using RecursiveAI.OneMail.Client.Sasl;
using RecursiveAI.OneMail.Mime.Reading;

await using ImapRawConnection imap = await ImapRawConnection.ConnectAsync("imap.example.com", 993,
    new ProtocolConnectionOptions { ImplicitTls = true });
await imap.ReadGreetingAsync();
await imap.AuthenticateAsync(new SaslPlain("user", "password"));
await imap.ExecuteAsync(ImapCommand.Create("SELECT").Mailbox("INBOX"));

// A message body goes straight from the socket into the MIME reader, without being buffered.
await imap.ExecuteAsync(ImapCommand.Create("FETCH").SequenceSet("1").Raw("(BODY.PEEK[])"), async (context, literal, ct) =>
{
    using var mime = new MimeReader(literal);
    while (await mime.ReadAsync(ct)) { /* headers, bodies, parts */ }
    return true;
});
// Connect (STARTTLS required), authenticate with the strongest mechanism offered, send, QUIT.
SmtpSendResult r = await Mail.SendAsync(
    new OutgoingMessage { From = "me@example.com", To = ["you@example.org"], Subject = "Hi", Text = "Hello" },
    new SmtpClientOptions { Host = "smtp.example.com", Credentials = new SaslCredentials { UserName = "me", Password = "…" } });
foreach (var rejected in r.Rejected) Console.WriteLine($"{rejected.Address}: {rejected.Reply}");
  • Credentials are never sent over an unencrypted connection unless you say so (AllowInsecureAuthentication); the trace shows asterisks in their place.
  • Limits are on by default: line length, response size, literal size, list nesting and reply lines. A parsed response carries typed defects for what it had to repair; only a closed connection or a limit throws.
  • Every operation has an asynchronous form with a CancellationToken and a synchronous twin.
await using var client = await ImapClient.ConnectAsync("imap.example.com", 993,
    new ImapClientOptions { Connection = new ProtocolConnectionOptions { ImplicitTls = true } });
await client.LoginAsync("user", "password");
await client.SelectAsync("INBOX");
await foreach (ImapMessage m in client.FetchAsync(ImapSet.From(1), new ImapFetchQuery { Uid = true, Envelope = true }))
    Console.WriteLine(m.Envelope!.Subject);
await foreach (ImapEvent e in client.IdleAsync(stop: token))   // appends, expunges and flag changes
    Console.WriteLine(e.Kind);

Project home and source: https://github.com/recursive-ai-oss/onemail-csharp. Details: https://github.com/recursive-ai-oss/onemail-csharp/blob/v1.0.0/docs/client-protocol.md. Licence: MIT OR Apache-2.0.

This project is unaffiliated with other products named OneMail.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 97 11/5/2026
1.0.0 91 11/5/2026

See CHANGELOG.md in the repository.