core icon indicating copy to clipboard operation
core copied to clipboard

Messages without From field are not trashed

Open link2xt opened this issue 3 years ago • 3 comments

Here UNKNOWN contact should probably be treated as blocked: https://github.com/deltachat/deltachat-core-rust/blob/7bcb03f1eca2114f8a387b03f60abdf31c7e988b/src/dc_receive_imf.rs#L392

link2xt avatar May 08 '22 19:05 link2xt

Shouldn't this maybe even return an Err since from_field_to_contact_id sole purpose is to get a valid contactId which in fact is impossible without a from-field?

Septias avatar Sep 01 '22 13:09 Septias

All the call sites of from_field_to_contact_id just propagate the Err up pretty far using ?, which means that fetching any emails will be cancelled and re-tried if we do that.

Also see https://github.com/deltachat/deltachat-core-rust/blob/8feae69fa49745a04ee48b048c610715f4ebcd97/src/receive_imf.rs#L78-L86

Edit: BTW, thanks for going through the old issues :))

Hocuri avatar Sep 05 '22 07:09 Hocuri

Nice, that comment you linked makes it a lot clearer thank you! We could still return an Err though and map it to an Some(None) in reaceive_imf.rs. It would make clearer that the returned value of from_field_to_contact_id is never used again which wasn't clear for me before. This is totally optional though because the function is not part of any public api and instead only used internally.

Regarding me going through old issues, I looked em through to the last page and still have some issues bookmarked which I will bring up as soon as I finish the other stuff.

Septias avatar Sep 06 '22 06:09 Septias

Fixed by https://github.com/deltachat/deltachat-core-rust/pull/3667

Hocuri avatar Nov 28 '22 17:11 Hocuri