Refactored ImapService to combine redundant code in fetch and fetchBySeqNo.