Repository: thunderbird/thunderbird-android (language: kotlin)

Issue:
BCC header isn't fetched when partial message is downloaded
### Checklist

- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.

### App version

6.505

### Where did you get the app from?

None

### Android version

doesn't matter

### Device model

_No response_

### Steps to reproduce

1. Sync a folder containing a message that is larger than the value in "fetch messages up to" and contains a BCC header
2. Open message details of that message

### Expected behavior

BCC recipients are displayed

### Actual behavior

BCC recipients are not displayed (because the BCC header wasn't downloaded)

### Logs

_No response_


Discussion hints:
nan

Pull request: Fetch BCC header when only partially downloading a message
Fixes #6622

Test command: ./gradlew :mail:protocols:imap:test --tests "com.fsck.k9.mail.store.imap.RealImapFolderTest"

Fix patch:
diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt
index a74271c2ef2..472c054a1b9 100644
--- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt
+++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt
@@ -537,7 +537,7 @@ internal class RealImapFolder(
             fetchFields.add("INTERNALDATE")
             fetchFields.add("RFC822.SIZE")
             fetchFields.add(
-                "BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc " +
+                "BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc bcc " +
                     "reply-to message-id references in-reply-to list-unsubscribe sender " +
                     K9MailLib.IDENTITY_HEADER + " " + K9MailLib.CHAT_HEADER + ")]"
             )


Test patch:
diff --git a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt
index b1beda25bdc..ff3e5b6dfd6 100644
--- a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt
+++ b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt
@@ -697,8 +697,8 @@ class RealImapFolderTest {
 
         verify(imapConnection).sendCommand(
             "UID FETCH 1 (UID INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS " +
-                "(date subject from content-type to cc reply-to message-id references in-reply-to list-unsubscribe " +
-                "sender X-K9mail-Identity Chat-Version)])",
+                "(date subject from content-type to cc bcc reply-to message-id references in-reply-to " +
+                "list-unsubscribe sender X-K9mail-Identity Chat-Version)])",
             false
         )
     }