The login and logout requests are not candidates for recovery, but the return
values of all the network functions that are called from inside them, should be
checked thorougly.
Previously only network errors could cause a restoration of a session,
but now a BYE response sent by the server can also trigger it.
An option has been also added to control if and when the recover
function will be called.
This disables the sending of the "close notify" shutdown alert, only
after a network failure took place, and not during normal closing of a
connection.
When a "Connection reset by peer" error was caused while reading through SSL, a
restoration of the session should have taken place after all the connection
related structures were resetted. But instead a silent, unexpected and
unaccountable exit was the end result. This was caused by the underlying
socket being closed while trying to shutdown the SSL session.
Some of the functionality that was repeated in many places, regarding checks
and printing of informational messages, was replaced with common functions.
The session and selected variables should be reset if there has been a
connection problem or other failure.
The ifcore module methods that rely on the session should only be called
if there is a valid session variable defined.
It's better not to continuesly try to create a mailbox, when the server
continues to report TRYCREATE.
When appending messages it failed to create a mailbox when the mailbox
didn't exist and the server responded with TRYCREATE.
There is no point in having SSL/TLS IMAP support as optional, it's as
useful if not more than the the non-encrypted connections.
The Makefile was better organized to make it easier to change some
options during compile.
The SHAREDIR variable passed as configuration option has changed name.
Added a __gc metamethod to take care of the finalization of active
connections by logging out, when an account is deleted, or at the end of
the configuration (for Lua 5.2).
Instead of the account details, a pointer to the C structure is used in
Lua, stored as light userdata.
The 1.x deprecated configuration format has been removed, partly due to
the above change, and partly because it has been included for long
enough now.
The whole function that implements a request needs to be called again,
when there is a failure that leads to re-login, and not just the last
receive or send function that failed.