IMAP : Diagramme d'état


        +--------------------------------------------------+
        |        connexion initiale et salutations         |
        +--------------------------------------------------+
             || (1)             || (2)               || (3)
             VV                 ||                   ||
        +-----------------+     ||                   ||
        |non-authentifiée |     ||                   ||
        +-----------------+     ||                   ||
         || (7)       || (4)    ||                   ||
         ||           VV        VV                   ||
         ||        +----------------+                ||
         ||        |  authentifiée  |<====++         ||
         ||        +----------------+     ||         ||
         ||         || (7)    || (5)      ||(6)      ||
         ||         ||        VV          ||         ||
         ||         ||    +--------+      ||         ||
         ||         ||    |selected|======++         ||
         ||         ||    +--------+                 ||
         ||         ||        || (7)                 ||
         VV         VV        VV                     VV
        +--------------------------------------------------+
        |                   déconnexion                    |
        +--------------------------------------------------+
(1) connexion sans pré-authentification (OK greeting)
(2) connexion pré-authentifiée (PREAUTH greeting)
(3) connexion rejetée (BYE greeting)
(4) commande LOGIN ou AUTHENTICATE complétée avec succès
(5) commande SELECT ou EXAMINE complétée avec succès
(6) commande CLOSE, ou échec de la commande SELECT ou EXAMINE
(7) commande LOGOUT, arrêt du serveur, ou fermeture de connexion