Skip to main content

A Python package to read emails from maildrop.cc

Project description

A Python package to read emails from maildrop.cc

THIS IS STILL WIP

This package provides a very simple class MailDropReader that mimics the graphql API of maildrop.cc. You create a new reader with `MailDropReader() The methods are:

  • status(): provides the current maildrop.cc status. Returns 'operational' or an error string from the server
  • ping(string): pings the maildrop.cc server with the given string. Returns 'pong '
  • inbox(): returns all messages of your inbox Returns a list of messages with only basic fields filled. (currently returns ALL messages, the filters aren't working).
  • message(message_id): returns a full message including its body, its sender IP, ...
  • delete(message_id)__: deletes a message by its id. Returns True if ok
  • statistics(): returns maildrop.cc statistics. Returns a tuple (blocked, saved)
  • altinbox(): returns an alias for your inbox. Subsequent MailDropReaders created with this alias will return messages from the original inbox

Example:

from maildropy import MailDropReader
reader = MailDropReader("my_own-inbox")

msgs = reader.inbox()
for msg in msgs:
  print(f"subject: {msg.subject}, from: {msg.mailfrom}, date:{msg.date}")
  message = reader.message(msg.id)
  print(f"content: {message.html}, ip={message.ip}, headerfrom={message.headerfrom}"

Install

pip install -r requirements.txt

Testing

To test the module, clone the repo, then copy .env.example in .env and provide the email sending settings. These settings are used to send emails to maildrop.cc Then run python test_maildrop.py

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

maildropy-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

maildropy-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file maildropy-1.0.0.tar.gz.

File metadata

  • Download URL: maildropy-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for maildropy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aeed583ef201d5ba4dd10108de820677f73275d448d5f02501b605a4c686727c
MD5 59943c88e3e5436274a5bca7b87fea7f
BLAKE2b-256 fbba7e93b6a106f79eeaf4c15534196dd2f2eb89187e5c9a9ac433359be05bbc

See more details on using hashes here.

File details

Details for the file maildropy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: maildropy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for maildropy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86ec65ab7ba926c3f632d8f428913721a7f5983f7788492a26d05ced2c3ce9f3
MD5 d2df9fd4acb263c79c65552362393a77
BLAKE2b-256 8f27103e8a33f3f521761b374d11bafb0e32e2b666c4a71aab744878d80f3de1

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