Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions deltachat-rpc-client/tests/test_multitransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@ def test_change_address(acf) -> None:
assert sender_addr2 == new_alice_addr


def test_remove_transport_keep_messages(acf) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need to agree sometime on this -> None type annotations. I am not doing them, you are doing them. I don't see the point for test functions to annotate them this way.

@link2xt link2xt Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw we don't actually check the types in JSON-RPC client in CI (but check for python/), i just ran mypy and it reports some bugs in the type annotations (but not bugs found thanks to the type annotations): #8695

"""Test that deleting current sending transport keeps queued messages."""
alice, bob = acf.get_online_accounts(2)

qr = acf.get_account_qr()
alice.add_transport_from_qr(qr)

alice.stop_io()
alice_chat_bob = alice.create_chat(bob)
alice_chat_bob.send_text("Hello!")

new_alice_addr = alice.list_transports()[1]["addr"]
alice.delete_transport(alice.list_transports()[0]["addr"])
alice.start_io()

bob_msg = bob.wait_for_incoming_msg().get_snapshot()
assert bob_msg.sender.get_snapshot().address == new_alice_addr


def test_download_on_demand(acf, rpcdata) -> None:
alice, bob = acf.get_online_accounts(2)
alice.set_config("download_limit", "1")
Expand Down
63 changes: 55 additions & 8 deletions docs/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,51 @@ CREATE TABLE bobstate (
chat_id INTEGER NOT NULL
);

CREATE TABLE smtp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
rfc724_mid TEXT NOT NULL, -- Message-ID
mime TEXT NOT NULL, -- SMTP payload
msg_id INTEGER NOT NULL, -- ID of the message in `msgs` table
recipients TEXT NOT NULL, -- List of recipients separated by space
retries INTEGER NOT NULL DEFAULT 0 -- Number of failed attempts to send the message
);
CREATE TABLE smtp2 (
id INTEGER PRIMARY KEY AUTOINCREMENT,
display_name TEXT NOT NULL, -- Display name to put into the From field.
rfc724_mid TEXT NOT NULL, -- Message-ID

-- Unencrypted payload with some headers.
mime BLOB NOT NULL,

-- True if Autocrypt header should be added before sending.
should_attach_pubkey INTEGER NOT NULL,

-- True if OpenPGP-encrypted message may use compression.
should_compress INTEGER NOT NULL,

-- True if encrypted message should be signed.
should_sign INTEGER NOT NULL,

-- ID of the message in `msgs` table
msg_id INTEGER NOT NULL,

-- Space-separated recipient addresses.
recipients TEXT NOT NULL,

-- Space-separated addresses the message was sent to.
sent_to TEXT NOT NULL DEFAULT '',

-- If true, copy should be sent to self in addition to the recipient list.
--
-- For encrypted messages copy is sent to all addresses.
-- For unencrypted messages, copy is sent to the From address only.
bcc_self INTEGER NOT NULL,

-- True if the message is encrypted.
-- If true, at most one of the shared_secret or encryption_fingerprints should be non-empty.
-- If false, both must be empty.
is_encrypted INTEGER NOT NULL,
Comment thread
link2xt marked this conversation as resolved.

-- Shared secret if the message is to be encrypted symmetrically.
shared_secret TEXT NOT NULL DEFAULT '',

-- Space-separated fingerprints of the keys the message should be encrypted to.
encryption_fingerprints TEXT NOT NULL DEFAULT '',

retries INTEGER NOT NULL DEFAULT 0 -- Number of failed attempts to send the message
) STRICT;

CREATE TABLE smtp_mdns (
msg_id INTEGER NOT NULL, -- id of the message in msgs table which requested MDN (DEPRECATED 2024-06-21)
Expand Down Expand Up @@ -781,3 +818,13 @@ CREATE TABLE sending_domains(
domain TEXT PRIMARY KEY,
dkim_works INTEGER DEFAULT 0
);

-- Replaced with smtp2.
CREATE TABLE smtp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
rfc724_mid TEXT NOT NULL, -- Message-ID
mime TEXT NOT NULL, -- SMTP payload
msg_id INTEGER NOT NULL, -- ID of the message in `msgs` table
recipients TEXT NOT NULL, -- List of recipients separated by space
retries INTEGER NOT NULL DEFAULT 0 -- Number of failed attempts to send the message
);
Comment thread
hpk42 marked this conversation as resolved.
Loading