Fix construction of mail folders tree