Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

emailsender

E-mail sending yuno. It speaks native SMTPS (implicit TLS, RFC 8314) and queues outgoing messages with TimeRanger2 persistence so they survive transient SMTP outages and yuno restarts. Builds fully static since 7.4.3.

Architecture

C_EMAILSENDER          <- queueing, retry, dead-letter, MIME encoding
    > C_SMTP_SESSION   <- SMTP client FSM (banner/EHLO/AUTH/MAIL/RCPT/DATA)
        > C_TCP        <- smtps://host:465 (implicit TLS from byte zero)

Configuration

Effective config is the usual merge of main.c fixed/variable config with the external JSON; inspect it at runtime with ycommand command-yuno id=<id> service=__yuno__ command=view-config.

AttributeDefaultPurpose
url(required)SMTP server, e.g. smtps://ssl0.ovh.net:465
from(required)Default envelope/From address
from_beautiful""Optional display name for the From header
username / password""AUTH PLAIN credentials (empty → skip AUTH)

url, from, username and password are persistent attributes: set them at runtime with the set-email-user / set-url-from commands (below) and they are saved to the yuno’s persistent-attrs store and reloaded on restart. This is the canonical way to provision the SMTP credentials — they never have to appear in any committed config or batch file. | timeout_dequeue | 10 | ms between queue polls | | max_retries | 4 | Max total send attempts before dead-lettering | | disable_alarm_emails | false | Drop “ALERT Queuing” alarm emails | | tranger_path / tranger_database | | TimeRanger2 store location | | topic_emails_queue | emails_queue | Pending-queue topic | | topic_emails_failed | emails_failed | Dead-letter topic | | backup_queue_size | 1000000 | Backup the queue topic at this size |

C_SMTP_SESSION adds timeout_response (default 30000 ms) — the per-command watchdog while waiting for a server reply.

Commands

CommandParametersDescription
send-emailto, subject, body, reply-to, attachment, inline_file_id, is_htmlEnqueue an email. to/cc/bcc accept comma- or semicolon-separated lists; recipients are deduplicated.
list-queuesDump the messages in emails_queue and emails_failed with totals. Works while paused (queues are opened temporarily).
remove-emails-failedPurge the emails_failed dead-letter queue. Works while paused.
set-email-userusername, password, url, fromSet the AUTH PLAIN credentials (required) and optionally the SMTP url / default From; all saved as persistent attrs.
set-url-fromurl, fromSet the SMTP url and/or the default From and save them as persistent attrs (at least one required).
enable-alarm-emailsRe-enable alarm emails
disable-alarm-emailsSuppress “ALERT Queuing” alarm emails
helpcmd, levelCommand help

set-email-user and set-url-from are tagged SDF_AUTHZ_X — they require the __execute_command__ permission when the per-command authz gate is enabled.

Other yunos send mail by publishing EV_SEND_EMAIL to the emailsender service (e.g. logcenter’s summary report).

Delivery semantics

send-email enqueues to the persistent emails_queue; a message is dispatched only while the SMTP session is connected and authenticated. Success removes it; a transient NACK retries up to max_retries while it stays at the head; a link outage keeps it queued; exhausted or permanently-undeliverable messages move to emails_failed, which is not retried.

A queued message stays at the head until it is sent or its attempts are exhausted; a transient failure retries, a link outage just waits, and only exhaustion or a permanent error moves it to the emails_failed dead-letter.

Outgoing messages are held in the persistent emails_queue and are never dropped while waiting:

Every outcome is logged: a warning per retry, an error when a message is moved to the dead-letter queue, and an info line on success.

Debugging

Trace levels (enable with ycommand command-yuno id=<id> service=__yuno__ command=set-gclass-trace gclass=<G> set=1 level=<L>):

GClassLevelShows
C_EMAILSENDERmessagesThe MIME message dispatched to the SMTP child
C_SMTP_SESSIONsmtpSMTP FSM phases — commands sent (>>>) and reply codes (<<<)
C_SMTP_SESSIONtrafficRaw bytes in/out (hex dump)