skillfed

repoze-sendmail

Couple sending email message with a transaction

repoze-sendmail v4.5 78.5K downloads/30d#14,439 on PyPI11
Permissive license LicenseRef-Repoze-BSD-derived Active released

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-sendmail

uv

uv add repoze-sendmail

poetry

poetry add repoze-sendmail

Installing 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

Development Status :: 6 - MatureIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: WSGITopic :: Internet :: WWW/HTTP :: WSGI :: Middleware

Tags

transactional email sendingzope transaction emaildeferred email deliverywsgi email middlewarecommit-time email dispatch
transactional-emailzope-integration

More WWW/HTTP packages