-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: make Outlook support tolerant of invalid/empty nested Outlook message attachments #396
Comments
It seems like I've ran into the same/a similar issue I have an example mail that states that the recipient's server did not send a receipt for successfully delivering the mail so I thought this might be the same base use case. If not sorry for hijacking this issue, I'll open a new one then. I can't publish the mail here, but if you wand I can send it to you directly. I've tested this with version 7.1.1, but the original problem was discovered on a system using 6.6.1. Using the EmailConverter I get two warnings and finally the IllegalStateException. public static void main(String[] args) throws IOException {
String msgFileName = ".\\files\\Mittels Relay umgeleitet test.msg";
try (FileInputStream fileInputStream = new FileInputStream(msgFileName)){
EmailConverter.outlookMsgToEmail(fileInputStream);
//OutlookMessageParser outlookMessageParser = new OutlookMessageParser();
//OutlookMessage outlookMessage = outlookMessageParser.parseMsg(fileInputStream);
}
}
|
@Faelean I'm pretty sure you're mentioning the exact same issue. I could temporary fix it by doing a null check on See Line 107 in f306e89
|
@bbmedia, would you be able to share the email privately with me? I would like to see the error and investigate. |
@bbottema Just sent you an example by email. Thanks a lot! |
Fixed in 7.2.1. I'm just ignoring this very specific exception cause. Might be good to ignore any and all exceptions here, but for now I rather take it case by case, so we slowly build up a catalogue of known Outlook issues. |
About 6.x.x version range, I'm not sure I want to support it there. You can't move to 7.x.x? 6 is really old school. |
Thanks a lot for solving this issue! We are currently bound to 6.x.x because of the javax/jakarta dependency. But I do completely understand your point. |
We finally managed to fully migrate to 7.4.0. You can forget about V6 regarding this issue. Thanks a lot for all your work! |
If you work with Outlook/Exchange you can request delivery receipts for your emails. After sending an email, you'll get a receipt if the email has been successfully delivered to the recipient's server.
If the recipient's server supports these confirmations, the returning email can successfully be parsed and converted by Simple-Java-Mail's Outlook to email converter.
If the recipient's server doesn't support this feature, you'll get a different email from your Exchange server. This message contains an attached email without body (empty text, empty html, empty rtf). Therefore the
OutlookEmailConverter.buildEmailFromOutlookMessage
recursive call fails on line 111 because the mime-body of the attached mail is empty and the whole conversion is stopped with anIllegalStateException
(InternalEmailConverterImpl.java:42
).simple-java-mail/modules/outlook-module/src/main/java/org/simplejavamail/internal/outlooksupport/converter/OutlookEmailConverter.java
Line 111 in f306e89
I would suggest to make this conversion more fault-tolerant to support the mentioned Exchange messages.
Unfortunately, I can't attach a sample email because of privacy issues but I would be happy to help resolving this issue.
BTW: Because of some dependency issues, I still have to work with version 6.7.5.
The text was updated successfully, but these errors were encountered: