SMTP server (smtp)
Connects to a mail server on its SMTP port, checks that it greets like one, optionally protects the connection with STARTTLS or TLS and signs in, and measures how long that takes. It sends no mail: it ends with QUIT. To check that mail really gets through, use the mail round trip.
What it looks like

The page of an SMTP sensor after a few polls, connecting with STARTTLS and signing in on the mail submission port of a lab server. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
connect_ms | Connect time | ms | warning above 1000, error above 3000 |
response_ms | Response time (connecting, TLS and signing in) | ms | warning above 2000, error above 5000 |
cert_days_remaining | Days until the certificate expires (with TLS) | days | warning below 21, error below 7 |
chain_days_remaining | Days until the earliest expiry in the chain (with TLS) | days | warning below 21, error below 7 |
The certificate is read from the connection the sensor itself made, also when it is untrusted and the sensor runs with verify_tls off or a pin; an expired certificate that is accepted that way makes the sensor Down, as for the HTTP sensors.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
port | 25, or 465 with security tls | TCP port. Mail submission is usually 587 with starttls. |
security | none | none, starttls (the connection is upgraded after the greeting; the sensor fails if the server does not offer it, so a downgrade is noticed) or tls (TLS from the first byte, on the dedicated port). |
authenticate | false | Sign in with the login credential. Refused without starttls or tls unless allow_plaintext_login is set, because the password would cross the network in the clear. |
allow_plaintext_login | false | Allow authenticate on an unprotected connection, for a network you trust. |
verify_tls | true | Verify the server certificate against the system trust store. See pinning a certificate for the alternative to turning it off. |
tls_fingerprint | none | Trust exactly the one certificate with this SHA-256 fingerprint, whatever its chain, dates or name say. Needs starttls or tls. A different certificate is refused with both fingerprints in the message. |
server_name | the device's host name, else its address | The name sent to the server (SNI) and checked against the certificate. Set it when the device is added by address and the certificate carries a name. |
check_certificate | true | With TLS, report how long the certificate lasts. |
expect_banner | none | Require the greeting to contain this text. A greeting without it makes the sensor Down, as for tcp_port. |
helo_name | the probe's address in brackets | What to say in EHLO. Some servers reject names they cannot resolve; the address literal is always accepted. |
Suggested interval: 60 seconds. Credential: an optional login credential, used when authenticate is on. Sign-in uses AUTH PLAIN, or AUTH LOGIN when only that is offered.
On the target
Nothing beyond the service itself. For authenticate, an account that may use AUTH on that port (port 25 usually does not offer it; use submission on 587 or SMTPS on 465).
Failures
| Message | Meaning |
|---|---|
a refused connection (kind unreachable), a timeout (kind timeout) | The service is not listening, or a firewall drops the traffic. |
SMTP greeting: 554 ... or ... not an SMTP reply (kind protocol) | Something answered that is not ready to take mail on that port. |
the server does not offer STARTTLS, so the connection cannot be protected | starttls was asked for and the server does not offer it. Check for a downgrade. |
TLS error: the certificate is not trusted ... and its variants (kind protocol) | The certificate is refused; the message carries the fingerprint of the one presented so it can be pinned. |
the server rejected the login: 535 ... (kind auth_failed) | The user name or password is wrong. The password is never shown. |
this sensor is set to sign in and needs a login credential (kind config) | authenticate is on and no login credential is assigned or inherited. |
Testing
The live tests in crates/probeward-sensors/tests/mail_ftp_live.rs run against a real mail server when these variables are set, and print one line and return when they are not:
| Variable | Meaning |
|---|---|
PROBEWARD_TEST_MAIL_HOST | The server's address. |
PROBEWARD_TEST_MAIL_NAME | The name its certificate carries, sent as the TLS server name. |
PROBEWARD_TEST_MAIL_USER, PROBEWARD_TEST_MAIL_PASSWORD | An account on it. |
PROBEWARD_TEST_MAIL_ADDRESS | That account's mail address. |
PROBEWARD_TEST_MAIL_CA_FILE | The PEM file of the authority that issued the certificate. |
cargo test -p probeward-sensors --test mail_ftp_live -- --nocaptureThe protocol steps themselves (STARTTLS and its downgrade and injection cases, AUTH PLAIN and LOGIN, IMAP literals, POP3 deletion on sign-out) are tested against scripted servers in tests/mail_proto.rs, and the sensors' own judgement against scripted clients in tests/sensors_mail_ftp.rs, without a network.