Skip to main content

medre-adapter-chatmail

The Chatmail adapter for MEDRE.

Install

Use uv to install MEDRE and this adapter in the same persistent tool environment:

uv tool install medre
medre adapters install chatmail

Both RPC packages are installed together; no Rust build or separate daemon installation is needed. On Windows, run the printed uv installation command after MEDRE exits. Provision through medre adapter chatmail; a separately exposed helper executable is unnecessary. The standalone medre-chatmail entry point remains available in activated project environments and uses the same arguments and execution path.

For a persistent bridge, prefer one locked uv project: add medre and medre-adapter-chatmail to the project, keep the committed lock for reproducible deployments, and start commands with uv run --locked, which preserves the project lock. For Git development sources, select immutable revisions; existing saved Git requests and catalogs retain their sources. See the adapter installation guide.

Set up a profile

Provisioning proceeds through explicit stages: prerequisites, profile provisioning, conversation acceptance and discovery, then offline configuration and verification. Profile creation and invitation acceptance happen only on these commands; runtime startup never creates an identity or accepts an invitation. Chatmail contributes these provisioning commands instead of an offline setup form; on cores with the typed setup-instructions seam, medre config native renders this journey informationally — the seam contract is described in adapter maintenance. Each stage below states what its observations prove and what they leave unproven.

The commands in this journey use --adapter mail as an example instance. Replace that value consistently with the actual configured adapter ID before running commands. medre config native displays instructions only; it does not substitute IDs, provision accounts, or create a bridge.

Prerequisites

  • The adapter installed in MEDRE's environment (above), with the RPC client and native server it ships together.
  • A relay's private DCACCOUNT: or DCLOGIN: QR payload for init.
  • An invitation QR payload (OPENPGP4FPR: or an i.delta.chat link) for each conversation to bridge.
  • A terminal with echo control for hidden input, or --qr-stdin for automation. Credentials never belong in command arguments or committed files.
  • The bridge stopped and no other client using the profile. The profile is dedicated to one adapter instance; concurrent MEDRE commands refuse the profile lock, and an unrelated Chatmail client does not honor that lock.

Stage 1: provision the profile

uv run --locked medre adapter chatmail init --adapter mail
uv run --locked medre adapter chatmail accounts --adapter mail

init reads the relay's private QR payload with hidden terminal input, creates the profile on this explicit command only, and keeps an existing configured account. accounts lists local account IDs and their configured state without exposing credentials. A configured profile proves that the native core reports this account configured. Profile provisioning is not relay service acceptance: relay-side limits surface only through later delivery feedback, and this stage sends nothing.

Stage 2: accept conversations and discover chat IDs

uv run --locked medre adapter chatmail join --adapter mail
uv run --locked medre adapter chatmail chats --adapter mail --groups --json

join reads one contact or group invitation, completes the native secure join for it, and waits until the native core reports that the chat can send. chats lists ordinary conversations of this profile, groups first; --groups limits discovery to groups, and omitting it includes direct conversations. A joined chat proves that this conversation is accepted and natively sendable. It does not prove that bridge messages reach their recipients.

Configure

Save a private connections.yaml using the accepted chat IDs from chats:

adapters:
  chatmail:
    mail:
      adapter_kind: real
      account_id: 1
      chats: [12]
      origin_label: Chatmail
routes: {}

Replace 1 with the account ID reported by accounts and 12 with an ordinary accepted chat ID from this profile. Then validate without contacting the profile:

uv run --locked medre config check --config connections.yaml
uv run --locked medre routes plan --config connections.yaml

Both commands run entirely offline against the typed configuration model. This fragment describes one connection, not a complete bridge: its route plan has no delivery legs until a second adapter and explicit routes are added. Use medre config bridge to construct those legs, then run both checks again. Neither a valid config nor a nonempty route plan proves peer delivery. medre smoke exercises the SDK-free fake only; real configurations are rejected by fake smoke. An initial deferred result with local_queue confirmation records retention in the private pending-delivery journal only; SMTP handoff is pending. Later correlated remote_service feedback confirms SMTP-server acceptance, with notes differentiated by native state: the outgoing server accepted the message but recipient delivery and reading are unconfirmed, or a native MDN (read receipt) confirms reading. For options, overrides, and troubleshooting, see the Chatmail setup guide.

Verify

Confirm the installed adapter and the saved configuration resolve:

medre adapters check --config connections.yaml

The setup guide's Verify section shows the bridge checks, delivery evidence levels, and recovery behavior.

Configuration reference

Add routes using decimal channel strings, such as source_channel: "12" or dest_channel: "12". Chat IDs are local to a profile; contact addresses are not used to guess conversation identity. Run medre config check before starting the bridge. Explicit accounts_dir, state_dir and rpc_server_path overrides are available for existing profiles and native server installations.

