|
|
|
@ -54,6 +54,7 @@ import javax.mail.internet.InternetAddress;
|
|
|
|
|
import javax.mail.internet.MimeBodyPart;
|
|
|
|
|
import javax.mail.internet.MimeMessage;
|
|
|
|
|
import javax.mail.internet.MimeMultipart;
|
|
|
|
|
import javax.mail.internet.MimeUtility;
|
|
|
|
|
import javax.mail.internet.ParseException;
|
|
|
|
|
|
|
|
|
|
public class MessageHelper {
|
|
|
|
@ -435,6 +436,19 @@ public class MessageHelper {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getSubject() throws MessagingException, UnsupportedEncodingException {
|
|
|
|
|
String subject = imessage.getSubject();
|
|
|
|
|
if (subject != null && subject.indexOf("=?") >= 0) {
|
|
|
|
|
String prev;
|
|
|
|
|
do {
|
|
|
|
|
prev = subject;
|
|
|
|
|
subject = MimeUtility.decodeText(subject);
|
|
|
|
|
}
|
|
|
|
|
while (!subject.equals(prev));
|
|
|
|
|
}
|
|
|
|
|
return subject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Integer getSize() throws MessagingException {
|
|
|
|
|
int size = imessage.getSize();
|
|
|
|
|
return (size < 0 ? null : size);
|
|
|
|
|