Use IMAP for access and SMTP for submission
IMAP lists and manipulates mailboxes and messages. Outbound mail requires SMTP submission or a provider API. Keep the two connection checks and error states separate even when the product presents one mailbox account.