MailProvider
Being rolled out. The interface described here is the one of the next release: it may still change, and may not be enabled on your tenant yet.
apiVersion | mail.stackngo.io/v1alpha1 |
kind | MailProvider |
| Applied by | sng apply or the console (E-mails page) |
What it is for
A MailProvider describes an SMTP account, for example the one of your mail host. The e-mails your tenant sends go out through it. You can declare several (five at most) and attach each MailUser to the provider of your choice.
Encryption is required: port 465 with implicit TLS, or port 587 with STARTTLS. The server must have a public name (no IP address). The password is never in the manifest: it comes from a secret of your tenant.
Minimal example
apiVersion: mail.stackngo.io/v1alpha1
kind: MailProvider
metadata:
name: main
spec:
host: smtp.example.com
port: 587
tls:
mode: starttls
auth:
username: notifications@example.com
passwordSecretRef:
name: smtp-main
sng apply provider.yml
Complete annotated example
apiVersion: mail.stackngo.io/v1alpha1
kind: MailProvider
metadata:
name: main
spec:
host: smtp.example.com # public name of the SMTP server
port: 587 # 465 (tls.mode: implicit) or 587 (tls.mode: starttls)
tls:
mode: starttls
auth:
username: notifications@example.com
passwordSecretRef: # secret of your tenant; the password is never in the manifest
name: smtp-main
key: password # default: password
limits:
perMinute: 30 # messages per minute; 60 by default, 120 at most
domainAuth: # records expected on your senders' domain
spfInclude: spf.example.com
dkimSelectors: [mail]
Fields
MailProvider
MailProvider : un compte SMTP, seule façon d'ajouter un compte d'envoi.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
apiVersion string | mail.stackngo.io/v1alpha1 | ||
kind string | MailProvider | ||
metadata ObjectMeta | Seul metadata.name est à renseigner (nom de la ressource dans votre tenant). | ||
spec MailProviderSpec | |||
status MailProviderStatus |
MailProviderSpec
MailProviderSpec : un compte SMTP.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
host string | Host : nom DNS public du serveur SMTP. | MaxLength: 253 MinLength: 1 Pattern: ^[A-Za-z0-9]([A-Za-z0-9-]\{0,61\}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]\{0,61\}[A-Za-z0-9])?)*$ | |
port integer | Port du serveur SMTP : 465 (TLS implicite) ou 587 (STARTTLS). | Enum: [465 587] | |
tls MailProviderTLS | Mode TLS. Le chiffrement est toujours obligatoire. | ||
auth MailProviderAuth | Identifiants de connexion au serveur SMTP. | ||
limits MailProviderLimits | Débit d'envoi maximal de ce fournisseur. | Optional: {} | |
domainAuth MailProviderDomainAuth | Enregistrements DNS attendus sur le domaine de vos expéditeurs (SPF, DKIM). | Optional: {} |
MailProviderStatus
MailProviderStatus : état observé.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
observedGeneration integer | Dernière version du manifeste prise en compte par la plateforme. | ||
lastProbeAt Time | Date du dernier test de connexion au serveur SMTP. | ||
lastProbeDurationMs integer | LastProbeDurationMs : durée de la dernière sonde. | ||
conditions Condition array | Conditions du fournisseur : SecretResolved, Reachable et Ready. |
MailProviderTLS
MailProviderTLS : mode TLS. Aucune valeur « none » : le TLS est obligatoire.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
mode string | implicit (port 465) ou starttls (port 587). | Enum: [implicit starttls] |
MailProviderAuth
MailProviderAuth : identifiants SMTP. Le mot de passe n'est jamais dans l'objet.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
username string | Identifiant de connexion SMTP. | MaxLength: 254 MinLength: 1 | |
passwordSecretRef PasswordSecretRef | Secret de votre tenant qui contient le mot de passe SMTP. Le mot de passe n'apparaît jamais dans le manifeste. |
MailProviderLimits
MailProviderLimits : débit de l'envoi.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
perMinute integer | PerMinute : messages par minute (plafonné à 120 pour un tenant). | 60 | Minimum: 1 |
MailProviderDomainAuth
MailProviderDomainAuth : enregistrements attendus sur le domaine des expéditeurs.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
spfInclude string | SPFInclude : domaine attendu dans le SPF des expéditeurs (include:<valeur>). | MaxLength: 253 | |
dkimSelectors string array | DKIMSelectors : sélecteurs DKIM à vérifier (<sel>._domainkey.<domaine>). | MaxItems: 8 |
PasswordSecretRef
PasswordSecretRef désigne une clé d'un Secret de votre tenant.
| Champ | Description | Défaut | Validation |
|---|---|---|---|
name string | Name du Secret de votre tenant. | MaxLength: 253 MinLength: 1 | |
key string | Key dans le Secret. | password | MaxLength: 253 MinLength: 1 |
Status and conditions
| Condition | Meaning |
|---|---|
SecretResolved | The secret and its key exist |
Reachable | The server answers: connection, TLS and authentication succeeded (test without sending) |
Ready | Both above are true: the provider can send |
The provider is tested on every change, then regularly. The message of a false condition names the failure category (dns, connect, tls, auth, timeout), never the password or the server's reply. In the console, Test connection runs the test without sending a message.
What happens when you apply
The provider is tested right away. An attached MailUser can only send once the provider is Ready. Beyond five providers, the most recent ones become Ready=False (reason LimitExceeded).
What happens when you delete
The attached senders can no longer send. The console and the API refuse to delete a provider that still has senders.