Profiles default to MEDRE's instance state directory, under adapters/mail/chatmail/accounts. MEDRE_HOME and the usual XDG paths are honored. Use the same --adapter and --accounts-dir options for setup and runtime configuration. Once a runtime YAML exists, --config bridge.yaml --adapter mail selects its profile and account directly, including for the chats discovery above.

Use --qr-stdin to supply a QR payload through standard input in automation. Keep the profile, MEDRE database and pending-delivery journal together when backing up state.

Delivery and rendering

  • Preserve plain text and MEDRE attribution. When core uniquely binds an earlier message to a native reference in the same private profile and chat, a reply uses Delta Chat's native quote UI (quotedMessageId). If the target cannot be verified, retain a readable inline reply instead. Threads still use core's inline fallback. Refuse text exceeding the configured UTF-8 budget.
  • Baseline existing history on first use. Resume after the last durable checkpoint on subsequent starts, committing the cursor only after canonical admission.
  • Keep partial text messages pending. Exclude self echoes, blocked contacts, informational controls, edits and unsupported media from fresh-message ingress.
  • Return local queue admission as deferred delivery. Report SMTP acceptance only after the native core confirms outgoing-server acceptance; recipient delivery and reading remain unconfirmed without separate MDN evidence. Neither claims relay acceptance or bridge confidentiality.
  • Retain exact attempt/native-ID correlation until core accepts delivery feedback. Recover correlated native jobs without resending. Abandon unsent or uncertain work recovered across a restart, requiring inspection before an explicit retry.
  • Expose encryption/signature observations in native metadata, alongside the sender's chatmail address, native send/receive timestamps and validated conversation facts; attribution carries the address as the sender handle. A bounded opted-in public_facts projection (currently encrypted_and_signed) feeds core's transport-neutral bridge context. Confidentiality across the bridge and identity puppeting are not implied.

Attachments, native edits/deletes/reactions, forwarded read receipts, typing notifications and puppeting are not advertised. The native core owns SMTP/IMAP, cryptography, protocol retries and account storage. MEDRE owns routing and lifecycle authority.

See the adapter contract and configuration schema.

Development

Use the locked uv development workflow in contributing. It supports core and adapter checkouts at arbitrary locations; select the native SDK tier explicitly after synchronization. Maintainer material — the setup-instructions seam contract — lives in adapter maintenance.

The default tier excludes native SDK and live tests. The SDK tier runs the actual pinned RPC client and server against temporary local profiles without an external mail service. CI runs both tiers on Python 3.11–3.14 and qualifies the adapter against core main, resolved once per run. Keep MEDRE_CORE_REF unset; workflow dispatch accepts an exact candidate core revision. The run summary records both resolved commit IDs. SDK constraints are exported from core's lock without installing private core test helpers into this adapter.

The live test accepts an explicitly prepared relay/profile fixture. Native quote presentation requires that independent-peer campaign before merging or releasing changes to native reply support; API-shape tests alone do not qualify it. See live testing. All service fixtures use ordinary container permissions; no host system configuration is required by this adapter's tests.

Per-message native sender attribution is enabled by default. Delta Chat recipients see the original sender and origin as a message display name while the bridge account and contact profile remain unchanged. Set native_sender_attribution: false to keep only the configured body prefix. See the adapter contract and the two-receipt native qualification.

Metadata

Release files for medre-adapter-chatmail 0.3.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 medre-adapter-chatmail 0.3.0
File Size Uploaded Provenance Actions
medre_adapter_chatmail-0.3.0.tar.gz 96.6 kB With provenance Details for medre_adapter_chatmail-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for medre-adapter-chatmail 0.3.0
File Interpreter ABI Platform Actions
medre_adapter_chatmail-0.3.0-py3-none-any.whl Python 3 none any Details for medre_adapter_chatmail-0.3.0-py3-none-any.whl

Total release size: 140.6 kB

Release files / medre_adapter_chatmail-0.3.0.tar.gz

Download URL medre_adapter_chatmail-0.3.0.tar.gz
Size 96.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f8b9c91504617449acde393334c4be23fd2b3980abced48b93f5045a86ebb0e1
BLAKE2b-256 checksum
How to use checksums
37254ac33787789ce7c8acdd5a6fc5c5b30806a34133018cf429cbfda4c9c016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / medre_adapter_chatmail-0.3.0-py3-none-any.whl

Download URL medre_adapter_chatmail-0.3.0-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f55cd64ec622da085f319bc1444ccaa077fc314de043643e1a6a084480d07708
BLAKE2b-256 checksum
How to use checksums
a868c8d28583ccd3e729c1cef9da68b743a9705795f120bbaf3fac57ba4fbc5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for medre-adapter-chatmail 0.3.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for medre_adapter_chatmail-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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