Compare commits

...

3 Commits

Author SHA1 Message Date
dankito 35a2a6c518 Fixed publishing sources 2024-11-22 01:36:15 +01:00
dankito 3273b2a849 Fixed retrieving message bodies 2024-11-22 01:15:18 +01:00
dankito 75450e77fb Fixed returning retrieved messages 2024-11-22 01:14:56 +01:00
3 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,10 @@ kotlin {
jvmToolchain(11)
}
java {
withSourcesJar()
}
val kotlinCoroutinesVersion: String by project

View File

@ -80,7 +80,7 @@ class MailReader(
fun listAllMessagesWithEInvoice(account: MailAccount, downloadMessageBody: Boolean = false, emailFolderName: String = "INBOX"): List<MailWithInvoice> {
try {
connect(account) { store ->
return connect(account) { store ->
val inbox = store.getFolder(emailFolderName)
inbox.open(Folder.READ_ONLY)
@ -243,7 +243,7 @@ class MailReader(
date.toInstant()
private fun <T> connect(account: MailAccount, connected: (Store) -> T?): T? {
private fun <T> connect(account: MailAccount, connected: (Store) -> T): T {
val properties = mapAccountToJavaMailProperties(account)
val session = Session.getInstance(properties)

View File

@ -25,7 +25,7 @@ class MailReaderTest {
@Test
fun listAllMessagesWithEInvoice() {
val result = underTest.listAllMessagesWithEInvoice(mailAccount)
val result = underTest.listAllMessagesWithEInvoice(mailAccount, true)
assertThat(result).isNotEmpty()