We have 2 exchange servers, one is non-production, the other is production, we use java mail to download emails which has .msg attachment we use following code to get email and save
Message[] msgArray = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), true));
...
Message m = msgArray[0];
File tempFile= new File("d:/test/001.eml");
FileOutputStream outStm = new FileOutputStream(tempfile);
m.writeTo(outStm);
......
Connect to non-production exchange server, we can find .msg attachment in 001.eml file, Connect to production exchange server, we can't find .msg attachment in 001.eml file, however attachment can found by using method provided here Download attachments using Java Mail while connect to production exchange server but run get attachment won't be able to work while connect to non-production exchange server.
Anyone can tell me why behavior is different with same code to download same kind of email in 2 different exchange servers, different configurations in exchange server?