if (username == null) {
throw new MailAuthenticationException();
}
Folder inbox = null;
try {
<BUG>inbox = getUserInbox(config, auth);
inbox.open(Folder.READ_ONLY);</BUG>
long startTime = System.currentTimeMillis();
<BUG>List<EmailMessage> messages = getEmailMessages(inbox, start, count);
</BUG>
if ( log.isDebugEnabled() ) {

if (username == null) {
throw new MailAuthenticationException();
}
Folder inbox = null;
try {
Session session = openMailSession(config, auth);
inbox = getUserInbox(session, config.getInboxFolderName());
inbox.open(Folder.READ_ONLY);
long startTime = System.currentTimeMillis();
List<EmailMessage> messages = getEmailMessages(inbox, start, count, session);
if ( log.isDebugEnabled() ) {
