HitchSMTP
Mock SMTP server that logs all incoming messages to stdout as JSON for easy parsing by HitchServe.
HitchSMTP contains a service definition for use with Hitch, but can also be used alone.
Use with Hitch
Install like so:
$ hitch install hitchsmtp
# Service definition in your test execution engine's setUp
self.services['HitchSMTP'] = hitchsmtp.HitchSMTPService(
port=10025 # Optional (default: 10025)
)
# Wait for email during test...
containing = "Registration email"
email = self.services['HitchSMTP'].logs.out.tail.until_json(
lambda email: containing in email['payload'] or containing in email['Subject'],
timeout=5,
lines_back=1,
)
See this service in action at the DjangoRemindMe project.
Bad SMTP Server
You can send to specific email addresses to mock most SMTP errors.
E.g. Sending an email to 451-please-try-again-later@smtperrors.com will cause the “451 Please try again later” SMTP error.
For a full list of these errors and the email address @ smtperrors.com that will trigger them, see:
https://github.com/hitchtest/hitchsmtp/blob/master/hitchsmtp/smtperrors.py
Features
Logs all details about emails received by the SMTP server as easily parsed JSON.
Parses links in your emails automatically so that you can check just for links in emails and ‘click’ on them.
Can also mock SMTP errors.
Metadata
Release files for hitchsmtp 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hitchsmtp-0.2.1.tar.gz | 5.5 kB | Without provenance | Details for hitchsmtp-0.2.1.tar.gz |
Release files / hitchsmtp-0.2.1.tar.gz
| Download URL | hitchsmtp-0.2.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26bfaafc642336a21d491209703f4d0ebdef432121d223400e6cd80acb09db69
|
|
BLAKE2b-256 checksum How to use checksums |
88cb0bccddb5167a0f89daaf515c34734131b3fb0d0a3e30e7721f3b30b3efdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for hitchsmtp 0.2.1
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.