mailosaur
The Mailosaur Python library lets you integrate email and SMS testing into your continuous integration process.
What it is and what it does
Mailosaur is a Python client for the Mailosaur email and SMS testing service. It provides a programmatic interface to retrieve, search, and inspect messages sent to test inboxes—useful for automating verification of password resets, account confirmations, MFA codes, and other transactional communications in CI/CD pipelines. The library handles both email and SMS, automatically extracting verification codes from message bodies and providing access to HTML, plain text, attachments, and hyperlinks.
The package depends on requests for HTTP communication, python-dateutil for timestamp handling, and tzlocal for timezone support. It integrates with the Mailosaur cloud service, so it requires an active account and API key. The library is designed to work with test email addresses under your Mailosaur server domain and supports searching messages by recipient, subject, and other criteria.
Use it for:
- Automate testing of password-reset email flows in end-to-end test suites.
- Extract and validate one-time passcodes from SMS or email during account verification tests.
- Verify that transactional emails are correctly formatted and contain expected content.
- Test email delivery and content in staging environments without sending to real addresses.
- Validate HTML and plain-text email rendering as part of continuous integration.
- Test multi-factor authentication flows that rely on email or SMS delivery.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Mailosaur is a Python client library for automating email and SMS testing, letting you retrieve and inspect messages sent to test inboxes as part of CI/CD workflows.
Yes. Mailosaur is actively maintained, has no known vulnerabilities, and solves a real problem in testing transactional email and SMS flows. Install it if you need to automate email or SMS verification in your test suite. The permissive MIT license and low dependency footprint make it a low-risk addition. The main condition is that you need a Mailosaur account and API key to use it.
Install
mailosaur on PyPI
pip
pip install mailosauruv
uv add mailosaurpoetry
poetry add mailosaurInstalling mailosaur
Before you install
Low friction installation with three lightweight runtime dependencies (python-dateutil, tzlocal, requests). The package is actively maintained with a recent release and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install mailosaur
from mailosaur import MailosaurClient
from mailosaur.models import SearchCriteria
mailosaur = MailosaurClient()
criteria = SearchCriteria()
criteria.sent_to = "test@abc123.mailosaur.net"
email = mailosaur.messages.get("abc123", criteria)
print(email.subject)
Requires MAILOSAUR_API_KEY environment variable to be set; a Mailosaur account and API key must be obtained from mailosaur.com.
Verify before relying
- Whether the library fully supports modern Python versions beyond those explicitly listed in classifiers (3.7+).
- Performance characteristics when handling large volumes of messages or attachments.
- Whether SMS testing requires additional setup beyond API key configuration.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — python-dateutil, tzlocal, requests |
| Maintenance | actively maintained — 79 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 127,015/month — #11,756 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mailosaur-8.1.1-py2.py3-none-any.whl
Keywords: email, sms, testing, automation, selenium, robot, framework
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mailslurp-clientMailSlurp provides a Python client for an email…
unclear · top 15,000 on PyPI
validate_emailValidates email addresses for proper format and…
copyleft · top 15,000 on PyPI
imap-toolsA high-level Python library for IMAP email…
permissive · top 15,000 on PyPI
mailsuitemailsuite retrieves, parses, and sends emails…
permissive · top 15,000 on PyPI
emailsBuild and send HTML and plain-text emails with…
permissive · top 15,000 on PyPI
redmailRedmail simplifies sending emails with Python…
permissive · top 15,000 on PyPI
django-post_officeDjango Post Office queues and sends emails…
permissive · top 15,000 on PyPI
mailtrapOfficial Python client for Mailtrap's email…
permissive · top 15,000 on PyPI
email-validatorValidates email address syntax and optionally…
permissive · top 1,000 on PyPI
aiosmtpdaiosmtpd is an asyncio-based SMTP server that…
permissive · top 5,000 on PyPI