Skip to main content

gptmail

Email automation for gptme agents with shared communication utilities.

Overview

gptmail provides email automation capabilities including:

  • CLI tools for reading, composing, and sending emails
  • Background watcher for processing unreplied emails
  • Shared communication utilities (auth, rate limiting, monitoring, state)
  • Integration with Gmail via IMAP/SMTP

This package was originally developed as part of an agent workspace and upstreamed to gptme-contrib and upstreamed to gptme-contrib for use by all gptme agents.

Installation

Standalone (recommended for agents without uv workspace)

# Using uv tool
uv tool install git+https://github.com/gptme/gptme-contrib#subdirectory=packages/gptmail

# Or using pipx
pipx install git+https://github.com/gptme/gptme-contrib#subdirectory=packages/gptmail

From workspace

# From workspace root
uv pip install -e packages/gptmail

# Or using the Makefile
cd packages/gptmail && make install

Usage

CLI Tools

# Check for unreplied emails
gptmail check-unreplied

# Read specific email with thread
gptmail read <MESSAGE_ID> --thread

# Compose a reply
gptmail reply <MESSAGE_ID> "Your reply message"

# Send composed message
gptmail send <REPLY_MESSAGE_ID>

# See all commands
gptmail --help

Note: If installed in development mode, use python -m gptmail instead.

Background Watcher

# Run watcher in daemon mode
python -m gptmail.watcher

# Process one email and exit
python -m gptmail.watcher --mode one

Configuration

Environment variables:

  • AGENT_EMAIL: Default sender email address
  • EMAIL_ALLOWLIST: Comma-separated list of allowed sender addresses
  • EMAIL_WORKSPACE: Path to email workspace directory

Architecture

The package structure:

  • src/gptmail/ - Main package code
    • cli.py - Command-line interface
    • lib.py - Core email library
    • watcher.py - Background email processor
    • complexity.py - Email complexity analysis
    • communication_utils/ - Shared utilities (auth, rate limiting, etc.)
  • tests/ - Test suite
  • examples/ - Usage examples

Note: scripts/email Removed

The gptme-contrib/scripts/email/ directory has been removed. This package (gptmail) is now the canonical implementation. Key features:

  • Proper Python package structure (src layout)
  • Part of uv workspace
  • Enhanced communication utilities
  • Better test coverage
  • Full maildir import/export support

Usage:

python -m gptmail check-unreplied
# Or if installed: gptmail check-unreplied

Contributing

Contributions welcome! Please ensure:

  • Tests pass: make test
  • Type checking passes: make typecheck
  • Code is formatted: make format

Metadata

Release files for gptmail 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gptmail 0.1.0
File Size Uploaded Provenance
gptmail-0.1.0.tar.gz 48.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gptmail 0.1.0
File Interpreter ABI Platform
gptmail-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 106.0 kB

Release files / gptmail-0.1.0.tar.gz

Download URL gptmail-0.1.0.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99cdbd774995fa94fbd1e7b950eeef9f0f80e060de9c9a4071d25de444e906d3
BLAKE2b-256 checksum
How to use checksums
5c32240a361397317d20e2d74ab1fa5da4adc0d01bffc710aee74df9d9dfcd15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release files / gptmail-0.1.0-py3-none-any.whl

Download URL gptmail-0.1.0-py3-none-any.whl
Size 57.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b75fad7efe74ea3941a52feb851783767c8c74d67518f9c68bf1bd606c579980
BLAKE2b-256 checksum
How to use checksums
ed5aff65ec7443630ff3ce261555d100f951ac322db40d1add9ff29d42827229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Security for gptmail 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page