MailRelayOptions

Smarthost (relay) options for the mail VM postfix submission path. PassFile points at a SOPS-decrypted secret on the mail VM filesystem; NETSetup never reads its content, only emits the path into config.nix.

public sealed record MailRelayOptions : IEquatable<MailRelayOptions>

1. Properties

1.1. Host

Smarthost FQDN (e.g. smtp.mailprovider.com).

public string Host { get; init; }

1.2. PassFile

Path on the mail VM to a single-line SASL password file (SOPS-decrypted at runtime). String (not AbsolutePath) because Nuke’s AbsolutePath serializes as a nested object graph (Name/Parent/…​) that NETSetup’s Json deserializer cannot reconstruct.

public string PassFile { get; init; }

1.3. PasswordPlain

Optional plaintext SASL password. When non-empty, the nix mail module emits a systemd-tmpfiles rule that writes PassFile with this content at boot (mode 0600, root:root). Lab-grade: password ends up in the nix store, same posture as the per-user passwd-file. Leave empty for SOPS-managed secrets.

public string PasswordPlain { get; init; }

1.4. Port

Submission port. Default 587 (STARTTLS submission).

public int Port { get; init; }

1.5. UseClientCert

When true, authenticate to the smarthost with the mail VM’s TLS *client certificate* instead of SASL (no User/PassFile used). This is the Microsoft 365 "inbound connector, certificate" relay method: M365 verifies the cert subject matches the domain. Requires a publicly-trusted cert on the mail VM (real Let’s Encrypt, NOT lab self-signed) - postfix presents tlsCertPath/tlsKeyPath. Host is then the connector endpoint (e.g. <tenant>.mail.protection.outlook.com), port 25.

public bool UseClientCert { get; init; }

1.6. User

SASL username for the smarthost.

public string User { get; init; }

2. Operators

2.1. operator !=(MailRelayOptions, MailRelayOptions)

public static bool operator !=(MailRelayOptions left, MailRelayOptions right)
Table 1. Parameters
Name Type Description

left

MailRelayOptions

right

MailRelayOptions

Returns: bool

2.2. operator ==(MailRelayOptions, MailRelayOptions)

public static bool operator ==(MailRelayOptions left, MailRelayOptions right)
Table 2. Parameters
Name Type Description

left

MailRelayOptions

right

MailRelayOptions

Returns: bool