repoze-sendmail
Couple sending email message with a transaction
What it is and what it does
repoze.sendmail integrates email sending with the Zope transaction manager, deferring message dispatch until a transaction commits. This prevents users from receiving notifications about incomplete operations—if a transaction rolls back, the associated email is never sent. The package acts as middleware in WSGI applications, intercepting email operations and binding them to transaction lifecycle events.
It's designed for web applications where email notifications must be atomic with database changes. Rather than sending mail immediately and risking orphaned messages if later steps fail, repoze.sendmail queues messages and releases them only when the transaction succeeds. This is particularly useful in long-running request handlers or batch operations where partial failure is possible.
Use it for:
- Send confirmation emails only after a user registration transaction commits successfully
- Queue password-reset notifications that are discarded if the reset transaction rolls back
- Defer order-confirmation emails until inventory and payment transactions complete
- Batch email dispatch tied to database transaction boundaries in WSGI applications
- Prevent duplicate or orphaned notifications in systems with nested or retried transactions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Couples email sending with Zope transactions, ensuring messages are only sent when a transaction commits successfully.
Yes, if you use Zope transactions and need email atomicity. The package is mature, actively maintained, has no known vulnerabilities, and installs with zero dependencies. It solves a real problem in transactional web applications. Not relevant for projects outside the Zope ecosystem or those not requiring transaction-coupled email.
Install
repoze-sendmail on PyPI
pip
pip install repoze-sendmailuv
uv add repoze-sendmailpoetry
poetry add repoze-sendmailInstalling repoze-sendmail
Before you install
Low install friction with no runtime dependencies. Active maintenance with recent commits; supports current Python versions on both CPython and PyPy.
License in practice
Licensed under a permissive Repoze BSD-derived license, allowing use in most commercial and open-source projects without significant restriction.
Quickstart
pip install repoze-sendmail
from repoze.sendmail import get_mailer
mailer = get_mailer()
mailer.send(message) # sent only on transaction commit
Requires Zope transaction manager integration in your application; not a standalone email library.
Verify before relying
- Whether the package works with transaction managers other than Zope's
- Specific retry and queue behavior when transaction commits fail or are rolled back
- Configuration and setup steps beyond basic import and usage
Package facts
| License | LicenseRef-Repoze-BSD-derived (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 102 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 78,505/month — #14,439 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: repoze_sendmail-4.5-py2.py3-none-any.whl
Keywords: web, wsgi, middleware, retry
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
zope.sqlalchemyIntegrates SQLAlchemy sessions with Zope's…
unclear · top 15,000 on PyPI
django-anymailSends and receives email in Django through…
permissive · top 5,000 on PyPI
repoze-lruA lightweight LRU (least recently used) cache…
permissive · top 5,000 on PyPI
repoze.whorepoze.who is an identification and…
permissive · top 15,000 on PyPI
pyramid-tmIntegrates Pyramid web requests with the…
permissive · top 15,000 on PyPI
mailchimp-transactionalA Python client library for the Mailchimp…
unclear · top 15,000 on PyPI
mailmanMailman is a mailing list management system…
copyleft · top 15,000 on PyPI
prefect-emailProvides Prefect workflow integration for…
permissive · top 15,000 on PyPI
icechunkIcechunk is a transactional storage engine for…
unclear · top 15,000 on PyPI
mailtrapOfficial Python client for Mailtrap's email…
permissive · top 15,000 on PyPI