Direct IMAP management - kolabd replacement
Optional IMAP backend, pass tests with imap backend disabled, fixed IMAP::verifyAccount.
verifyAccount does not throw an exception for me (perhaps because of the httpform auth I'm using).
I ran into issues with just listing all folders because some shared folders shared with anyone were still returned.
Just listing the INBOX also seems less fragile.
We throw exceptions on imap errors because worker will handle this as a job failure and try again. If we just return false the job is not retried.
That being said... verifyAccount() (and VerifyJob) is not used anymore in this branch. With app.with_imap introduction we should call IMAP::verifyAccount() (not the job, the job could be removed later) from the CreateJob for "app.with_imap is disabled" case.
This line was important to be there. If the exception below is thrown the status update wouldn't happen, and we don't want that.
It should be app.with_imap here.
verifyAccount is currently primarily used in the tests, so let's throw in the job if necessary I propose.
It was invoked from the observer https://git.kolab.org/source/kolab/browse/master/src/app/Observers/UserObserver.php$69
With this whole refactor I propose to call IMAP::verifyAccount() from the CreateJob.