public long getTotalMessageCount(Volume volume) throws MessageSearchException {
if (volume == null)
throw new MessageSearchException("assertion failure: null volume",logger);
//logger.debug("get total no emails {indexpath='"+volume.getIndexPath()+"'}");
int count = 0;
File indexDir = new File(volume.getIndexPath());
if (!indexDir.exists())
return 0;