Merging two email accounts in El Capitan After the upgrade, El Capitan duplicated my Gmail account, which is now both as POP and IMAP (that is because I set up my Google Internet account in Yosemite, but I never set up the IMAP account in Mail.  El Capitan did it without asking...).  Because POP is a terrible protocol, some of the emails that were received or sent in the POP version of the account have not made it to the GMail server, and thus are just local to my computer.  What I want is to


move all the emails in the POP 'Inbox' to the IMAP 'Inbox'
move all the emails in the POP 'Sent' to the IMAP 'Sent'


without duplication (If I drag stuff around I would duplicate thousands of emails).  Is there a smart way of doing this?  Also pretty important is that my flagged emails are kept (some, annoyingly, are still stuck in the POP account).
Well I did nothing aside from waiting and 'synchronising' the account regularly, and thanks to the magic of IMAP the messages that had been in the POP account reappeared (I had chosen the option to save all the incoming and outgoing mail on the server).