As reported by bonswouar on IRC, the mail received hook is not invoked
when a new mail is received on an account that's not currently active,
only when that account is activated.
This is due to a bug in MessageStore.Update, that wrongly assumes that
messages in a directory are displayed in increasing UID order - this is
only the case when reverse-msglist-order (that defaults to false) is
true. So unless there's less than one page worth of messages in a
directory or reverse-msglist-order is true, MessageStore.Update will
think that new messages are outside of the current page, and not fetch
their headers (this is what might trigger the mail received hook).
This patch ensures that the order is properly taken into account, and
makes the mail received hook be invoked whether the account is active or
not.
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>