Skip to main content

No project description provided

Project description

testmsg

Generate RFC822 compliant e-mail messages for tests and send it over SMTP.

While it's easy to send test messages like echo asdf | mail you@gmail.com or via telnet mx.example.com 25 I need a tool which:

  • Generates valid messages
  • Messages does not looks spammy or very suspicious
  • Easy to use and repeat test
  • Ability to customize messages
  • Work well with msmtp or other full-featured SMTP client (e.g. which can send over secure SMTP connection with authentication)

Installation

pip3 install testmsg

Usage examples

$ testmsg --to you@gmail.com  --lorem 
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Sent with github.com/yaroslaff/testmsg
From: from@example.com
To: you@gmail.com

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo=
r incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut al=
iquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore =
eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia des=
erunt mollit anim id est laborum.

Options

Sending message

To actually send message via SMTP server add --send localhost or (if you need really powerful SMTP client features) pipe to msmtp:

testmsg --lorem --to you@gmail.com --from you@example.net | msmtp --host mail.example.net -v --tls=on --tls-starttls=on --auth=on --user=you@example.com --passwordeval "echo YourPass" -f you@example.net you@gmail.com

Customize message

Use --from, --to and --subject to override basic properties of message, use --add HEADER VALUE to add custom header(s).

Default message text is empty, use --text "blah blah blah" or --lorem or --msg PATH or --msg - .(to read from stdin). Add --time to add current time as an prefix to text.

Add attachments

Use --attachment (or --att) to add attachments: --att FILE1 FILE2 ...

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

testmsg-0.0.7.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

testmsg-0.0.7-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file testmsg-0.0.7.tar.gz.

File metadata

  • Download URL: testmsg-0.0.7.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2

File hashes

Hashes for testmsg-0.0.7.tar.gz
Algorithm Hash digest
SHA256 26a6dadfbc0865047aaf2e835777a5ae168916c5808063eb7cc70f87a19c1454
MD5 dcff98d4af641f4f0c9179944d9c41e7
BLAKE2b-256 d26c400ad844f419e890959e2a1ad089a01b4a2bcf8ef5bd642b49b781874cf9

See more details on using hashes here.

File details

Details for the file testmsg-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: testmsg-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2

File hashes

Hashes for testmsg-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd940fb77e8b46abb9ea72b80f350f16884a5a8c3bff29814617f32b968685c
MD5 8f5dec7154fdd223d60165423d8ed826
BLAKE2b-256 3171497bed339697fde2e345c2c914ebcaa429c7a4dbdda6aebad3f40e516faf

See more details on using hashes here.

Supported by

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