Skip to main content

zope.sendmail

Latest release Supported Python versions https://github.com/zopefoundation/zope.sendmail/actions/workflows/tests.yml/badge.svg https://coveralls.io/repos/github/zopefoundation/zope.sendmail/badge.svg?branch=master Documentation Status

zope.sendmail is a package for email sending from Zope 3 applications. Email sending from Zope 3 applications works as follows:

A Zope 3 application locates a mail delivery utility (IMailDelivery) and feeds a message to it. It gets back a unique message ID so it can keep track of the message by subscribing to IMailEvent events.

The utility registers with the transaction system to make sure the message is only sent when the transaction commits successfully. (Among other things this avoids duplicate messages on ConflictErrors.)

If the delivery utility is a IQueuedMailDelivery, it puts the message into a queue (a Maildir mailbox in the file system). A separate process or thread (IMailQueueProcessor) watches the queue and delivers messages asynchronously. Since the queue is located in the file system, it survives Zope restarts or crashes and the mail is not lost. The queue processor can implement batching to keep the server load low.

If the delivery utility is a IDirectMailDelivery, it delivers messages synchronously during the transaction commit. This is not a very good idea, as it makes the user wait. Note that transaction commits must not fail, but that is not a problem, because mail delivery problems dispatch an event instead of raising an exception.

However, there is a problem – sending events causes unknown code to be executed during the transaction commit phase. There should be a way to start a new transaction for event processing after this one is commited.

An IMailQueueProcessor or IDirectMailDelivery actually delivers the messages by using a mailer (IMailer) component that encapsulates the delivery process. There currently is only one mailer:

ISMTPMailer sends all messages to a relay host using SMTP.

Documentation is hosted at https://zopesendmail.readthedocs.io/

Changes

