Open connection before attempting to download message via POP3

This commit is contained in:
cketti 2019-12-12 01:13:13 +01:00
parent 54f3d5f9a2
commit 876cabad70

View file

@ -1,6 +1,7 @@
package com.fsck.k9.backend.pop3
import com.fsck.k9.mail.FetchProfile
import com.fsck.k9.mail.Folder.OPEN_MODE_RW
import com.fsck.k9.mail.Message
import com.fsck.k9.mail.store.pop3.Pop3Store
@ -9,8 +10,9 @@ internal class CommandFetchMessage(private val pop3Store: Pop3Store) {
fun fetchMessage(folderServerId: String, messageServerId: String, fetchProfile: FetchProfile): Message {
val folder = pop3Store.getFolder(folderServerId)
try {
val message = folder.getMessage(messageServerId)
folder.open(OPEN_MODE_RW)
val message = folder.getMessage(messageServerId)
folder.fetch(listOf(message), fetchProfile, null)
return message