imap: Enabled APPEND support in imap_perform()

Added logic in imap_perform() to perform an APPEND rather than SELECT
and FETCH if an upload has been specified.