Files
chatmail-core/deltachat-rpc-client
link2xt bb816ff398 fix: do not sort prefetched messages by INTERNALDATE
Messages are iterated over in fetch_new_msg_batch()
and largest_uid_fetched variable is updated there
assuming that messages come in the order of increasing UID.
If UIDs are not increasing, it is possible
that largest_uid_fetched will be updated
even though smaller UID is not fetched yet
and the message will be lost.

INTERNALDATE sorting was introduced to
deal with email providers such as Gmail
that keep INTERNALDATE but not the UID
order when moving the messages.
Since we don't move the messages anymore
after commit 04c0e7da16,
there is no need for ordering by INTERNALDATE.
2026-04-19 09:00:40 +00:00
..

Delta Chat RPC python client

RPC client connects to standalone Delta Chat RPC server deltachat-rpc-server and provides asynchronous interface to it. rpc.start() performs a health-check RPC call to verify the server started successfully and will raise an error if startup fails (e.g. if the accounts directory could not be used).

Getting started

To use Delta Chat RPC client, first build a deltachat-rpc-server with cargo build -p deltachat-rpc-server or download a prebuilt release. Install it anywhere in your PATH.

Create a virtual environment if you don't have one already and activate it.

$ python -m venv env
$ . env/bin/activate

Install deltachat-rpc-client from source:

$ cd deltachat-rpc-client
$ pip install .

Testing

  1. Build deltachat-rpc-server with cargo build -p deltachat-rpc-server.
  2. Install tox pip install -U tox
  3. Run CHATMAIL_DOMAIN=nine.testrun.org PATH="../target/debug:$PATH" tox.

Additional arguments to tox are passed to pytest, e.g. tox -- -s does not capture test output.

Activating current checkout of deltachat-rpc-client and -server for development

Go to root repository directory and run:

$ scripts/make-rpc-testenv.sh 
$ source venv/bin/activate 

Using in REPL

Setup a development environment:

$ tox --devenv env
$ . env/bin/activate
$ python
>>> from deltachat_rpc_client import *
>>> rpc = Rpc()
>>> rpc.start()
>>> dc = DeltaChat(rpc)
>>> system_info = dc.get_system_info()
>>> system_info["level"]
'awesome'
>>> rpc.close()