Skip to main content

podpack-mail

A podpack app that gives a site its outbound mail. It is flask-mailman's SMTP transport, configured from the site's config file and the deployment's environment, so sending mail is a line in [site] apps rather than wiring in the site's own init.

The distribution is podpack-mail, the import name (for a site's apps list) is podpack_mail, and the app answers to mail. That name keys its config section, [apps.mail], and its command group, flask mail ….

Installing it

uv add podpack-mail
[site]
apps = ["mysite", "podpack_mail"]

[apps.mail]
server = "smtp.example.com"
sender_name = "Example"

Where each setting lives

Setting Where Default
server [apps.mail] none: SMTP will not start without it
port [apps.mail] 465
timeout [apps.mail] 10 seconds
sender_name [apps.mail] none: the bare address
MAIL_USERNAME the deployment's .env none
MAIL_ADDRESS the deployment's .env none
MAIL_PASSWORD the deployment's secrets.env none: the site will not start without it
MAIL_BACKEND the environment, if at all console on a laptop, smtp anywhere else

The file holds what is the same for every deployment of a site. The environment holds what differs between them, and the secret (podpack ADR-0040). Anything already in app.config when the app installs wins over both.

MAIL_ADDRESS becomes MAIL_DEFAULT_SENDER, with sender_name as its display name. flask-security then sends from it without being told: its own sender setting defaults to a proxy that reads MAIL_DEFAULT_SENDER at send time.

The timeout matters more than it looks. flask-mailman's own default is none at all, and a send runs inside a request: without one, a server that stops answering holds a gunicorn worker until gunicorn kills it, and the visitor gets a 502 instead of the site's account of what went wrong.

What it refuses

With the smtp backend, the site stops at boot if any of these is missing, since each would otherwise surface on the first password reset:

  • the server;
  • MAIL_USERNAME;
  • MAIL_ADDRESS.

It also stops if STARTTLS is asked for. Only implicit TLS is allowed, because flask-mailman 1.1.1 verifies the server's certificate on that path and not on STARTTLS.

Checking a credential

podman compose exec web flask --app mysite mail check

This reports the server, the username, the sender and the password's length, but never its value. It then authenticates, and exits non-zero on failure. A backend that sends nothing fails the check rather than passing it.

What a failure says is the site's business

flask-security catches nothing the transport raises, so by default a dead credential turns "reset my password" into a 500. podpack passes PODPACK_MAIL_UTIL_CLS to flask-security before any app installs, so the site names its own failure policy there; this app ships none. holdenweb.com's ReportingMailUtil is a worked example.

On a laptop

PODPACK_ENVIRONMENT unset or local means the console backend: messages are printed, not sent, because a laptop has no address of its own. To send for real, set MAIL_BACKEND=smtp together with the settings above.

Not yet

Receiving mail is planned to join this distribution. The Message-ID a send mints and the fetch that matches replies to it will then live in one codebase. Until then, Message-IDs are flask-mailman's, under the host's name.

Metadata

Release files for podpack-mail 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for podpack-mail 0.1.0
File Size Uploaded Provenance Actions
podpack_mail-0.1.0.tar.gz 7.3 kB Without provenance Details for podpack_mail-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for podpack-mail 0.1.0
File Interpreter ABI Platform Actions
podpack_mail-0.1.0-py3-none-any.whl Python 3 none any Details for podpack_mail-0.1.0-py3-none-any.whl

Total release size: 16.0 kB

Release files / podpack_mail-0.1.0.tar.gz

Download URL podpack_mail-0.1.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c8d6a8734ce9ca7105fd85430e2abacd53d6bd036724ee461cc2b0fd24bcb487
BLAKE2b-256 checksum
How to use checksums
93136aa9d979249b1f3783f308a636e1aaf2e87f43e4c9bf51e2a5400a906c60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / podpack_mail-0.1.0-py3-none-any.whl

Download URL podpack_mail-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a356e06513712ae29c11a1b7728d5d670536f731d844723c6e9979dd44fb99e3
BLAKE2b-256 checksum
How to use checksums
01c715d35f20679cf881311e8eeeab2580dda1344e1185fba1a42923c8a8dc9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for podpack-mail 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page