7.2 (2026-06-30)

  • Improve logging in QueueProcessorThread to include sender, recipients and queue filename on delivery failures. Permanent SMTP errors and refused recipients are logged via log.error (these are data problems, not code errors), while a traceback is only attached for genuinely unexpected exceptions. (#71).

7.1.1 (2026-06-03)

  • Fix parsing of the X-Zope-To header when it contains display names with commas. (#68).

7.1 (2026-04-24)

  • Improve the help message (#66).

  • Support reading the configuration from the standard input. Fix a deprecated warning about the use of argparse.FileType in Python 3.14. (#64).

  • Move package metadata from setup.py to pyproject.toml.

  • Add support for Python 3.14.

  • Drop support for Python 3.9.

7.0 (2025-09-12)

  • Replace pkg_resources namespace with PEP 420 native namespace.

  • Drop support for Python 3.7, 3.8.

6.2 (2024-03-21)

  • Add implicit_tls option to the Mailer, if setted to True the SMTP connection will use smtplib.SMTP_SSL and starts the connection with SSL from the beginning. (see RFC8314)

6.1 (2024-02-07)

6.0 (2023-08-22)

  • Drop support for Python 2.7, 3.5, 3.6.

  • Add support for Python 3.11.

5.3 (2022-10-06)

  • Add support for Python 3.10.

  • Do not try to send queued emails to an empty address (#45).

5.2 (2021-01-18)

  • Add minimal savepoint support, so we do not fail if any code tries to create a savepoint. (#35).

  • Fix TypeError: ‘error’ object is not subscriptable during error handling on Windows (#33).

  • Add support for Python 3.9.

5.1 (2020-07-31)

  • Use pywin32 again, not any longer the meanwhile outdated fork named pypiwin32. Add some information for installation with buildout. (#30)

  • Support bytes messages; consistently convert messages using a “text” type (i.e. str for Python 3, unicode for Python 2) into bytes via utf-8 encoding. Prerequisite to fix Products.MailHost#30.

5.0 (2019-04-03)

  • Drop support for Python 3.4.

  • Add support for Python 3.8a3.

  • Fix text/bytes issue in MailDir for Python 3. (#24)

4.2.1 (2019-02-07)

  • Fix SMTP authentication on Python 3. See issue 16.

4.2 (2018-10-10)

  • Add support for Python 3.7.

4.1.0 (2017-09-02)

  • Host documentation at https://zopesendmail.readthedocs.io/

  • Make the data manager sort key a string, this fixes Python 3 where strings and integers are not sortable. This would happen when using other data managers with string sort keys.

  • Add support for Python 3.5 and 3.6.

  • Drop support for Python 2.6 and 3.3.

  • Declare explicit dependency on pywin32 on Windows.

  • Replace hard-coded constants with equivalents from the standard errno module.

  • Fix SSL support on Python 3. See issue 9.

  • Reach 100% test coverage and maintain it via tox.ini and CI.

  • Replaced deprecated dependency on optparse with equivalent argparse. The help messages have changed and errors are generally more clear. Specifying a --config path that doesn’t exist is now an error instead of being silently ignored.

  • Fix SMTPMailer sending more than one message. It now reconnects to the SMTP server as needed. Previously it could only send one message since it closed the connection after each send. This also makes the SMTPMailer thread safe. See issue 1.

4.0.1 (2014-12-29)

  • Add support for PyPy3.

4.0.0 (2014-12-20)

  • Add support for testing in CI against supported Python verisons.

  • Drop use of zope.testrunner for testing.

  • Drop dependency on six.

  • Replace doctests with equivalent unittests.

4.0.0a2 (2013-02-26)

  • Fix license Trove classifier.

4.0.0a1 (2013-02-25)

  • Add support for Python 3.3.

  • Delete event fossils (interfaces zope.sendmail.interfaces.IMailSent and zope.sendmail.interfaces.IMailError. plus the zope.sendmail.events module and associated tests). These events were never emitted, and couldn’t have been used safely even if they had been, due to two-phase commit. https://bugs.launchpad.net/zope3/+bug/177739

  • Replace deprecated zope.interface.classProvides usage with equivalent zope.interface.provider decorator.

  • Replace deprecated zope.interface.implements usage with equivalent zope.interface.implementer decorator.

  • Drop support for Python 2.4 and 2.5.

  • Add a vote method to Mailer implementations to allow them to abort a transaction if it is known to be unsafe.

  • Prevent fatal errors in mail delivery causing potential database corruption.

  • Add not declared, but needed test dependency on zope.component [test].

  • Add handling for unicode usernames and passwords, encoding them to UTF-8. Fix for https://bugs.launchpad.net/zope.sendmail/+bug/597143

  • Give the background queue processor thread a name.

  • Document the ini file keys for zope-sendmail --config in the help message printed by zope-sendmail --help. Also rewrote the command-line parsing to use optparse (not argparse, since Python 2.6 is still supported).

3.7.5 (2012-05-23)

3.7.4 (2010-10-01)

3.7.3 (2010-09-25)

  • Add not declared, but needed test dependency on zope.component [test].

3.7.2 (2010-04-30)

  • Remove no longer required testing dependency on zope.testing.

  • Maildir storage for queue can now handle unicode passed in for message or to/from addresses (change backported from repoze.sendmail).

  • Tests use stdlib doctest instead of zope.testing.doctest.

3.7.1 (2010-01-13)

  • Backward compatibility import of zope.sendmail.queue.QueueProcessorThread in zope.sendmail.delivery.

3.7.0 (2010-01-12)

  • Remove dependency on zope.security: the security support is optional, and only available if the zope.security package is available. This change is similar to the optional security support introduced in zope.component 3.8.0, and in fact it uses the same helpers.

  • Sort by modification time the messages in zope.sendmail.maildir so earlier messages are sent before later messages during queue processing.

  • Add the new parameter processorThread to the queuedDelivery ZCML directive: if False, the QueueProcessorThread is not started and thus an independent process must process the queue; it defaults to True for b/c.

  • Provide a console script zope-sendmail which can be used to process the delivery queue in case processorThread is False. The console script can either process the messages in the queue once, or run in “daemon” mode.

3.6.1 (2009-11-16)

  • Depend on zope.component >= 3.8.0, which supports the new semantic of zope.component.zcml.proxify needed by zope.sendmail.zcml.

3.6.0 (2009-09-14)

  • Use simple vocabulary factory function instead of custom UtilityTerm and UtilityVocabulary classes, copied from zope.app.component in the previous release.

  • Depend on the transaction package instead of ZODB3.

  • Remove zcml slugs and zpkg-related files.

  • Work around problem when used with Python >=2.5.1. See https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .

3.5.1 (2009-01-26)

  • Copyover the UtilityTerm and UtilityVocabulary implementation from zope.app.component to avoid a dependency.

  • Work around a problem when smtp quit fails, the mail was considered not delivered where just the quit failed.

3.5.0 (2008-07-05)

  • final release (identical with 3.5.0b2)

3.5.0b2 (2007-12-19)

3.5.0b1 (2007-11-08)

  • Add README.txt

  • Can now talk to servers that don’t implement EHLO

  • Fix bug that caused files with very long names to be created

  • Fix for https://bugs.launchpad.net/zope3/+bug/157104: move aside mail that’s causing 5xx server responses.

3.5.0a2 (2007-10-23)

  • Clean up does_esmtp in faux SMTP connection classes provided by the tests.

  • If the QueueProcessorThread is asked to stop while sending messages, do so after sending the current message; previously if there were many, many messages to send, the thread could stick around for quite a while.

3.5.0a1 (2007-10-23)

  • QueueProcessorThread now accepts an optional parameter interval for defining how often to process the mail queue (default is 3 seconds)

  • Several QueueProcessorThreads (either in the same process, or multiple processes) can now deliver messages from a single maildir without duplicates being sent.

3.4.0 (2007-08-20)

  • Bugfix: Don’t keep open files around for every email message to be sent on transaction commit. People who try to send many emails in a single transaction now will not run out of file descriptors.

3.4.0a1 (2007-04-22)

Initial release as a separate project, corresponds to zope.sendmail from Zope 3.4.0a1.

Release files for zope.sendmail 7.2

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

Source distribution (sdist)

Source distribution for zope.sendmail 7.2
File Size Uploaded
zope_sendmail-7.2.tar.gz 52.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zope.sendmail 7.2
File Interpreter ABI Platform
zope_sendmail-7.2-py3-none-any.whl Python 3 none any Details

Total release size: 99.4 kB

Release files / zope_sendmail-7.2.tar.gz

Download URL zope_sendmail-7.2.tar.gz
Size 52.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a383e0ab20245e3b27a16a6717a56d6d994b6a14dc3c42c91811ceb62e58ebe2
BLAKE2b-256 checksum
How to use checksums
7ccd874d682968081d790c69b9891d7f19df0dd5cce6479bbdfe919104f695c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release files / zope_sendmail-7.2-py3-none-any.whl

Download URL zope_sendmail-7.2-py3-none-any.whl
Size 47.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae067725699df6f0c74314f23f342b21c2167b002db748db3601c56f15ffaf65
BLAKE2b-256 checksum
How to use checksums
00cc86c005d3f8a341b023d26158a4b97eb5a9aa5f120a91b24e651003758d4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

7.2 This release

2 release files

7.1.1

2 release files

7.1

2 release files

7.0

2 release files

6.2

2 release files

6.1

2 release files

6.0

2 release files

5.3

2 release files

5.2

2 release files

5.1

2 release files

5.0

2 release files

4.2.1

2 release files

4.2

2 release files

4.1.0

2 release files

4.0.1

2 release files

4.0.0

1 release file

3.7.5

1 release file

3.7.4

1 release file

3.7.3

1 release file

3.7.2

1 release file

3.7.1

1 release file

3.7.0

1 release file

3.6.1

1 release file

3.6.0

1 release file

3.5.3

1 release file

3.5.2

1 release file

3.5.1

1 release file

3.5.0

2 release files

3.4.0

2 release files

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