Skip to main content

A python web api wrapper and command line client for mail.tm.

Project description

PyPI PyPI - Python Version CI Status Coverage Status Maintenance

This is a command line interface and python web-api wrapper for mail.tm.

The api is documented here.

Dependencies

xclip or xsel for clipboard copying.

A browser to open incoming html emails.

Installation

With pip

pip install pymailtm

In a virtual env

python -m venv .venv
source .venv/bin/activate
pip install pymailtm

Usage

The utility can be called with:

pymailtm

Remember that if you are in a virtual env you need to activate it first.

By default the command recover the last used account, copy it to the clipboard and wait for a new message to arrive: when it does, it's opened in the browser in a quick&dirty html view.

Exit the waiting loop by pressing Ctrl+c.

Calling the utility with the flag -l will print the account credentials, open in the browser the mail.tm client and exit.

The flag -n can be used to force the creation of a new account.

Security warnings

This is conceived as an insecure, fast throwaway temp mail account generator.

DO NOT use it with sensitive data.

Mails that arrive while the utility is running will be saved in plain text files in the system temporary folder (probably /tmp/) so that they can be opened by the browser.

The last used account's data and credentials will be saved in plain text in ~/.pymailtm.

Development

Install invoke and poetry:

pip install invoke poetry

Now clone the git repo:

git clone git@github.com:CarloDePieri/pymailtm.git
cd pymailtm
inv install

This will try to create a virtualenv based on python3.7 and install there all project's dependencies. If a different python version is preferred, it can be selected by specifying the --python (-p) flag like this:

inv install -p python3.8

The script can now be run directly by launching inv run. It also accepts flags, for example:

inv run -n

The test suite can be run with commands:

inv test         # run the test suite
inv test --full  # run even tests that requires a graphical environment
inv test-spec    # run the tests while showing the output as a spec document
inv test-cov     # run the tests suite and produce a coverage report

Tests take advantage of vcrpy to cache network requests and responses. If you need to clear this cache run:

inv clear-cassettes

To test the github workflow with act:

inv act-dev           # test the dev workflow
inv act-dev -c shell  # open a shell in the act container (the above must fail first!)
inv act-dev -c clean  # stop and delete a failed act container

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

pymailtm-1.0.2.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

pymailtm-1.0.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file pymailtm-1.0.2.tar.gz.

File metadata

  • Download URL: pymailtm-1.0.2.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.6-arch1-1-vfio

File hashes

Hashes for pymailtm-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e381cdb6f8fcf254b589850f2471bedae29bd5ab6e13155dbe78ebbeb4539af1
MD5 4a64cf9a299b9a828bb15d1b548d33e0
BLAKE2b-256 ca59c9b017d1e81efc04fb712734f6a7c886dd9523a297f9f706372062d6deba

See more details on using hashes here.

File details

Details for the file pymailtm-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pymailtm-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.6-arch1-1-vfio

File hashes

Hashes for pymailtm-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e036911f7c15bc83ab76e7ada08aa20935f4bf727b943a322717f9c473845f62
MD5 07ab108dc186cb71b4a1c3b78a3c12e0
BLAKE2b-256 ba2590d6bd759696c0700207f2883aad49b097a7f0def918c18a0963a654a5ea

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