Concatenating body parts

This commit is contained in:
dankito 2024-11-21 21:50:59 +01:00
parent 85c392e1b7
commit fbfeb7ced6
1 changed files with 2 additions and 3 deletions

View File

@ -213,9 +213,8 @@ class MailReader(
} else if (partsForMediaTypeWithoutFilename.isEmpty()) {
log.warn { "Multiple message parts with media type '$mediaType' found, but all have a filename" }
null
} else {
log.warn { "Multiple message parts with media type '$mediaType' found, but more than one does not have a filename" }
partsForMediaTypeWithoutFilename.first().part.content as? String
} else { // if there are multiple parts without filename, then the second one is in most cases quoted previous message(s)
partsForMediaTypeWithoutFilename.mapNotNull { it.part.content as? String }.joinToString("\r\n")
}
}
} catch (e: Throwable) {