StateChange event is fired each time user's state
changes. From the beginning, when user tries to connect to
server, his state will be set to 'StateConnecting'. Once he connects
successfully and starts accessing his mail, mostly
'StateLoggedIn' will be
set. During message retrieval, StateSendingMessage will be set.
Depending on values provided by this event, you can
inspect user's behavior on your server, deny access to
it or just store it locally for debugging purposes.