Takes a list and extends it with lists of data, which is
    extracted from mbox messages.
    :param mboxfile: Mbox file name/path
    :param mailTable: A list (of lists)
    :return: An extended list of lists

def write_table(mboxfile, mailTable):
    """
    Takes a list and extends it with lists of data, which is
    extracted from mbox messages.
    :param mboxfile: Mbox file name/path
    :param mailTable: A list (of lists)
    :return: An extended list of lists
    """
    mail_box_contents = mailbox.mbox(mboxfile)

    m_pbar = tqdm.tqdm(range(0,len(mail_box_contents)))
    m_pbar.set_description('Extracting mbox messages...')

    count = 0
    update_interval = min(50,len(mail_box_contents))

    for message in mail_box_contents:
        count += 1
        if count % update_interval == 0:
            m_pbar.update(update_interval)
        clean_from = clean_address(message['From'])
        clean_to = clean_addresses(message['To'])
        clean_cc = clean_addresses(message['Cc'])

        try:
            clean_date = email.parsedate_to_datetime(message['Date'])
        except:
            clean_date = None

        mailTable.append([
            clean_from,
            clean_to,
            clean_cc,
            clean_date,
            message['Subject'],
            get_body(message)
            ])