IMAP times out


trying to access some email accounts using I get to the point where I can log in but ti won’t display the mail because it times out. The accounts in question have over 100 mb of unread mail. I believe most is SPAM but I don’t want to deleted everything unread any suggestions?