Class MailConnectionFactory

Namespace: redb.Route.Mail
Assembly: redb.Route.Mail.dll

Named connection factory for mail transports (SMTP, IMAP, POP3). Register it in the route
registry and reference it by name from the endpoint URI (connectionFactory=my-mailbox)
so mailbox credentials never have to appear in the URI, and therefore can never reach logs,
telemetry, or the Tsak dashboard. One factory serves all three protocols.

Example:
context.AddToRegistry("corp-mailbox", new MailConnectionFactory
{
Host = "mail.corp.local",
Port = 993,
Security = MailSecurityMode.SslOnConnect,
Username = "svc-reports",
Password = Environment.GetEnvironmentVariable("MAIL_PASSWORD")!
});

// route carries no credentials at all:
r.From("imap://?connectionFactory=corp-mailbox&folder=INBOX")

public sealed class MailConnectionFactory

Inheritance

Object→MailConnectionFactory

Properties

AccessToken

OAuth2 access token (used instead of the password when set).

public string AccessToken { get; set; }

AuthMechanism

Authentication mechanism.

public MailAuthMechanism AuthMechanism { get; set; }

ClientCertPassword

Password for the client certificate.

public string ClientCertPassword { get; set; }

ClientCertPath

Path to the client certificate for mutual TLS.

public string ClientCertPath { get; set; }

ConnectionTimeout

Connection timeout in milliseconds.

public int ConnectionTimeout { get; set; }

Host

Mail server hostname or IP.

public string Host { get; set; }

Password

Mailbox password.

public string Password { get; set; }

Port

Server port (0 = protocol default for the chosen security mode).

public int Port { get; set; }

Security

Transport security mode (Auto, None, SslOnConnect, StartTls…).

public MailSecurityMode Security { get; set; }

Timeout

Operation timeout in milliseconds.

public int Timeout { get; set; }

TrustAllCertificates

Skip server certificate validation (development only!).

public bool TrustAllCertificates { get; set; }

Username

Mailbox username.

public string Username { get; set; }