The normal operation of IMAP is as follows:
- The email client resolves the IP address of the IMAP server:
As shown in the preceding screenshot, the client establishes a TCP connection to port 143 when SSL/TSL is disabled. When SSL is enabled, the TCP session will be established over port 993.
- Once the session is established, the client sends an IMAP capability message requesting the server sends the capabilities supported by the server.
- This is followed by authentication for access to the server. When the authentication is successful, the server replies with response code 3 stating the login was a success:
- The client now sends the IMAP FETCH command to fetch any mails from the server.
- When the client is closed, it sends a logout message and clears the TCP session.