'If invoked without \'folder\', perform a NOOP and wait for
self.stop() to be called. If invoked with folder, switch to IDLE
mode and synchronize once we have a new message'

def __init__(self, parent, folder=None):

    self.parent = parent
    self.folder = folder
    self.stop_sig = Event()
    self.ui = getglobalui()
    if (folder is None):
        self.thread = Thread(target=self.noop)
    else:
        self.thread = Thread(target=self.__idle)
    self.thread.setDaemon(1)
