private static void fetchHeaderInfo(RewriteContext hr,Message[] msgs,
EmailConnection tmpEmailConn,
String headerlist) throws MessagingException {
Properties props = hr.request.props;
FetchProfile fp = new FetchProfile();
StringBuffer msgindex = new StringBuffer();
String connHandle = getConnHandle(hr);
StringTokenizer headerNames;
String msgNum;
long startmillis,endmillis;
/* Build the prefetch profile */
startmillis = System.currentTimeMillis();
if (headerlist != null) {
headerNames = new StringTokenizer(headerlist,", ");
fp.add(FetchProfile.Item.FLAGS);
while (headerNames.hasMoreTokens()) {
fp.add(headerNames.nextToken());
}
} else {
hr.request.log(Server.LOG_DIAGNOSTIC,connHandle,"no header list specified" +
" - retrieving all headers");
fp.add(FetchProfile.Item.FLAGS);
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.CONTENT_INFO);
}
/* Do a prefetch of the header/envelope information */
tmpEmailConn.currentFolder.getFolder().fetch(msgs,fp);