Skip to main content

Sends a test email via SMTP, and checks that it was received via IMAP

Project description

This packages sends a test email via SMTP, and checks that it was received via IMAP. Requires Python 3.x, since the stdlib in 2.x is missing too many features in this area.

Usage

Create a configuration file:

[default]
recipient = test@example.com
smtp_host = smtp.example.com:25
imap_host = imap.example.com:143
imap_username = test@example.com
imap_password = secret

Now run mail-check-roundtrip example.conf. It will send a message with a random string in the X-Mailcheck-Token header, and then poll until receive_timeout to see if a message with that string was rececived (this message is then deleted). The exit status is 0 if sucessful, 1 on errors (e.g. connection failed) and 2 if the message could not be found.

Options

The following configuration options are supported and these are their defaults:

[default]
recipient = # REQUIRED
from = # defaults to recipient
headers = # default empty
    Subject: This is a test
    X-Custom-Header: one

smtp_host = localhost:25
smtp_ssl = starttls  # or `ssl` or `none` (not recommended)
smtp_username =
smtp_password =

imap_host = localhost:143
imap_ssl = starttls  # or `ssl` or `none` (not recommended).
imap_username = # REQUIRED
imap_password = # REQUIRED
imap_folder = INBOX

poll_timeout = 60
poll_interval = 10
poll_delete = true  # Delete the message after it was found
loglevel = WARNING  # This means no output for a successful run.

CHANGES

1.0.1 (2018-04-07)

  • Fix typo because smtplib.starttls has context and imaplib.starttls has ssl_context as the kw name, sigh.

1.0.0 (2018-04-07)

  • First release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ws.mailcheck-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file ws.mailcheck-1.0.1.tar.gz.

File metadata

  • Download URL: ws.mailcheck-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ws.mailcheck-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e5a6f7d9960f31c6fbc3d20a0b62ebcf20ec2f11607a9ce4c4a8beeccc0581d8
MD5 e084202a8692c003912281d3ff2853f4
BLAKE2b-256 8cd397484319659829c54c4b0327c1e7d6dbf774a82fa5c5867f8eecf0df9480

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page