Skip to main content

wafflesbot: Email auto reply bot for JMAP mailboxes

PyPI PyPI - Python Version Build codecov GitHub stars

wafflesbot

wafflesbot sends form replies to unreplied emails in a JMAP mailbox (such as Fastmail).

wafflesbot excels at automatically asking tech recruiters for compensation information.

Built on:

Installation and usage with Docker

A Docker container is provided which runs wafflesbot to reply to emails via JMAP server events. JMAP API authentication and reply details should be configured using environment variables.

Example docker-compose.yaml:

version: "3.7"

secrets:
  jmap_api_token:
    file: path/to/file/with/your/jmap_api_token

services:
  waffles:
    image: ghcr.io/smkent/waffles:latest
    environment:
      JMAP_HOST: jmap.example.com
      JMAP_API_TOKEN: /run/secrets/jmap_api_token
      WAFFLES_MAILBOX: folder-or-label-name
      WAFFLES_REPLY_FILE: /autoreply.html
      # WAFFLES_DRY_RUN: "true" # Uncomment to log actions but not send email
      # WAFFLES_DEBUG: "true"   # Uncomment to increase log verbosity
      # Set TZ to your time zone. Often same as the contents of /etc/timezone.
      TZ: PST8PDT
    restart: unless-stopped
    volumes:
      - path/to/your/reply/content.html:/autoreply.html:ro
    secrets:
      - jmap_api_token

Start the container by running:

docker-compose up -d

Debugging information can be viewed in the container log:

docker-compose logs -f

Installation from PyPI

wafflesbot is available on PyPI:

pip install wafflesbot

Usage

wafflesbot provides the waffles command, which can either:

  1. Run as a service and reply to emails received via JMAP server events (the default)
  2. Run as a script to examine recent emails (such as interactively or via a cronjob)

Environment variables:

  • JMAP_HOST: JMAP server hostname
  • JMAP_API_TOKEN: JMAP account API token

Required arguments:

  • -m/--mailbox: Name of the folder to process
  • -r/--reply-content: Path to file with an HTML reply message

Optional arguments:

  • -d/--debug: Enable debug logging
  • -l/--limit: Maximum number of emails replies to send (only valid with -s/--script)
  • -n/--days: Only process email received this many days ago or newer (only valid with -s/--script)
  • -p/--pretend: Print messages to standard output instead of sending email
  • -s/--script: Set to run as a script instead of an event-driven service

Invocation examples

Listen for new emails, and reply to unreplied messages that appear in the "Recruiters" folder with the message in my-reply.html:

JMAP_HOST=jmap.example.com \
JMAP_API_TOKEN=ness__pk_fire \
waffles \
    --mailbox "Recruiters" \
    --reply-content my-reply.html

Run as a script and reply to unreplied messages in the "Recruiters" folder with the message in my-reply.html:

JMAP_HOST=jmap.example.com \
JMAP_API_TOKEN=ness__pk_fire \
waffles \
    --script \
    --mailbox "Recruiters" \
    --reply-content my-reply.html

Development

Poetry installation

Via pipx:

pip install pipx
pipx install poetry
pipx inject poetry poetry-pre-commit-plugin

Via pip:

pip install poetry
poetry self add poetry-pre-commit-plugin

Development tasks

  • Setup: poetry install
  • Run static checks: poetry run poe lint or poetry run pre-commit run --all-files
  • Run static checks and tests: poetry run poe test

Created from smkent/cookie-python using cookiecutter

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wafflesbot-0.1.21.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

wafflesbot-0.1.21-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file wafflesbot-0.1.21.tar.gz.

File metadata

  • Download URL: wafflesbot-0.1.21.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for wafflesbot-0.1.21.tar.gz
Algorithm Hash digest
SHA256 f59097c9a2114f46393aab7006e4769c06e09484907b2999684404d2a5f3f12a
MD5 9d0e4c33a43e7d9446e69b669d4d0f63
BLAKE2b-256 e5678de50ca5857db8d11865b28ed3190130d71dd23b4f3892dc346ccb842239

See more details on using hashes here.

Provenance

The following attestation bundles were made for wafflesbot-0.1.21.tar.gz:

Publisher: cd.yml on smkent/waffles

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

File details

Details for the file wafflesbot-0.1.21-py3-none-any.whl.

File metadata

  • Download URL: wafflesbot-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for wafflesbot-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 a008595ceb7e52d626cf5971f0f2a425395b9ba5895f35d5e70d443872418933
MD5 6f08eb299252aaf81fd426c9fc06ab62
BLAKE2b-256 61f8555ce6e1d56438389dece2a6603f75570be59fe26c698f335c25677de9ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for wafflesbot-0.1.21-py3-none-any.whl:

Publisher: cd.yml on smkent/waffles

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

Release history Release notifications | RSS feed

This release

0.1.21 This release

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page