'Pass1: Copy locally existing messages not on the other side.
This will copy messages to dstfolder that exist locally but are
not in the statusfolder yet. The strategy is:
1) Look for messages present in self but not in statusfolder.
2) invoke copymessageto() on those which:
- If dstfolder doesn\'t have it yet, add them to dstfolder.
- Update statusfolder.
This function checks and protects us from action in dryrun mode.'

def __syncmessagesto_copy(self, dstfolder, statusfolder):

    self.have_newmail = False
    threads = []
    copylist = [uid for uid in self.getmessageuidlist() if (not statusfolder.uidexists(uid))]
    num_to_copy = len(copylist)
    if (self.copy_ignoreUIDs is not None):
        for uid in self.copy_ignoreUIDs:
            if (uid in copylist):
                copylist.remove(uid)
                self.ui.ignorecopyingmessage(uid, self, dstfolder)
    if ((num_to_copy > 0) and self.repository.account.dryrun):
        self.ui.info('[DRYRUN]    Copy    {}    messages    from    {}[{}]    to    {}'.format(num_to_copy, self, self.repository, dstfolder.repository))
        return
    with self:
        for (num, uid) in enumerate(copylist):
            if offlineimap.accounts.Account.abort_NOW_signal.is_set():
                break
            if (uid == 0):
                self.ui.warn('Assertion    that    UID    !=    0    failed;    ignoring    message.')
                continue
            if ((uid > 0) and dstfolder.uidexists(uid)):
                flags = self.getmessageflags(uid)
                rtime = self.getmessagetime(uid)
                statusfolder.savemessage(uid, None, flags, rtime)
                continue
            self.ui.copyingmessage(uid, (num + 1), num_to_copy, self, dstfolder)
            if self.suggeststhreads():
                self.waitforthread()
                thread = threadutil.InstanceLimitedThread(self.getinstancelimitnamespace(), target=self.copymessageto, name=('Copy    message    from    %s:%s' % (self.repository, self)), args=(uid, dstfolder, statusfolder))
                thread.start()
                threads.append(thread)
            else:
                self.copymessageto(uid, dstfolder, statusfolder, register=0)
        for thread in threads:
            thread.join()
    if self.have_newmail:
        if (self.newmail_hook != None):
            self.newmail_hook()
