About
Transactional email delivery via SMTP (MailService for other features)
Provides
Models
MailOutbox
Services
MailService
Routes
/admin/mail/admin/mail/<int:mail_id>/discard/admin/mail/<int:mail_id>/retry
Translations
es
Commands
-
$
splent feature:mail purgeDelete the mails sent or given up on long ago.
-
$
splent feature:mail release [OPTIONS]Send the mails held under a tag.
-
$
splent feature:mail retry [OPTIONS]Send the mails still waiting whose retries were lost.
-
$
splent feature:mail test EMAILSend a test mail to EMAIL now, and say what the server answered.
Run them in your workspace once the feature is installed in the selected product.
Configuration
| Setting | Default | What it does |
|---|---|---|
MAIL_HOST |
localhost
|
The SMTP server. In development splent_feature_mailhog points it at its container. |
MAIL_PORT |
1025
|
587 with MAIL_USE_TLS, 465 with MAIL_USE_SSL, 25 or 1025 with neither. |
MAIL_USE_TLS |
false
|
STARTTLS on a plain connection, the submission port 587. The server's certificate and name are checked. |
MAIL_USE_SSL |
false
|
TLS from the first byte, port 465, the certificate checked as well. Not together with MAIL_USE_TLS: the start refuses both. |
MAIL_TLS_VERIFY |
true
|
Whether either TLS checks the server's certificate and name. false is only accepted in development with MailHog; anywhere else the start refuses it. |
MAIL_USERNAME |
empty | The account the app signs in to the server with. Empty sends without signing in. In production the start refuses a login with neither TLS nor SSL, since the password would cross the network in clear. |
MAIL_PASSWORD |
empty | A credential, so the default is empty. The real value belongs in the product's .env, which is not committed. |
MAIL_FROM |
no-reply@localhost
|
The address a recipient sees and may reply to. A product that sends real mail sets this to one that exists. The admin panel's Sender setting, when filled in, is used instead. |
MAIL_TIMEOUT |
10
|
Seconds each exchange with the server may take: connecting, the TLS handshake, the login, the message. |
MAIL_OUTBOX_KEEP_DAYS |
30
|
Days a mail that was sent, or given up on, stays in the outbox before splent feature:mail purge deletes it. The ones still on their way stay. |
These are the defaults. A product changes them in its own pyproject.toml, under [tool.splent.config], or in .env.deploy in production.
Dependencies
Works better with
In product lines
- cms_spl Optional in this line
-
labcompute
Optional in this line
Needs
auth - marketplace_spl Optional in this line
- openhubs_spl Optional in this line
- openwiki_spl Optional in this line
- sample_splent_spl Optional in this line
Extension points
Templates
mail/admin/outbox.html
Services
MailService
Models
MailOutbox
Routes
A refinement can add routes to its blueprint
Other features fill its hook slots. A refinement can override its templates and services or extend its models without forking it.
Compatibility
Python
>=3.13
SPLENT framework
>=1.30.0