I use the standard example code, and use my real email address, I always get count as 0 for each mailbox, I sent lots of new email from my other email address to the test email address, but still, for all mailboxes, it shows count 0.
/// Low level IMAP API usage example
Future imapExample() async {
final client = ImapClient(isLogEnabled: false);
try {
await client.connectToServer(imapServerHost, imapServerPort,
isSecure: isImapServerSecure);
await client.login(userName, password);
final mailboxes = await client.listMailboxes();
print('mailboxes: $mailboxes');
await client.selectInbox();
// fetch 10 most recent messages:
final fetchResult = await client.fetchRecentMessages(
messageCount: 10, criteria: 'BODY.PEEK[]');
for (final message in fetchResult.messages) {
printMessage(message);
}
await client.logout();
} on ImapException catch (e) {
print('IMAP failed with $e');
}
}