feat: Don't mark messages as seen on IMAP if bcc_self=0 or bot=1 #7195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bcc_self=0 means that the user disabled it or it's a chatmail setup with the only device and w/o
backups. If a backup is made someday, old messages not marked as IMAP-seen aren't a problem and new
ones are marked as IMAP-seen.
For bots, particularly multi-device ones (which are a rare case), probably no sane logic can be
built on the "seen" message status. Moreover, if the user has additionally a bot that reads incoming
messages, it doesn't mean that the user doesn't want to read them too.
Also don't mark a message as IMAP-seen just if it already exists on the device as this doesn't mean
that it exists on another device.
Also don't mark MDNs and DSNs as IMAP-seen. Marking MDNs as seen is useless, they shouldn't be
displayed by any MUA. Auto-marking DSNs as seen should be avoided because the user may want to see
them in another MUA.