Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self contact, and some other contacts, erroneously marked as a bot #6357

Closed
Raiden-GH opened this issue Dec 18, 2024 · 7 comments · Fixed by #6376
Closed

self contact, and some other contacts, erroneously marked as a bot #6357

Raiden-GH opened this issue Dec 18, 2024 · 7 comments · Fixed by #6376
Assignees
Labels
bug Something is not working

Comments

@Raiden-GH
Copy link

"Saved Messages" are called a bot.

Screenshot

Beschriftung falsch

macOS 15.2
DC-Desktop 1.50

@WofWca
Copy link
Collaborator

WofWca commented Dec 18, 2024

That's kinda crazy. It's not the case for me

image

Here is the relevant code:

https://github.com/deltachat/deltachat-desktop/blob/89bdf41128530d9ac9213d4d3dfd3a48dd0e2dd2/packages/frontend/src/components/screens/MainScreen.tsx#L283-L287

contacts[0] is supposed to be the self-contact.

Is your account marked as bot somehow??

@r10s
Copy link
Member

r10s commented Dec 18, 2024

we got reports here and there, that chats are marked accidentally as "Bot", not only "Saved Messages". however, no way yet to reproduce it.

wondering if it recovers or if the chats stay as "Bot"

maybe there is some read-receipt, status-update or sync-message that sets "auto-submitted" or so somehow wrong - or the condition for setting is_bot in receive_imf is wrong

@r10s r10s added the bug Something is not working label Dec 18, 2024
@WofWca
Copy link
Collaborator

WofWca commented Dec 18, 2024

Well, we can just reorder the checks for now, so that isSelfTalk takes precedence.

@WofWca
Copy link
Collaborator

WofWca commented Dec 18, 2024

Well, we can just reorder the checks for now, so that isSelfTalk takes precedence.

But this will only solve it for "Saved messages" and not conversations:

we got reports here and there, that chats are marked accidentally as "Bot", not only "Saved Messages"

@iequidoo
Copy link
Collaborator

Seems to be a core issue. Feel free to move it there, moreover if there are cases reported for other platforms

@WofWca WofWca transferred this issue from deltachat/deltachat-desktop Dec 22, 2024
@WofWca WofWca changed the title "Saved Messages" are called a bot self contact, and some other contacts, erroneously marked as a bot Dec 22, 2024
@iequidoo iequidoo self-assigned this Dec 25, 2024
iequidoo added a commit that referenced this issue Dec 28, 2024
Delta Chat always adds protected headers to the inner encrypted or signed message, so if a protected
header is only present in the outer part, it should be ignored because it's probably added by the
server or somebody else. The exception is Subject because there are known cases when it's only
present in the outer message part, e.g. an encrypted unsigned Thunderbird message.

Also handle "Auto-Submitted" and "Autocrypt-Setup-Message" as protected headers on the receiver
side, this was apparently forgotten. This may fix #6357 where Saved Messages
(i.e. `ContactId::SELF`) and some contacts are unexpectedly marked as bots which can happen if
e.g. the server adds "Auto-Submitted: auto-generated" to messages for some reason. Maybe sounds
unlikely, but let's try.
iequidoo added a commit that referenced this issue Dec 28, 2024
Delta Chat always adds protected headers to the inner encrypted or signed message, so if a protected
header is only present in the outer part, it should be ignored because it's probably added by the
server or somebody else. The exception is Subject because there are known cases when it's only
present in the outer message part, e.g. an encrypted unsigned Thunderbird message.

Also handle "Auto-Submitted" and "Autocrypt-Setup-Message" as protected headers on the receiver
side, this was apparently forgotten. This may fix #6357 where Saved Messages
(i.e. `ContactId::SELF`) and some contacts are unexpectedly marked as bots which can happen if
e.g. the server adds "Auto-Submitted: auto-generated" to messages for some reason. Maybe sounds
unlikely, but let's try.
iequidoo added a commit that referenced this issue Dec 29, 2024
Delta Chat always adds protected headers to the inner encrypted or signed message, so if a protected
header is only present in the outer part, it should be ignored because it's probably added by the
server or somebody else. The exception is Subject because there are known cases when it's only
present in the outer message part, e.g. an encrypted unsigned Thunderbird message.

Also handle "Auto-Submitted" and "Autocrypt-Setup-Message" as protected headers on the receiver
side, this was apparently forgotten. This may fix #6357 where Saved Messages
(i.e. `ContactId::SELF`) and some contacts are unexpectedly marked as bots which can happen if
e.g. the server adds "Auto-Submitted: auto-generated" to messages for some reason. Maybe sounds
unlikely, but let's try.
@r10s
Copy link
Member

r10s commented Dec 29, 2024

@adbenitez and me were marked as being a bots to each other after both enabling location streaming in our one-to-one chat.

maybe there is sth. wrong with the auto-generated location messages

@iequidoo
Copy link
Collaborator

Indeed, this is the true reason of the bug. Location-only, sync and webxdc status update messages add Auto-Submitted: auto-generated:

            SystemMessage::LocationOnly
            | SystemMessage::MultiDeviceSync
            | SystemMessage::WebxdcStatusUpdate => {
                // This should prevent automatic replies,                                                                                                                                                            
                // such as non-delivery reports.                                                                                                                                                                     
                //                                                                                                                                                                                                   
                // See <https://tools.ietf.org/html/rfc3834>                                                                                                                                                         
                //                                                                                                                                                                                                   
                // Adding this header without encryption leaks some                                                                                                                                                  
                // information about the message contents, but it can                                                                                                                                                
                // already be easily guessed from message timing and size.                                                                                                                                           
                headers.push(Header::new(
                    "Auto-Submitted".to_string(),
                    "auto-generated".to_string(),
                ));

But only webxdc status updates are excluded from the is_bot logic on the receiver side. I reproduced this. Going to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants