'Return list of new mails'

def get_new_mails(self):

    if cint(self.settings.use_imap):
        email_list = []
        self.check_imap_uidvalidity()
        readonly = (False if (self.settings.email_sync_rule == u'UNSEEN') else True)
        self.imap.select(u'Inbox', readonly=readonly)
        (response, message) = self.imap.uid(u'search', None, self.settings.email_sync_rule)
        if message[0]:
            email_list = message[0].split()
    else:
        email_list = self.pop.list()[1]
    return email_list
