Commit 5642e71a authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Fix bug with multipart messages.

parent c5b63be7
......@@ -90,7 +90,7 @@ public class MailAcquisition implements AcquisitionHandler {
}
}
transmitter.transmit(list, Long.toString(msgs[msgs.length - 1].getReceivedDate().getTime()));
transmitter.transmit(list, null);
closeFolder(toExpunge, expunge);
}
}
......@@ -186,25 +186,28 @@ public class MailAcquisition implements AcquisitionHandler {
}
if (content instanceof Multipart) {
int i = 1;
while (i < ((Multipart) content).getCount()) {
messagePart = ((Multipart) content).getBodyPart(i);
messagePart = ((Multipart) content).getBodyPart(1);
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "--- " + this + " Multipart : part=" + messagePart);
}
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "--- " + this + " Multipart : part=" + messagePart);
}
contentType = messagePart.getContentType();
contentType = messagePart.getContentType();
if (contentType.startsWith("text/plain") || contentType.startsWith("text/html")) {
InputStream is = messagePart.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
if (contentType.startsWith("text/plain") || contentType.startsWith("text/html")) {
InputStream is = messagePart.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String currentLine = reader.readLine();
while (currentLine != null) {
sb.append(currentLine);
sb.append('\n');
currentLine = reader.readLine();
String currentLine = reader.readLine();
while (currentLine != null) {
sb.append(currentLine);
sb.append('\n');
currentLine = reader.readLine();
}
}
i++;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment