Skip to main content

Integrate firstmail.ltd emails into your Python applications with ease.

Project description

firstmail

Integrate firstmail.ltd emails into your Python applications with ease.

Pip module installs total downloadsRun Tests Upload Python Package to PyPI when a Release is Created

Server Info

  • IMAP/POP3 host: imap.firstmail.ltd
  • IMAP SSL: 993, POP3 SSL: 995
  • IMAP non-SSL: 143, POP3 non-SSL: 110
  • IP: 5.252.35.241

Installation

with pip

pip install firstmail

with uv

uv install firstmail

build from source

git clone https://github.com/nichind/firstmail.git
cd firstmail
pip install -e .

Python Usage

Using the context manager (recommended)

from firstmail import firstmail_client

with firstmail_client("your_email@firstmail.ltd", "your_password") as client:
    # Get the most recent email
    last_email = client.get_last_mail()
    if last_email:
        print(last_email.subject, last_email.sender)

    # Get multiple emails (newest first)
    emails = client.get_all_mail(limit=10)
    print(f"Fetched {len(emails)} emails")

Manual resource management

from firstmail import FirstMail

client = FirstMail("your_email@firstmail.ltd", "your_password")
try:
    print(client.get_message_count())
finally:
    client.close()

Watch for new emails

from firstmail import firstmail_client

with firstmail_client("your_email@firstmail.ltd", "your_password") as client:
    for new_email in client.watch_for_new_emails(check_interval=60):
        print("New email:", new_email.subject)
        # break  # optionally exit after the first

CLI

[!NOTE] If the firstmail command isn't working in your terminal, use python -m firstmail <command>, uv run -m firstmail <command>, etc. instead.

Basic commands

# Read the most recent email
firstmail -e <email> -p <password> read-last

# Read all emails (limit to N)
firstmail -e <email:password> read-all --limit 10 --full

# Watch for new emails
firstmail watch --interval 60 --show-body

# Count messages in inbox
firstmail count

You can also pass credentials explicitly:

firstmail -e your_email@firstmail.ltd -p your_password read-last

Disclaimer

I'm not responsible for possible misuse of this software. Please use it in accordance with the law and respect the terms of service of the services you access.

Consider leaving a star ⭐

Star History Chart

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

firstmail-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

firstmail-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file firstmail-0.1.1.tar.gz.

File metadata

  • Download URL: firstmail-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for firstmail-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a1833c7864decc4760b75cd459b844c108249e3ccc3af982a4456f22c4702d66
MD5 938be54d8db3b1c4624aa1ac8ddba06e
BLAKE2b-256 b5e200caef32b16d9141b1a060f6ec897fa00e1460bbf1669a67e7cdebffe912

See more details on using hashes here.

Provenance

The following attestation bundles were made for firstmail-0.1.1.tar.gz:

Publisher: publish.yml on nichind/firstmail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firstmail-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: firstmail-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for firstmail-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1daf158b5a3501b8bed14c605189ca5fe960a79352a09e6e141acf5d9e72cbc0
MD5 744671a2257d044046471baadfd8cc3f
BLAKE2b-256 d202e702f134ef6513feb351a1e34e879038e4abd3f504b8741618fd85a1c525

See more details on using hashes here.

Provenance

The following attestation bundles were made for firstmail-0.1.1-py3-none-any.whl:

Publisher: publish.yml on nichind/firstmail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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