A persistent failure that could lead to a session not being able to be
recovered, or a failure during the login process (which is not covered
by the recovery function), would normally cause the process to
terminate. This is expected when the configuration is run once, but not
desirable when running in daemon mode.
And thus just after the process has become a daemon, a session that
could not be restored, either because the connection to the server could
not be established or the login and its related negotiations failed, is
now disabled temporarily, and a recoqnection is attempted at the
beginning of the next daemon loop iteration.
There is one exception to that, and that is when there is an
authentication error, for example when a wrong username or password has
been supplied, and in this case the process terminates and a relevant
error is printed.
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.
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.
Correct the functionality that provides monitoring of the current
selected mailbox in each account, where the wrong variable was written.
Simplify and clarify the code around this functionality.
Move the source code to the src dir, the man pages to the doc dir, and
the example configuration files to the samples dir, and update all
relevant files to reflect the changes.