//First handle the headers
InputStream in = source.getInputStream();
try {
InternetHeaders headers = new InternetHeaders(in);
PrintWriter pos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
for (Enumeration e = headers.getNonMatchingHeaderLines(ignoreList); e.hasMoreElements(); ) {
String header = (String)e.nextElement();
pos.println(header);
}
pos.println();
pos.flush();
MimeMessageUtil.copyStream(in, bodyOs);
} finally {
IOUtil.shutdownStream(in);
}
} else {