
imaplib2 returns the type as string, like "OK" but returns imapdata as list of bytes, like [b'0'] so we need decode it to use the existing code
imaplib2 returns the type as string, like "OK" but returns imapdata as list of bytes, like [b'0'] so we need decode it to use the existing code